Crossfire Server, Branch 1.12  R12190
Functions
sproto.h File Reference

Go to the source code of this file.

Functions

void add_player (socket_struct *ns)
 Tries to add player on the connection passwd in ns.
int alchemy (object *op, object *caster, object *spell_ob)
 Change items to gold nuggets.
int animate_weapon (object *op, object *caster, object *spell, int dir)
 Generalization of staff_to_snake().
void apply_builder_remove (object *pl, int dir)
 Item remover.
void apply_changes_to_player (object *pl, object *change)
 Applies (race) changes to a player.
int apply_container (object *op, object *sack)
 Handle apply on containers.
void apply_map_builder (object *pl, int dir)
 Global building function.
int apply_special (object *who, object *op, int aflags)
 Apply an object.
int attack_ob (object *op, object *hitter)
 Simple wrapper for attack_ob_simple(), will use hitter's values.
int auto_apply (object *op)
 Map was just loaded, handle op's initialisation.
void become_daemon (void)
 Starts the server as a daemon.
void become_follower (object *op, const object *new_god)
 This function is called whenever a player has switched to a new god.
void blind_living (object *op, object *hitter, int dam)
 Blind a living thing.
sint64 calc_skill_exp (object *who, object *op, object *skill)
 Calculates amount of experience can be gained for successfull use of a skill.
int can_apply_object (object *who, object *op)
 Checks to see if 'who' can apply object 'op'.
int can_detect_enemy (object *op, object *enemy, rv_vector *rv)
int can_pay (object *pl)
 Checks all unpaid items in op's inventory, adds up all the money they have, and checks that they can actually afford what they want to buy.
int can_see_enemy (object *op, object *enemy)
int cast_bless (object *op, object *caster, object *spell_ob, int dir)
 Improve statistics of some living object.
int cast_cause_disease (object *op, object *caster, object *spell, int dir)
 Let's try to infect something.
int cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent)
 Cast some stat-improving spell.
int cast_change_map_lightlevel (object *op, object *caster, object *spell)
 This changes the light level for the entire map.
int cast_cone (object *op, object *caster, int dir, object *spell)
 Casts a cone spell.
int cast_consecrate (object *op, object *caster, object *spell)
 A spell to make an altar your god's.
int cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 Create food.
int cast_create_missile (object *op, object *caster, object *spell, int dir, const char *stringarg)
 Create a missile (nonmagic - magic +4).
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).
int cast_create_town_portal (object *op, object *caster, object *spell, int dir)
 This function cast the spell of town portal for op.
int cast_curse (object *op, object *caster, object *spell_ob, int dir)
 Curse an object, reducing its statistics.
int cast_destruction (object *op, object *caster, object *spell_ob)
 Hit all monsters around the caster.
int cast_detection (object *op, object *caster, object *spell)
 Detect magic or invisible items.
void cast_dust (object *op, object *throw_ob, int dir)
 Handles op throwing objects of type 'DUST'.
int cast_earth_to_dust (object *op, object *caster, object *spell_ob)
 Basically destroys earthwalls in the area.
int cast_heal (object *op, object *caster, object *spell, int dir)
 Heals something.
int cast_identify (object *op, object *caster, object *spell)
 Identifies objects in the players inventory/on the ground.
int cast_invisible (object *op, object *caster, object *spell_ob)
 Makes the player or character invisible.
int cast_item_curse_or_curse (object *op, object *caster, object *spell_ob)
 This alters player's marked item's cursed or blessed status, based on the spell_ob's fields.
int cast_light (object *op, object *caster, object *spell, int dir)
 Illuminates something on a map, or try to blind a living thing.
void cast_magic_storm (object *op, object *tmp, int lvl)
 This is really used mostly for spell fumbles at the like.
int cast_polymorph (object *op, object *caster, object *spell_ob, int dir)
 Polymorph spell casting.
int cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg)
 This handles the raise dead / resurrection spells.
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.
int cast_spell (object *op, object *caster, int dir, object *spell_ob, char *stringarg)
 Main dispatch when someone casts a spell.
int cast_transfer (object *op, object *caster, object *spell, int dir)
 This spell transfers sp from the player to another person.
int cast_wonder (object *op, object *caster, int dir, object *spell_ob)
 wonder is really just a spell that will likely cast another spell.
int cast_word_of_recall (object *op, object *caster, object *spell_ob)
 Word of recall causes the player to return 'home'.
int caster_level (const object *caster, const object *spell)
 This function returns the effective level the spell is being cast at.
void * cfapi_archetype_get_property (int *type,...)
void * cfapi_friendlylist_get_next (int *type,...)
 Friend list access, to get objects on it.
void * cfapi_generate_random_map (int *type,...)
 Wrapper for generate_random_map().
void * cfapi_get_hooks (int *type,...)
void * cfapi_get_month_name (int *type,...)
 Wrapper for get_season_name().
void * cfapi_get_periodofday_name (int *type,...)
 Wrapper for get_season_name().
void * cfapi_get_season_name (int *type,...)
 Wrapper for get_season_name().
void * cfapi_get_time (int *type,...)
 Wrapper for get_tod().
void * cfapi_get_weekday_name (int *type,...)
 Wrapper for get_season_name().
void * cfapi_log (int *type,...)
 Wrapper for LOG().
void * cfapi_map_change_light (int *type,...)
 Wrapper for change_map_light().
void * cfapi_map_create_path (int *type,...)
 Wrapper for create_pathname() and create_overlay_pathname().
void * cfapi_map_delete_map (int *type,...)
void * cfapi_map_get_map (int *type,...)
 Gets map information.
void * cfapi_map_get_map_property (int *type,...)
void * cfapi_map_get_object_at (int *type,...)
 Wrapper for GET_MAP_OB().
void * cfapi_map_has_been_loaded (int *type,...)
 Wrapper for has_been_loaded().
void * cfapi_map_message (int *type,...)
void * cfapi_map_out_of_map (int *type,...)
 Wrapper for out_of_map().
void * cfapi_map_present_arch_by_name (int *type,...)
 Kinda wrapper for present_arch() (but uses a string, not an archetype*).
void * cfapi_map_set_map_property (int *type,...)
void * cfapi_map_trigger_connected (int *type,...)
 Wrapper for trigger_connected().
void * cfapi_map_update_position (int *type,...)
 Wrapper for update_position().
void * cfapi_object_apply (int *type,...)
 Applies an object.
void * cfapi_object_apply_below (int *type,...)
 Applies an object below.
void * cfapi_object_cast (int *type,...)
 Wrapper for query_money().
void * cfapi_object_change_abil (int *type,...)
 Wrapper for change_abil().
void * cfapi_object_change_exp (int *type,...)
 Wrapper for change_exp().
void * cfapi_object_check_inventory (int *type,...)
void * cfapi_object_check_spell (int *type,...)
 Wrapper for check_spell_known().
void * cfapi_object_check_trigger (int *type,...)
 Wrapper for check_trigger().
void * cfapi_object_clean_object (int *type,...)
void * cfapi_object_clear (int *type,...)
 Wrapper for clear_object().
void * cfapi_object_clone (int *type,...)
 Clone an object, either through object_create_clone() or copy_object().
void * cfapi_object_create (int *type,...)
 Wrapper for get_object(), create_archetype() and create_archetype_by_object_name().
void * cfapi_object_delete (int *type,...)
void * cfapi_object_describe (int *type,...)
 Wrapper for describe_item().
void * cfapi_object_distance (int *type,...)
 Wrapper for distance().
void * cfapi_object_drain (int *type,...)
void * cfapi_object_drop (int *type,...)
 Wrapper for drop().
void * cfapi_object_find (int *type,...)
void * cfapi_object_find_archetype_inside (int *type,...)
 Kinda wrapper for present_arch_in_ob().
void * cfapi_object_fix (int *type,...)
void * cfapi_object_forget_spell (int *type,...)
void * cfapi_object_get_key (int *type,...)
 Gets a key/value value for an object.
void * cfapi_object_get_property (int *type,...)
 Main object property getter.
void * cfapi_object_give_skill (int *type,...)
void * cfapi_object_identify (int *type,...)
 Wrapper for identify().
void * cfapi_object_insert (int *type,...)
void * cfapi_object_learn_spell (int *type,...)
void * cfapi_object_merge (int *type,...)
 Wrapper for merge_ob().
void * cfapi_object_move (int *type,...)
 Moves an object.
void * cfapi_object_on_same_map (int *type,...)
void * cfapi_object_pay_amount (int *type,...)
 Wrapper for pay_for_amount().
void * cfapi_object_pay_item (int *type,...)
 Wrapper for pay_for_item().
void * cfapi_object_pickup (int *type,...)
void * cfapi_object_query_cost (int *type,...)
 Wrapper for query_cost().
void * cfapi_object_query_money (int *type,...)
 Wrapper for query_money().
void * cfapi_object_remove (int *type,...)
void * cfapi_object_reset (int *type,...)
 Wrapper for clear_reset().
void * cfapi_object_say (int *type,...)
void * cfapi_object_set_key (int *type,...)
 Write a key/value for an object.
void * cfapi_object_set_property (int *type,...)
 Sets the property of an object.
void * cfapi_object_split (int *type,...)
 Wrapper for get_split_ob().
void * cfapi_object_spring_trap (int *type,...)
void * cfapi_object_teleport (int *type,...)
 Teleports an object at a specified destination if possible.
void * cfapi_object_transfer (int *type,...)
 Object transfer.
void * cfapi_object_transmute (int *type,...)
void * cfapi_object_update (int *type,...)
 Wrapper for update_object().
void * cfapi_object_user_event (int *type,...)
void * cfapi_party_get_property (int *type,...)
 Party-related functions.
void * cfapi_player_can_pay (int *type,...)
 Wrapper for can_pay().
void * cfapi_player_find (int *type,...)
 Wrapper for find_player_partial_name().
void * cfapi_player_message (int *type,...)
void * cfapi_region_get_property (int *type,...)
 Regions-related functions.
void * cfapi_set_random_map_variable (int *type,...)
 Wrapper for set_random_map_variable().
void * cfapi_system_add_string (int *type,...)
 Wrapper for add_string().
void * cfapi_system_check_path (int *type,...)
 Wrapper for check_path().
void * cfapi_system_directory (int *type,...)
void * cfapi_system_find_animation (int *type,...)
 Wrapper for find_animation().
void * cfapi_system_find_face (int *type,...)
 Wrapper for find_face().
void * cfapi_system_find_string (int *type,...)
 Wrapper for find_string().
void * cfapi_system_re_cmp (int *type,...)
 Wrapper for re_cmp().
void * cfapi_system_register_global_event (int *type,...)
void * cfapi_system_remove_string (int *type,...)
 Wrapper for free_string().
void * cfapi_system_strdup_local (int *type,...)
 Wrapper for strdup_local().
void * cfapi_system_unregister_global_event (int *type,...)
void * cfapi_timer_create (int *type,...)
 Wrapper for cfapi_timer_create().
void * cfapi_timer_destroy (int *type,...)
 Wrapper for cftimer_destroy().
int cftimer_create (int id, long delay, object *ob, int mode)
 Creates a new timer.
int cftimer_destroy (int id)
 Destroys an existing timer.
int cftimer_find_free_id (void)
 Finds a free ID for a new timer.
void cftimer_init (void)
 Initialize timers.
void cftimer_process_timers (void)
 Processes all timers.
int change_skill (object *who, object *new_skill, int flag)
 This changes the objects skill to new_skill.
void change_spell (object *op, char k)
 Rotate the selected range attack.
void check_active_maps (void)
 Finds maps in memory to reset.
void check_bullet (object *op)
 Checks to see what op should do, given the space it is on (eg, explode, damage player, etc).
void check_doors (object *op, mapstruct *m, int x, int y)
void check_earthwalls (object *op, mapstruct *m, int x, int y)
object * check_enemy (object *npc, rv_vector *rv)
 Checks npc->enemy and returns that enemy if still valid, NULL otherwise.
void check_login (object *op)
 Actually login a player, load from disk and such.
int check_name (player *me, const char *name)
 Ensure player's name is valid.
int check_password (char *typed, char *crypted)
 Check if 2 passwords match.
void check_physically_infect (object *victim, object *hitter)
 Possibly infect due to direct physical contact i.e., AT_PHYSICAL.
int check_pick (object *op)
 Sees if there is stuff to be picked up/picks up stuff, for players only.
void check_score (object *op, int quiet)
 Checks if player should enter the hiscore, and if so writes her into the list.
void check_spell_expiry (object *spell)
 Checks if player should be warned of soon expiring spell.
object * check_spell_known (object *op, const char *name)
 Checks to see if player knows the spell.
void check_spells (void)
 It goes through the spells looking for any obvious errors.
int check_weapon_power (const object *who, int improvs)
 This checks to see of the player (who) is sufficient level to use a weapon with improvs improvements (typically last_eat).
int checkbanned (const char *login, const char *host)
 Check if a player and/or host is banned.
void clean_tmp_files (void)
 Remove temporary map files.
void cleanup (void)
 Clean up everything and exit.
void cleanupPlugins (void)
 Call closePlugin() on the various plugins, used at server shutdown.
void clear_skill (object *who)
 This function just clears the chosen_skill and range_skill values in the player.
int command_abil (object *op, char *params)
 Changes an object's statistics.
int command_accuse (object *op, char *params)
 'accuse' command.
int command_addexp (object *op, char *params)
 This adds exp to a player.
int command_afk (object *op, char *params)
 Toggles the afk status of a player.
int command_apply (object *op, char *params)
 'apply' command.
int command_applymode (object *op, char *params)
 Players wants to change the apply mode, ie how to handle applying an item when no body slot available.
int command_archs (object *op, char *params)
 Archetype-related statistics.
int command_arrest (object *op, char *params)
 Wizard jails player.
int command_banish (object *op, char *params)
 Add player's IP to ban_file and kick them off the server.
int command_beg (object *op, char *params)
 'beg' command.
int command_bleed (object *op, char *params)
 'bleed' command.
int command_blush (object *op, char *params)
 'blush' command.
int command_body (object *op, char *params)
 This command dumps the body information for object *op.
int command_bounce (object *op, char *params)
 'bounce' command.
int command_bow (object *op, char *params)
 'bow' command.
int command_bowmode (object *op, char *params)
 Player wants to change the bowmode, how arrows are fired.
int command_brace (object *op, char *params)
 Player toggles her braced status.
int command_burp (object *op, char *params)
 'burp' command.
int command_cackle (object *op, char *params)
 'cackle' command.
int command_cast (object *op, char *params)
 'cast' command, prepares a spell for laster casting.
int command_cast_spell (object *op, char *params, char command)
 Sets up to cast a spell.
int command_chat (object *op, char *params)
 'chat' command.
int command_chuckle (object *op, char *params)
 'chuckle' command.
int command_clap (object *op, char *params)
 'clap' command.
int command_cointoss (object *op, char *params)
 'cointoss' command.
int command_cough (object *op, char *params)
 'cough' command.
int command_create (object *op, char *params)
 Wizard wants to create an object.
int command_cringe (object *op, char *params)
 'cringe' command.
int command_cry (object *op, char *params)
 'cry' command.
int command_dance (object *op, char *params)
 'dance' command.
int command_debug (object *op, char *params)
 Player wants to see/change the debug level.
int command_diff (object *op, char *params)
 Get a diff of specified items.
int command_disarm (object *op, char *params)
 'disarm' command.
int command_dm (object *op, char *params)
 Actual command to perhaps become dm.
int command_dmhide (object *op, char *params)
 A players wants to become DM and hide.
int command_dmtell (object *op, char *params)
 Private communication, by a DM (can't be ignored by player).
int command_drop (object *op, char *params)
 'drop' command.
int command_dropall (object *op, char *params)
 Command to drop all items that have not been locked.
int command_dump (object *op, char *params)
 Dumps the difference between an object and its archetype.
int command_dumpallarchetypes (object *op, char *params)
 Various archetypes-related statistics.
int command_dumpallmaps (object *op, char *params)
 Various map-related statistics.
int command_dumpallobjects (object *op, char *params)
 Various object-related statistics.
int command_dumpbelow (object *op, char *params)
 Player wants to dump object below her.
int command_dumpfriendlyobjects (object *op, char *params)
 Various friendly object-related statistics.
int command_dumpmap (object *op, char *params)
 Various map-related statistics.
int command_east (object *op, char *params)
 'east' command.
int command_empty (object *op, char *params)
 'empty' command.
int command_examine (object *op, char *params)
 'examine' command.
int command_explore (object *op, char *params)
 Player wants to enter explore mode, that is never-dying mode.
int command_fire (object *op, char *params)
 Player wants to start furing.
int command_fire_stop (object *op, char *params)
 Player wants to stop firing.
int command_fix_me (object *op, char *params)
 Wrapper to fix a player.
int command_flip (object *op, char *params)
 'flip' command.
int command_follow (object *op, char *params)
 DM wants to follow a player, or stop following a player.
int command_forget_spell (object *op, char *params)
 Wizard wishes to forget a spell.
int command_free (object *op, char *params)
 Totally free an object.
int command_freeze (object *op, char *params)
 Freezes a player for a specified tick count, 100 by default.
int command_frown (object *op, char *params)
 'frown' command.
int command_gasp (object *op, char *params)
 'gasp' command.
int command_giggle (object *op, char *params)
 'giggle' command.
int command_glare (object *op, char *params)
 'glare' command.
int command_goto (object *op, char *params)
 Wizard teleports to a map.
int command_grin (object *op, char *params)
 'grin' command.
int command_groan (object *op, char *params)
 'groan' command.
int command_growl (object *op, char *params)
 'growl' command.
int command_gsay (object *op, char *params)
 'gsay' command, talks to party.
int command_help (object *op, char *params)
 Player is asking for some help.
int command_hiccup (object *op, char *params)
 'hiccup' command.
int command_hide (object *op, char *params)
 Wizard 'hide' command.
int command_hiscore (object *op, char *params)
 Player is asking for the hiscore.
int command_hug (object *op, char *params)
 'hug' command.
int command_insert_into (object *op, char *params)
 Puts an object into another.
int command_inventory (object *op, char *params)
 Shows the inventory or some item.
int command_invisible (object *op, char *params)
 Wizard wants to become invisible.
int command_invoke (object *op, char *params)
 'invoke' command, fires a spell immediately.
int command_kick (object *op, const char *params)
 Kicks a player from the server.
int command_kill_pets (object *op, char *params)
 Player wants to get rid of pets.
int command_kiss (object *op, char *params)
 'kiss' command.
int command_language (object *op, char *params)
 This is the 'language' command.
int command_laugh (object *op, char *params)
 'laugh' command.
int command_learn_special_prayer (object *op, char *params)
 Wizard wants to learn a god-given spell.
int command_learn_spell (object *op, char *params)
 Wizard wants to learn a regular spell.
int command_lick (object *op, char *params)
 'lick' command.
int command_listen (object *op, char *params)
 Change the player's listen level.
int command_listplugins (object *op, char *params)
 Lists all plugins currently loaded with their IDs and full names.
int command_loadplugin (object *op, char *params)
 Loads the given plugin.
int command_loadtest (object *op, char *params)
 This command will stress server.
int command_lock_item (object *op, char *params)
 Alternate way to lock/unlock items (command line).
int command_malloc (object *op, char *params)
 Display memory information.
int command_mapinfo (object *op, char *params)
 'mapinfo' command.
int command_maps (object *op, char *params)
 'maps' command.
int command_mark (object *op, char *params)
 'mark' command, to mark an item for some effects (enchant armor, ...).
int command_me (object *op, char *params)
 'me' command.
int command_mon_aggr (object *op, char *params)
 When DM is possessing a monster, flip aggression on and off, to allow better motion.
int command_motd (object *op, char *params)
 Display the message of the day.
int command_news (object *op, char *params)
 Display the server news.
int command_nod (object *op, char *params)
 'nod' command.
int command_north (object *op, char *params)
 'north' command.
int command_northeast (object *op, char *params)
 'northeast' command.
int command_northwest (object *op, char *params)
 'northwest' command.
int command_nowiz (object *op, char *params)
 Steps down from wizard mode.
int command_orcknuckle (object *op, char *params)
 Plays the "orcknucke" game.
int command_output_count (object *op, char *params)
 output-count command.
int command_output_sync (object *op, char *params)
 Output-sync command.
int command_overlay_reset (object *op, char *params)
 Removes the overlay for op's current map.
int command_overlay_save (object *op, char *params)
 Saves the op's map as an overlay - objects are persisted.
int command_party (object *op, char *params)
 'party' command, subdivided in different sub commands.
int command_party_rejoin (object *op, char *params)
 Handles the 'party_rejoin' command.
int command_passwd (object *pl, char *params)
 Player is asking to change password.
int command_patch (object *op, char *params)
 Wizard wants to altar an object.
int command_peaceful (object *op, char *params)
 Player toggles her peaceful status.
int command_petmode (object *op, char *params)
 Player wants to change how her pets behave.
int command_pickup (object *op, char *params)
 'pickup' command.
int command_players (object *op, char *params)
 Display all known players.
int command_poke (object *op, char *params)
 'poke' command.
int command_possess (object *op, char *params)
 DM can possess a monster.
int command_pout (object *op, char *params)
 'pout' command.
int command_prepare (object *op, char *params)
 Equivalent to command_cast().
int command_printlos (object *op, char *params)
 Various LOS-related statistics.
int command_puke (object *op, char *params)
 'puke' command.
int command_quit (object *op, char *params)
 Player wants to totally delete her character.
int command_remove (object *op, char *params)
 Remove an object from its position.
int command_rename_item (object *op, char *params)
 Changing the custom name of an item.
int command_reply (object *op, char *params)
 Reply to last person who told you something [mids 01/14/2002].
int command_reset (object *op, char *params)
 Resets a map.
int command_resistances (object *op, char *params)
 Players wants to know her resistances.
int command_rotateshoottype (object *op, char *params)
 'rotateshoottype' command, switch range attack.
int command_rskill (object *pl, char *params)
 'ready_skill' command.
int command_rules (object *op, char *params)
 Display the server rules.
int command_run (object *op, char *params)
 Player wants to start running.
int command_run_stop (object *op, char *params)
 Player wants to stop running.
int command_save (object *op, char *params)
 Player wants to get saved.
int command_say (object *op, char *params)
 'say' command.
int command_scream (object *op, char *params)
 'scream' command.
int command_search (object *op, char *params)
 'search' command.
int command_search_items (object *op, char *params)
 'search-items' command.
int command_setgod (object *op, char *params)
 Sets the god for some objects.
int command_shake (object *op, char *params)
 'shake' command.
int command_shiver (object *op, char *params)
 'shiver' command.
int command_shout (object *op, char *params)
 'sbout' command.
int command_showpets (object *op, char *params)
 Players wants to know her pets.
int command_shrug (object *op, char *params)
 'shrug' command.
int command_shutdown (object *op, char *params)
 Totally shutdowns the server.
int command_sigh (object *op, char *params)
 'sigh' command.
int command_skills (object *op, char *params)
 Player is asking for her skills.
int command_slap (object *op, char *params)
 'slap' command.
int command_smile (object *op, char *params)
 'smile' command.
int command_smirk (object *op, char *params)
 'smirk' command.
int command_snap (object *op, char *params)
 'snap' command.
int command_sneeze (object *op, char *params)
 'sneeze' command.
int command_snicker (object *op, char *params)
 'snicker' command.
int command_sniff (object *op, char *params)
 'sniff' command.
int command_snore (object *op, char *params)
 'snore' command.
int command_sound (object *op, char *params)
 Player wants to change sound status.
int command_south (object *op, char *params)
 'south' command.
int command_southeast (object *op, char *params)
 'southeast' command.
int command_southwest (object *op, char *params)
 'southwest' command.
int command_speed (object *op, char *params)
 Changes the server speed.
int command_spit (object *op, char *params)
 'spit' command.
int command_ssdumptable (object *op, char *params)
 Various string-related statistics.
int command_stack_clear (object *op, char *params)
 Empty DM item stack.
int command_stack_list (object *op, char *params)
 Displays stack contents.
int command_stack_pop (object *op, char *params)
 Pop the stack top.
int command_stack_push (object *op, char *params)
 Push specified item on stack.
int command_statistics (object *pl, char *params)
 Prints out some useful information for the character.
int command_stats (object *op, char *params)
 Displays the statistics of a player.
int command_stay (object *op, char *params)
 'stay' command.
int command_strings (object *op, char *params)
 Various string-related statistics.
int command_strut (object *op, char *params)
 'strut' command.
int command_style_map_info (object *op, char *params)
 Displays information about styles loaded for random maps.
int command_sulk (object *op, char *params)
 'sulk' command.
int command_summon (object *op, char *params)
 Summons player near DM.
int command_take (object *op, char *params)
 This takes (picks up) and item.
int command_teleport (object *op, char *params)
 Teleport next to target player.
int command_tell (object *op, char *params)
 Private communication.
int command_thank (object *op, char *params)
 'thank' command.
int command_think (object *op, char *params)
 'think' command.
int command_throw (object *op, char *params)
 'throw' command.
int command_time (object *op, char *params)
 Players asks for the time.
int command_title (object *op, char *params)
 Player wishes to change her title.
int command_toggle_shout (object *op, char *params)
 A simple toggle for the no_shout field.
int command_twiddle (object *op, char *params)
 'twiddle' command.
int command_unloadplugin (object *op, char *params)
 Unloads the given plugin.
int command_use (object *op, char *params)
 Try to use an item on another.
int command_usekeys (object *op, char *params)
 Player wants to change how keys are used.
int command_uskill (object *pl, char *params)
 'use_skill' command.
int command_version (object *op, char *params)
 Server version.
int command_wave (object *op, char *params)
 'wave' command.
int command_west (object *op, char *params)
 'west' command.
int command_whereabouts (object *op, char *params)
 'whereabouts' command.
int command_whereami (object *op, char *params)
 'whereami' command.
int command_whistle (object *op, char *params)
 'whistle' command.
int command_who (object *op, char *params)
 'who' command.
int command_wimpy (object *op, char *params)
 Player wants to change how soon she'll flee.
int command_wink (object *op, char *params)
 'wink' command.
int command_wizcast (object *op, char *params)
 Wizard toggling "cast everywhere" ability.
int command_wizpass (object *op, char *params)
 Wizard toggling wall-crossing.
int command_yawn (object *op, char *params)
 'yawn' command.
void communicate (object *op, const char *txt)
 This function looks for an object or creature that is listening to said text.
int compute_path (object *source, object *target, int default_dir)
 Computes a path from source to target.
void cone_drop (object *op)
 Drops an object based on what is in the cone's "other_arch".
int confirm_party_password (object *op)
 Is the password the player entered to join a party the right one?
void confirm_password (object *op)
 Ask the player to confirm her password during creation.
void confuse_living (object *op, object *hitter, int dam)
 Confuse a living thing.
void control_golem (object *op, int dir)
 Makes the golem go in specified direction.
int coords_in_shop (mapstruct *map, int x, int y)
 Check if given map coords are in a shop.
void counterspell (object *op, int dir)
 Nullifies spell effects.
int create_aura (object *op, object *caster, object *spell)
 Create an aura spell object and put it in the player's inventory.
int create_bomb (object *op, object *caster, int dir, object *spell)
 Create a bomb.
char * crypt_string (char *str, char *salt)
 Encrypt a string.
int cure_disease (object *sufferer, object *caster)
 Do the cure disease stuff, from the spell "cure disease".
void current_map_info (object *op)
 'mapinfo' command.
void current_region_info (object *op)
 'whereami' command.
void dead_player (object *op)
 Kill a player on a permanent death server with resurrection.
void delete_character (const char *name)
 Totally deletes a character.
int describe_shop (const object *op)
 Gives a desciption of the shop on their current map to the player op.
void destroy_object (object *op)
 Recursively free_object() op and its inventory.
const char * determine_god (object *op)
 Determines if op worships a god.
archetype * determine_holy_arch (const object *god, const char *type)
 Determines the archetype for holy servant and god avatar.
int dimension_door (object *op, object *caster, object *spob, int dir)
 Teleport through some doors and space.
int dispel_rune (object *op, object *caster, object *spell, object *skill, int dir)
 Someone is trying to disarm a rune.
void display_high_score (object *op, int max, const char *match)
 Displays the high score file.
void display_motd (const object *op)
 Sends the message of the day to the player.
void display_who_entry (object *op, player *pl, const char *format)
 Display a line of 'who' to op, about pl, using the formatting specified by format.
object * dm_stack_peek (player *pl)
 Get current stack top item for player.
void dm_stack_pop (player *pl)
 Remove an item from the wizard's item stack.
void dm_stack_push (player *pl, tag_t item)
 Push specified item on player stack.
void do_forget_spell (object *op, const char *spell)
 Erases spell from player's inventory.
int do_harvest (object *pl, int dir, object *skill)
 Player is trying to harvest something.
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).
void do_learn_spell (object *op, object *spell, int special_prayer)
 Actually makes op learn spell.
int do_skill (object *op, object *part, object *skill, int dir, const char *string)
 Main skills use function-similar in scope to cast_spell().
void do_some_living (object *op)
 Regenerate hp/sp/gr, decreases food.
int do_wizard_dm (object *op, char *params, int silent)
 Actually changes a player to wizard.
void do_wizard_hide (object *op, int silent_dm)
 Actually hides or unhides specified player (obviously a DM).
void dragon_ability_gain (object *who, int atnr, int level)
 When a dragon-player gains a new stage of evolution, he gets some treasure.
void drain_rod_charge (object *rod)
 Drain charges from a rod.
void drain_wand_charge (object *wand)
 Drains a charge from a wand.
void drop (object *op, object *tmp)
 Drop an item, either on the floor or in a container.
object * drop_object (object *op, object *tmp, uint32 nrof)
 Try to drop an object on the floor.
void dump_spells (void)
 Dumps all the spells - now also dumps skill associated with the spell.
void emergency_save (int flag)
 Save all players.
void enter_exit (object *op, object *exit_ob)
 Tries to move 'op' to exit_ob.
void enter_player_savebed (object *op)
 This is a basic little function to put the player back to his savebed.
void examine (object *op, object *tmp)
 Player examines some object.
void examine_monster (object *op, object *tmp)
 Player examine a monster.
int execute_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix)
int execute_global_event (int eventcode,...)
int execute_newserver_command (object *pl, char *command)
 Player issued a command, let's handle it.
void explode_bullet (object *op)
 Causes an object to explode, eg, a firebullet, poison cloud ball, etc.
const object * find_god (const char *name)
 Returns pointer to specified god's object through pntr_to_god_obj().
object * find_key (object *pl, object *container, object *door)
 We try to find a key for the door as passed.
object * find_marked_object (object *op)
 Return the object the player has marked with the 'mark' command below.
object * find_mon_throw_ob (object *op)
object * find_nearest_living_creature (object *npc)
 Returns the nearest living creature (monster or generator).
playerfind_player (const char *plname)
 Find a player by her full name.
playerfind_player_partial_name (const char *plname)
 Find a player by a partial name.
command_array_structfind_plugin_command (char *cmd, object *op)
racelinkfind_racelink (const char *name)
 Find the race information for the specified name.
object * find_random_spell_in_ob (object *ob, const char *skill)
 This returns a random spell from 'ob'.
object * find_skill_by_name (object *who, const char *name)
 This returns the skill pointer of the given name (the one that accumlates exp, has the level, etc).
object * find_skill_by_number (object *who, int skillno)
 This returns the skill pointer of the given name (the one that accumlates exp, has the level, etc).
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.
int find_traps (object *pl, object *skill)
 Checks for traps on the spaces around the player or in certain objects.
void fire (object *op, int dir)
 Received a fire command for the player - go and do it.
int fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell)
 Fires an archetype.
int fire_bolt (object *op, object *caster, int dir, object *spob, object *skill)
 Cast a bolt-like spell.
int fire_bow (object *op, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy)
 Creature (monster or player) fires a bow.
int fire_bullet (object *op, object *caster, int dir, object *spob)
 Casts a bullet-like spell.
int fire_swarm (object *op, object *caster, object *spell, int dir)
 The following routine creates a swarm of objects.
void fix_auto_apply (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).
void fix_luck (void)
 Fixes luck of players, slowly move it towards 0.
object * fix_stopped_arrow (object *op)
 An ARROW stops moving.
void fix_stopped_item (object *op, mapstruct *map, object *originator)
 Put stopped item where stop_item() had found it.
void fix_weight (void)
 Check recursively the weight of all players, and fix what needs to be fixed.
void flush_old_maps (void)
 Removes tmp-files of maps which are going to be reset next time they are visited.
void follow_owner (object *ob, object *owner)
 A pet is trying to follow its owner.
int forbid_play (void)
 Checks if server should be started.
partylistform_party (object *op, const char *params)
 Forms the party struct for a party called 'params'.
int free_no_drop (object *op)
 Check whether the given object is FLAG_NO_DROP.
void free_server (void)
 Frees all memory allocated around here:
int friendly_fire (object *op, object *hitter)
 Find out if this is friendly fire (PVP and attacker is peaceful) or not.
object * get_dm_object (player *pl, char **params, int *from)
 Checks 'params' for object code.
partylistget_firstparty (void)
 Simple wrapper to get firstparty.
void get_name (object *op)
 Waiting for the player's name.
object * get_nearest_player (object *mon)
 Finds the nearest visible player for some object.
void get_party_password (object *op, partylist *party)
 Ask the player for the password of the party she wants to join.
void get_password (object *op)
 Waiting for the player's password.
int get_payment (object *pl, object *op)
 Descends containers looking for unpaid items, and pays for them.
object * get_pet_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.
void get_who_escape_code_value (char *return_val, int size, const char letter, player *pl)
 Returns the value of the escape code used in the who format specifier.
void give_initial_items (object *pl, treasurelist *items)
 Gives a new player her initial items.
void handle_apply_yield (object *tmp)
 This checks whether the object has a "on_use_yield" field, and if so generated and drops matching item.
int handle_newcs_player (object *op)
 Handles commands the player can send us, and various checks on invisibility, golem and such.
int hide (object *op, object *skill)
 Main hide handling.
int hideability (object *ob)
 Look at the surrounding terrain to determine the hideability of this object.
int hit_map (object *op, int dir, uint32 type, int full_hit)
 Attack a spot on the map.
int hit_player (object *op, int dam, object *hitter, uint32 type, int full_hit)
 Object is attacked by something.
object * hit_with_arrow (object *op, object *victim)
 hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile.
int infect_object (object *victim, object *disease, int force)
 Try to infect something with a disease.
void init (int argc, char **argv)
 This is the main server initialisation function.
void init_commands (void)
 Sorts the command arrays for easy search through bsearch().
void init_ob_methods (void)
 Initializes the ob_method system.
void init_skills (void)
 This just sets up the skill_names table above.
int initPlugins (void)
void inventory (object *op, object *inv)
 Prints object's inventory.
int is_in_shop (object *ob)
 Check if an object is in a shop.
int is_true_undead (object *op)
 Is the object a true undead?
int jump (object *pl, int dir, object *skill)
 Jump skill handling.
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).
void key_confirm_quit (object *op, char key)
 We receive the reply to the 'quit confirmation' message.
void key_roll_stat (object *op, char key)
 Player is currently swapping stats.
void kill_player (object *op)
 When a player should die (lack of hp, food, etc), we call this.
int learn_skill (object *pl, object *scroll)
 Player is trying to learn a skill.
void leave (player *pl, int draw_exit)
 Player logs out, or was disconnected.
void legacy_animate_trigger (object *op)
void legacy_apply_container (object *op, object *sack)
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.
void link_player_skills (object *op)
 This function goes through the player inventory and sets up the last_skills[] array in the player object.
void list_players (object *op, region *reg, partylist *party)
 Displays the players in a region or party.
object * lookup_spell_by_name (object *op, const char *spname)
 Look at object 'op' and see if they know the spell spname.
int magic_wall (object *op, object *caster, int dir, object *spell_ob)
 This creates magic walls.
void make_visible (object *op)
 Makes an object visible again.
int makes_invisible_to (object *pl, object *mon)
 This checks to see if 'pl' is invisible to 'mon'.
void malloc_info (object *op)
 Sends various memory-related statistics.
int manual_apply (object *op, object *tmp, int aflag)
 Main apply handler.
void map_info (object *op, char *search)
 This is the 'maps' command.
void meditate (object *pl, object *skill)
 Meditation skill handling.
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.
void monster_check_apply (object *mon, object *item)
int mood_change (object *op, object *caster, object *spell)
 This covers the various spells that change the moods of monsters - makes them angry, peacful, friendly, etc.
int move_disease (object *disease)
 Ticks the clock for disease: infect, aggravate symptoms, ...
void move_firewall (object *op)
 Move for FIREWALL.
void move_golem (object *op)
 Handles a golem's movement.
int move_monster (object *op)
 Main monster processing routine.
int move_ob (object *op, int dir, object *originator)
 Op is trying to move in direction dir.
int move_object (object *op, int dir)
 Try to move op in the direction "dir".
int move_player (object *op, int dir)
 Player gave us a direction, check whether to move or fire.
void move_player_attack (object *op, int dir)
 The player is also actually going to try and move (not fire weapons).
void move_player_mover (object *op)
 This function takes a PLAYERMOVER as an argument, and performs the function of a player mover, which is:
void move_symptom (object *symptom)
 Make the symptom do the nasty things it does.
int move_to (object *op, int x, int y)
 Move an object one square toward a specified destination on the same map.
void npc_call_help (object *op)
void npc_say (object *npc, const char *cp)
 Simple function to have some NPC say something.
void obsolete_parties (void)
 Remove unused parties (no players), this could be made to scale a lot better.
int ok_to_put_more (mapstruct *m, sint16 x, sint16 y, object *op, uint32 immune_stop)
 Returns true if it is ok to put spell op on the space/may provided.
int onoff_value (const char *line)
 Utility function to convert a reply to a yes/no or on/off value.
int op_on_battleground (object *op, int *x, int *y, archetype **trophy)
 Checks if the given object op (usually a player) is standing on a valid battleground-tile.
void paralyze_living (object *op, object *hitter, int dam)
 Paralyze a living thing.
int path_to_player (object *mon, object *pl, unsigned mindiff)
 Returns the direction to the player, if valid.
int pay_for_amount (uint64 to_pay, object *pl)
 Takes the amount of money from the the player inventory and from it's various pouches using the pay_from_container() function.
int pay_for_item (object *op, object *pl)
 DAMN: This is now a wrapper for pay_from_container, which is called for the player, then for each active container that can hold money until op is paid for.
int perceive_self (object *op)
 Living thing wants to know information.
void pet_move (object *ob)
 Handles a pet's movement.
int pick_lock (object *pl, int dir, object *skill)
 Lock pick handling.
void pick_up (object *op, object *alt)
 Try to pick up an item.
void play_again (object *op)
 Ask the player whether to play again or disconnect.
int player_apply (object *pl, object *op, int aflag, int quiet)
 Living thing is applying an object.
void player_apply_below (object *pl)
 Attempt to apply the object 'below' the player.
int player_can_view (object *pl, object *op)
 Check the player los field for viewability of the object op.
void player_unready_range_ob (player *pl, object *ob)
 Unready an object for a player.
int playername_ok (const char *cp)
 Is the player name valid.
int players_on_map (mapstruct *m, int show_all)
 Returns the count of players on a map, calculated from player list.
void plugins_display_list (object *op)
crossfire_pluginplugins_find_plugin (const char *id)
int plugins_init_plugin (const char *libfile)
int plugins_remove_plugin (const char *id)
void polymorph (object *op, object *who, int level)
 Handles polymorphing an object, living or not.
int pray (object *pl, object *skill)
 Praying skill handling.
void pray_at_altar (object *pl, object *altar, object *skill)
 Player prays at altar.
int probe (object *op, object *caster, object *spell_ob, int dir)
 Try to get information about a living thing.
void process_events (void)
 Process all active objects.
int process_object (object *op)
 Main object move function.
int push_ob (object *who, int dir, object *pusher)
 Something is pushing some other object.
void put_object_in_sack (object *op, object *sack, object *tmp, uint32 nrof)
 Something tries to put an object into another.
uint64 query_cost (const object *tmp, object *who, int flag)
 Return the price of an item for a character.
StringBufferquery_cost_string (const object *tmp, object *who, int flag, StringBuffer *buf)
 Finds the price of an item.
uint64 query_money (const object *op)
 Finds out how much money the player is carrying, including what is in containers.
void read_map_log (void)
 Reads temporary maps information from disk.
void receive_party_password (object *op)
 Player entered a party password.
void receive_play_again (object *op, char key)
 Player replied to play again / disconnect.
void receive_player_name (object *op)
 A player just entered her name.
void receive_player_password (object *op)
 A player just entered her password, including for changing it.
int recharge (object *op, object *caster, object *spell_ob)
 Recharge wands.
void recursive_roll (object *op, int dir, object *pusher)
 An object is pushed by another which is trying to take its place.
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.
void regenerate_rod (object *rod)
 Regenerates a rod's charges.
void register_all_ob_types (void)
 Calls the intialization functions for all individual types.
void remove_all_pets (void)
 This function checks all pets so they try to follow their master around the world.
int remove_curse (object *op, object *caster, object *spell)
 This function removes the cursed/damned status on equipped items.
void remove_door (object *op)
 Remove non locked doors.
void remove_locked_door (object *op)
 Same as remove_door() but for locked doors.
void remove_party (partylist *target_party)
 Remove and free party.
int remove_trap (object *op, object *skill)
 This skill will disarm any previously discovered trap.
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.
void roll_again (object *op)
 Ask the player what to do with the statistics.
int roll_stat (void)
 This rolls four 1-6 rolls and sums the best 3 of the 4.
void roll_stats (object *op)
 Roll the initial player's statistics.
int sack_can_hold (const object *pl, const object *sack, const object *op, uint32 nrof)
 Check if an item op can be put into a sack.
int save_player (object *op, int flag)
 Saves a player to disk.
void save_throw_object (object *op, uint32 type, object *originator)
 Object is attacked with some attacktype (fire, ice, ...).
void scroll_failure (object *op, int failure, int power)
 op made some mistake with a scroll, this takes care of punishment.
void sell_item (object *op, object *pl)
 Player is selling an item.
void send_news (const object *op)
 Send the news to a player.
void send_party_message (object *op, char *msg)
 Send a message to all party members except the speaker.
void send_rules (const object *op)
 Send the rules to a player.
int server_main (int argc, char **argv)
 Server main function.
void set_darkness_map (mapstruct *m)
 Set the darkness level for a map, based on the time of the day.
void set_map_timeout (mapstruct *oldmap)
 Applies the map timeout.
int set_object_face_main (object *op)
 Makes an object's face the main face, which is supposed to be the "closed" one.
void set_spell_skill (object *op, object *caster, object *spob, object *dest)
 Utility function to assign the correct skill when casting.
double shopkeeper_approval (const mapstruct *map, const object *player)
 Returns a double based on how much the shopkeeper approves of the player.
int 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.
int should_director_abort (object *op, object *victim)
 Check if op should abort moving victim because of it's race or slaying.
void show_skills (object *op, const char *search)
 Displays a player's skill list, and some other non skill related info (god, max weapon improvments, item power).
void shuffle_attack (object *op, int change_face)
 This routine shuffles the attack of op to one of the ones in the list.
int similar_direction (int a, int b)
 Is direction a similar to direction b? Find out in this exciting function below.
int singing (object *pl, int dir, object *skill)
 Singing skill handling.
int skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill)
 Core routine for use when we attack using a skills system.
int skill_ident (object *pl, object *skill)
 Main identification skill handling.
int skill_throw (object *op, object *part, int dir, const char *params, object *skill)
 Throwing skill handling.
int SP_level_dam_adjust (const object *caster, const object *spob)
 Returns adjusted damage based on the caster.
int SP_level_duration_adjust (const object *caster, const object *spob)
 Adjust the duration of the spell based on level.
int SP_level_range_adjust (const object *caster, const object *spob)
 Adjust the range of the spell based on level.
sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags)
 Scales the spellpoint cost of a spell by it's increased effectiveness.
void spell_effect (object *spob, int x, int y, mapstruct *map, object *originator)
 Inserts into map a spell effect based on other_arch.
void spell_failure (object *op, int failure, int power, object *skill)
 Handles the various effects for differing degrees of failure badness.
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.
void spring_trap (object *trap, object *victim)
 This function generalizes attacks by runes/traps.
int stand_in_light (object *op)
int stand_near_hostile (object *who)
 Determine if who is standing near a hostile creature.
void start_info (object *op)
 Gives basic start information to player.
int steal (object *op, int dir, object *skill)
 Main stealing function.
object * stop_item (object *op)
 An item (ARROW or such) stops moving.
void store_spell_expiry (object *spell)
 Stores in the spell when to warn player of expiration.
int summon_golem (object *op, object *caster, int dir, object *spob)
 Summons a monster.
int summon_hostile_monsters (object *op, int n, const char *monstername)
 Summons hostile monsters and places them in nearby squares.
int summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 General purpose summoning function.
void swap_below_max (const char *except_level)
 Tries to swap out maps which are still in memory, because of MAP_TIMEOUT until used objects is below MAX_OBJECTS or there are no more maps to swap.
int swap_map (mapstruct *map)
 Swaps a map to disk.
int tailor_god_spell (object *spellop, object *caster)
 Changes the attributes of cone, smite, and ball spells as needed by the code.
int teleport (object *teleporter, uint8 tele_type, object *user)
 Teleport an item around a nearby random teleporter of specified type.
void terminate_all_pets (object *owner)
 Removes all pets someone owns.
void tick_the_clock (void)
 This performs the basic function of advancing the clock one tick forward.
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.
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.
void trap_adjust (object *trap, int difficulty)
 Adjust trap difficulty to the map.
int trap_disarm (object *disarmer, object *trap, int risk, object *skill)
 Try to disarm a trap/rune.
int trap_see (object *op, object *trap)
 Should op see trap?
int trap_show (object *trap, object *where)
 Handles showing a trap/rune detonation.
int use_alchemy (object *op)
 Handle use_skill for alchemy-like items.
int use_oratory (object *pl, int dir, object *skill)
 Oratory skill handling.
int use_skill (object *op, const char *string)
 Similar to invoke command, it executes the skill in the direction that the user is facing.
int user_event (object *op, object *activator, object *third, const char *message, int fix)
int verify_player (const char *name, char *password)
 This verify that a character of name exits, and that it matches password.
void version (object *op)
 Displays basic game version information.
int write_mark (object *op, object *spell, const char *msg)
 This writes a rune that contains the appropriate message.
int write_on_item (object *pl, const char *params, object *skill)
 Writing skill handling.
int write_rune (object *op, object *caster, object *spell, int dir, const char *runename)
 Player is attempting to write a magical rune.

Function Documentation

void add_player ( socket_struct ns)

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.

Definition at line 383 of file player.c.

References add_friendly_object(), CLEAR_FLAG, display_motd(), socket_struct::faces_sent, fatal(), FLAG_FRIENDLY, get_name(), get_player(), socket_struct::inbuf, pl::ob, OUT_OF_MEMORY, send_news(), send_rules(), set_first_map(), pl::socket, and SockList_ResetRead().

Referenced by add_me_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2208 of file spell_effect.c.

References alchemy_object(), create_archetype(), F_TRUE, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, large, large_value, MOVE_WALK, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, query_cost(), QUERY_FLAG, small, small_value, SP_level_dam_adjust(), and SP_level_duration_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 wass 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 2954 of file spell_effect.c.

References add_friendly_object(), add_string(), 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, caster_level(), CLEAR_FLAG, control_golem(), draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_free_spot(), 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, get_split_ob(), GOLEM, insert_ob_in_map(), insert_ob_in_ob(), llevError, LOG(), MAX, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, name_to_material(), NDI_BLACK, NDI_UNIQUE, NROFATTACKS, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, query_name(), range_golem, remove_ob(), _materialtype::save, SET_FLAG, set_owner(), set_spell_skill(), snprintf(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), UPD_NROF, update_ob_speed(), and WEAPON.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 907 of file build_map.c.

References BUTTON, CF_HANDLE, DETECTOR, DOOR, draw_ext_info(), draw_ext_info_format(), FLAG_IS_FLOOR, FLAG_IS_LINKED, FLOOR, free_object(), freearr_x, freearr_y, GATE, GET_MAP_OB, llevError, LOG(), MAGIC_EAR, MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, NDI_UNIQUE, PEDESTAL, QUERY_FLAG, query_name(), remove_button_link(), remove_ob(), SIGN, TIMED_GATE, and WALL.

Referenced by apply_map_builder().

Here is the call graph for this function:

Here is the caller graph for this function:

void apply_changes_to_player ( object *  pl,
object *  change 
)

Applies (race) changes to a player.

Parameters:
plobject to change.
changewhat kind of changes to apply. Should be of type CLASS.

Definition at line 1776 of file apply.c.

References animate_object(), animations, CHA, change_attr_value(), CLASS, CLEAR_FLAG, FLAG_ANIMATE, FLAG_USE_WEAPON, GET_ANIM_ID, get_attr_value(), give_initial_items(), MAX_BUF, animations_struct::name, NUM_STATS, QUERY_FLAG, rndm(), set_attr_value(), SET_FLAG, snprintf(), and try_find_animation().

Referenced by player_changer_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

int apply_container ( object *  op,
object *  sack 
)

Handle apply on containers.

This is for containers that are applied by a player, whether in inventory or on the ground: eg, sacks, luggages, 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.
Returns:
1 if an object is apllied somehow or another, 0 if error/no apply
Author:
Eneq(at)(csd.uu.se)

Definition at line 230 of file apply.c.

References CLEAR_FLAG, CONTAINER, draw_ext_info_format(), esrv_send_inventory(), esrv_send_item(), esrv_update_item(), EVENT_CLOSE, execute_event(), find_key(), FLAG_APPLIED, get_split_ob(), insert_ob_in_map_at(), insert_ob_in_ob(), llevError, LOG(), MAX_BUF, MOVE_ALL, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), SCRIPT_FIX_ALL, SET_FLAG, set_object_face_main(), set_object_face_other(), UPD_FACE, and UPD_FLAGS.

Referenced by legacy_apply_container(), and loot_object().

Here is the call graph for this function:

Here is the caller graph for this function:

void apply_map_builder ( object *  pl,
int  dir 
)

Global building function.

This is the general map building function. Called when the player 'fires' a builder or remover object.

Parameters:
plplayer building or removing.
dirbuilding direction.

Definition at line 978 of file build_map.c.

References apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), can_build_over(), decrease_ob, draw_ext_info(), find_archetype(), find_marked_object(), FLAG_IS_BUILDABLE, freearr_x, freearr_y, GET_MAP_OB, llevError, LOG(), MAP_HEIGHT, MAP_WIDTH, MATERIAL, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, NDI_UNIQUE, object_create_arch(), PLAYER, QUERY_FLAG, range_builder, SET_FLAG, SIGN, ST_BD_BUILD, ST_BD_REMOVE, ST_MAT_FLOOR, ST_MAT_ITEM, ST_MAT_WALL, and ST_MAT_WINDOW.

Referenced by fire().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1139 of file apply.c.

References AMULET, AP_APPLY, AP_BASIC_FLAGS, AP_IGNORE_CURSE, AP_NOPRINT, AP_PRINT, AP_UNAPPLY, ARMOUR, BOOTS, BOW, BRACERS, BUILDER, CAN_APPLY_NEVER, can_apply_object(), CAN_APPLY_RESTRICTION, CAN_APPLY_UNAPPLY_CHOICE, change_abil(), change_skill(), check_weapon_power(), CLOAK, draw_ext_info(), draw_ext_info_format(), 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, get_ob_key_value(), get_split_ob(), GIRDLE, GLOVES, HELMET, HORN, insert_ob_in_ob(), Settings::item_power_factor, llevError, LOG(), MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BADBODY, MSG_TYPE_APPLY_CURSED, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_PROHIBITION, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_HIT, NDI_UNIQUE, Settings::personalized_blessings, PLAYER, QUERY_FLAG, query_name(), random_roll(), range_bow, range_builder, range_misc, range_skill, RING, ROD, SET_FLAG, settings, SHIELD, SKILL, SKILL_TOOL, unapply_always, unapply_for_ob(), unapply_never, unapply_nochoice, unapply_special(), UPD_FLAGS, 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:

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 929 of file attack.c.

References attack_ob_simple().

Referenced by do_skill_attack(), and move_golem().

Here is the call graph for this function:

Here is the caller graph for this function:

int auto_apply ( object *  op)

Map was just loaded, handle op's initialisation.

Generates shop floor's item, and treasures.

Parameters:
opobject to initialize.
Returns:
1 if object was initialized, 0 else.

Definition at line 85 of file standalone.c.

References CLEAR_FLAG, create_treasure(), FLAG_AUTO_APPLY, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_A_TEMPLATE, FLAG_UNPAID, free_object(), generate_treasure(), GT_ENVIRONMENT, HAS_RANDOM_ITEMS, identify(), insert_ob_in_map(), insert_ob_in_ob(), MAX, QUERY_FLAG, remove_ob(), SET_FLAG, SHOP_FLOOR, and TREASURE.

Referenced by do_auto_apply(), and fix_auto_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

void become_daemon ( void  )

Starts the server as a daemon.

Definition at line 72 of file daemon.c.

References getpid, and logfile.

Referenced by init().

Here is the caller graph for this function:

void 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).

Parameters:
opplayer switching cults.
new_godnew god to worship.
Todo:
isn't there duplication with check_special_prayers() for spell removing?

Definition at line 502 of file gods.c.

References add_string(), ARMOUR, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_POISON, BOOK, BOOTS, cast_magic_storm(), change_abil(), check_special_prayers(), CLEAR_FLAG, create_archetype(), determine_god(), draw_ext_info_format(), EXPERIENCE, 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(), FORCE, free_object(), free_string(), get_archetype_by_type_subtype(), give_skill_by_name(), GLOVES, god_gives_present(), HELMET, treasurestruct::item, link_player_skills(), LOOSE_MANA, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, NDI_NAVY, NDI_UNIQUE, treasurestruct::next, NROFATTACKS, player_unready_range_ob(), PREFER_LOW, present_in_ob_by_name(), QUERY_FLAG, random_roll(), remove_ob(), SET_FLAG, SHIELD, SK_PRAYING, SKILL, SPELL, SPELLBOOK, stop_using_item(), 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:

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

Blind a living thing.

Parameters:
opvictim.
hitterwho is attacking.
damdamage to deal.

Definition at line 2276 of file attack.c.

References ATNR_BLIND, BLINDNESS, change_abil(), create_archetype(), draw_ext_info_format(), fix_object(), FLAG_APPLIED, FLAG_BLIND, get_owner(), insert_ob_in_ob(), MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, NDI_UNIQUE, present_in_ob(), query_name(), and SET_FLAG.

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:

sint64 calc_skill_exp ( object *  who,
object *  op,
object *  skill 
)

Calculates amount of experience can be gained for successfull 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 relevent 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

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

Definition at line 599 of file skill_util.c.

References FLAG_ALIVE, llevDebug, LOG(), MAX, PLAYER, QUERY_FLAG, RUNE, settings, Settings::simple_exp, SKILL, and TRAP.

Referenced by attempt_jump(), book_type_apply(), do_hidden_move(), do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident2(), find_traps(), hide(), 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:

int can_apply_object ( object *  who,
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 955 of file apply.c.

References BOW, CAN_APPLY_NEVER, CAN_APPLY_RESTRICTION, CAN_APPLY_UNAPPLY, CAN_APPLY_UNAPPLY_CHOICE, CAN_APPLY_UNAPPLY_MULT, FABS, FLAG_APPLIED, FLAG_USE_ARMOUR, FLAG_USE_BOW, FLAG_USE_RANGE, FLAG_USE_RING, FLAG_USE_SHIELD, FLAG_USE_WEAPON, get_item_from_body_location(), HORN, IS_ARMOR, IS_SHIELD, IS_WEAPON, PLAYER, QUERY_FLAG, RING, ROD, SHIELD, WAND, and WEAPON.

Referenced by apply_special(), and monster_check_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

int can_detect_enemy ( object *  op,
object *  enemy,
rv_vector rv 
)

Definition at line 2020 of file monster.c.

References can_see_enemy(), find_skill_by_number(), FLAG_WIZ, get_rangevector(), llevError, LOG(), make_visible(), MAX, MIN_MON_RADIUS, on_same_map(), PLAYER, QUERY_FLAG, and SK_HIDING.

Referenced by attempt_steal(), check_enemy(), get_nearest_player(), and get_pet_enemy().

Here is the call graph for this function:

Here is the caller graph for this function:

int can_pay ( object *  pl)

Checks all unpaid items in op's inventory, adds up all the money they have, and checks that they can actually afford what they want to buy.

Prints appropriate messages to the player.

Parameters:
plplayer trying to bug.
Return values:
1player could buy the items.
0some items can't be bought.

Definition at line 938 of file shop.c.

References coins, cost_string_from_value(), count_unpaid(), draw_ext_info(), find_archetype(), llevError, LOG(), make_list_like(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_PAYMENT, NDI_UNIQUE, NUM_COINS, PLAYER, query_money(), snprintf(), and stringbuffer_finish().

Referenced by cfapi_player_can_pay(), and shop_mat_type_move_on().

Here is the call graph for this function:

Here is the caller graph for this function:

int can_see_enemy ( object *  op,
object *  enemy 
)
int cast_bless ( object *  op,
object *  caster,
object *  spell_ob,
int  dir 
)

Improve statistics of some living object.

Parameters:
opwho is casting.
casterwhat is casting.
spell_obactual spell object.
dircasting direction.
Return values:
0spell failed.
1spell was successful.

Definition at line 1965 of file spell_effect.c.

References add_refcount(), add_string(), AT_PHYSICAL, ATNR_GODPOWER, change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_god(), find_target_for_friendly_spell(), fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), insert_ob_in_ob(), MIN, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_SPELL_TARGET, NDI_UNIQUE, NROFATTACKS, SET_FLAG, and SP_level_duration_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Let's try to infect something.

Parameters:
opwho is casting.
casterwhat object is casting.
spellspell object to cast.
dircast direction.
Return values:
0no one caught anything.
1at least one living was affected.

Definition at line 1310 of file spell_attack.c.

References arch_to_object(), caster_level(), create_archetype(), draw_ext_info(), draw_ext_info_format(), FLAG_MONSTER, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, infect_object(), insert_ob_in_map(), MOVE_FLY_LOW, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1825 of file spell_effect.c.

References add_refcount(), change_abil(), CLEAR_FLAG, create_archetype(), draw_ext_info(), draw_ext_info_format(), find_target_for_friendly_spell(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_SEE_IN_DARK, FLAG_XRAYS, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_attr_value(), insert_ob_in_ob(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, no_gain_msgs, NROFATTACKS, NUM_STATS, PLAYER, QUERY_FLAG, rndm(), set_attr_value(), SET_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), and store_spell_expiry().

Referenced by cast_spell(), and god_intervention().

Here is the call graph for this function:

Here is the caller graph for this function:

int cast_change_map_lightlevel ( object *  op,
object *  caster,
object *  spell 
)

This changes the light level for the entire map.

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

Definition at line 3183 of file spell_effect.c.

References change_map_light(), draw_ext_info(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, and NDI_UNIQUE.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 403 of file spell_attack.c.

References arch_to_object(), AT_FEAR, AT_GODPOWER, AT_HOLYWORD, AT_TURN_UNDEAD, caster_level(), cone_drop(), draw_ext_info(), fear_bonus, FLAG_UNDEAD, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), llevDebug, LOG(), MOVE_FLY_LOW, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), tailor_god_spell(), and turn_bonus.

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:

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 2873 of file spell_effect.c.

References arch_to_object(), caster_level(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_archetype(), find_god(), FLAG_IS_FLOOR, HOLY_ALTAR, insert_ob_in_map(), llevError, LOG(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, QUERY_FLAG, remove_ob(), snprintf(), and tolower.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 639 of file spell_effect.c.

References cast_create_obj(), copy_object(), draw_ext_info(), DRINK, find_archetype_by_object_type_name(), first_archetype, FOOD, get_object(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, and SP_level_duration_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 525 of file spell_effect.c.

References BOW, cast_create_obj(), create_archetype(), draw_ext_info_format(), find_archetype(), find_artifactlist(), FLAG_APPLIED, FLAG_IDENTIFIED, free_object(), give_artifact_abilities(), artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, artifactstruct::next, pick_up(), PLAYER, QUERY_FLAG, SET_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), and strcasecmp().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

we pass 'caster', but don't use it for anything. This is really just a simple wrapper function .

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

Definition at line 517 of file spell_util.c.

References draw_ext_info(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, and P_OUT_OF_MAP.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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, appartements 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.delbecq@usa.net)

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

Definition at line 1122 of file spell_effect.c.

References add_string(), arch_to_object(), cast_create_obj(), caster_level(), check_inv_recursive(), create_archetype(), Settings::create_home_portals, draw_ext_info(), EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FREE_AND_COPY, free_object(), free_string(), insert_ob_in_map(), insert_ob_in_ob(), mapdef::last_reset_time, llevDebug, llevError, Settings::localdir, LOG(), MAP_PLAYER_UNIQUE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_NAVY, NDI_UNIQUE, present_arch(), ready_map_name(), remove_ob(), settings, and snprintf().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Curse an object, reducing its statistics.

Parameters:
opwho is casting.
casterwhat object is casting.
spell_obspell object to cast.
dircast direction.
Return values:
0curse had no effect.
1something was cursed.

Definition at line 914 of file spell_attack.c.

References add_refcount(), change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_god(), fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_pointed_target(), insert_ob_in_ob(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_SPELL, NDI_UNIQUE, PLAYER, SET_FLAG, SP_level_duration_adjust(), and SPELL_GRACE.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 819 of file spell_attack.c.

References arch_to_object(), ATNR_MAGIC, change_skill(), find_skill_by_name(), FLAG_ALIVE, FLAG_FRIENDLY, get_map_flags(), GET_MAP_OB, hit_player(), insert_ob_in_map(), make_object_glow(), P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, SP_DESTRUCTION, SP_FAERY_FIRE, SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Detect magic or invisible items.

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

Definition at line 2500 of file spell_effect.c.

References ALTAR, arch_to_object(), AT_MAGIC, BOOK, BUTTON, caster_level(), CF_HANDLE, CLEAR_FLAG, determine_god(), esrv_send_item(), EXIT, find_god(), FLAG_ANIMATE, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_IS_FLOOR, FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FLAG_MAKE_INVIS, FLAG_MONSTER, FLAG_WIZ, GATE, get_map_flags(), GET_MAP_OB, HOLE, HOLY_ALTAR, insert_ob_in_map(), is_magical(), LOCKED_DOOR, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), RUNE, SET_FLAG, SIGN, SP_level_range_adjust(), SPECIAL_KEY, TELEPORTER, TRAPDOOR, TREASURE, TRIGGER_PEDESTAL, and WEAPON.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3682 of file player.c.

References cast_spell(), draw_ext_info_format(), find_skill_by_name(), FLAG_REMOVED, free_object(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, and remove_ob().

Referenced by do_throw().

Here is the call graph for this function:

Here is the caller graph for this function:

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 882 of file spell_effect.c.

References AT_PHYSICAL, FLAG_TEAR_DOWN, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1679 of file spell_effect.c.

References AT_BLIND, AT_CONFUSION, AT_DISEASE, AT_POISON, cure_disease(), draw_ext_info(), find_archetype(), find_target_for_friendly_spell(), FORCE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, PREFER_HIGH, present_arch_in_ob(), present_in_ob_by_name(), and random_roll().

Referenced by cast_spell(), and god_intervention().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2419 of file spell_effect.c.

References draw_ext_info(), draw_ext_info_format(), esrv_update_item(), FLAG_IDENTIFIED, GET_MAP_OB, identify(), MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, need_identify(), ob_describe(), PLAYER, QUERY_FLAG, SP_level_dam_adjust(), spell_effect(), UPD_FLAGS, and UPD_NAME.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 821 of file spell_effect.c.

References active_objects, add_refcount(), draw_ext_info(), FLAG_MAKE_INVIS, FREE_AND_CLEAR_STR, makes_invisible_to(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, SP_level_duration_adjust(), and update_object().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

int cast_item_curse_or_curse ( object *  op,
object *  caster,
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.
casterwhat object was used to cast the spell.
spell_obspell itself.
Returns:
1 if item was changed, 0 else.

Definition at line 2367 of file spell_effect.c.

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, 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:

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 1235 of file spell_attack.c.

References arch_to_object(), draw_ext_info(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), insert_ob_in_map(), llevError, LOG(), MAX_LIGHT_RADII, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

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

Definition at line 55 of file spell_effect.c.

References insert_ob_in_map().

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:

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 453 of file spell_effect.c.

References arch_to_object(), caster_level(), FLAG_IS_FLOOR, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, insert_ob_in_map(), MOVE_FLY_LOW, P_NO_MAGIC, P_OUT_OF_MAP, polymorph(), QUERY_FLAG, and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 mehlhaff@soda.berkeley.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 186 of file resurrection.c.

References arch_to_object(), caster_level(), CORPSE, draw_ext_info(), draw_ext_info_format(), find_archetype(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, insert_ob_in_map(), treasurestruct::item, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, treasurestruct::next, treasurestruct::nrof, P_OUT_OF_MAP, remove_ob(), resurrect_player(), resurrection_fails(), and summon_hostile_monsters().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 655 of file spell_attack.c.

References arch_to_object(), AT_DEATH, AT_GODPOWER, AT_HOLYWORD, caster_level(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_god(), FLAG_REFL_SPELL, FLAG_UNDEAD, free_object(), get_pointed_target(), HUGE_BUF, insert_ob_in_map(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), set_owner(), set_spell_skill(), SP_EXPLOSION, SP_level_dam_adjust(), SP_level_range_adjust(), SPELL_EFFECT, SPELL_GRACE, SPELL_MANA, and tailor_god_spell().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1308 of file spell_util.c.

References alchemy(), animate_weapon(), apply_anim_suffix(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_change_map_lightlevel(), cast_cone(), cast_consecrate(), cast_create_food(), cast_create_missile(), cast_create_town_portal(), cast_curse(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_heal(), cast_identify(), cast_invisible(), cast_item_curse_or_curse(), cast_light(), cast_polymorph(), cast_raise_dead_spell(), cast_smite_spell(), cast_transfer(), cast_wonder(), cast_word_of_recall(), caster_level(), Settings::casting_time, change_skill(), cleric_chance, create_aura(), create_bomb(), determine_god(), dimension_door(), dispel_rune(), draw_ext_info(), draw_ext_info_format(), draw_magic_map(), FABS, find_random_spell_in_ob(), find_skill_by_name(), fire_arch_from_position(), fire_bolt(), fire_bullet(), fire_swarm(), FIREWALL, FLAG_ALIVE, FLAG_CONFUSED, FLAG_MONSTER, FLAG_WIZ, FLAG_WIZCAST, freearr_x, freearr_y, get_map_flags(), get_owner(), handle_spell_confusion(), HORN, llevError, LOG(), magic_wall(), MAX, MAX_BUF, 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, NDI_UNIQUE, P_NO_CLERIC, P_NO_MAGIC, PATH_TIME_MULT, perceive_self(), 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, recharge(), remove_curse(), rndm(), ROD, RUNE, SCROLL, settings, SOUND_TYPE_SPELL, 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_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, SPELL, spell_effect(), spell_failure(), Settings::spell_failure_effects, SPELL_GRACE, SPELL_MANA, strdup_local(), summon_golem(), summon_object(), TRUE, WAND, write_mark(), and write_rune().

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_firewall(), potion_type_apply(), scroll_type_apply(), spring_trap(), and START_TEST().

Here is the caller graph for this function:

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 2726 of file spell_effect.c.

References caster_level(), charge_mana_effect(), draw_ext_info(), FLAG_ALIVE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_BLACK, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, and SP_level_dam_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 997 of file spell_effect.c.

References cast_cone(), cast_spell(), generate_treasure(), llevError, LOG(), rndm(), SP_WONDER, and SPELL.

Referenced by cast_spell(), and scroll_failure().

Here is the call graph for this function:

Here is the caller graph for this function:

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 935 of file spell_effect.c.

References add_string(), create_archetype(), draw_ext_info(), EXIT_PATH, EXIT_X, EXIT_Y, find_obj_by_type_subtype(), FORCE_NAME, insert_ob_in_ob(), llevError, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, SP_level_duration_adjust(), SP_WORD_OF_RECALL, SPELL_EFFECT, and update_ob_speed().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 237 of file spell_util.c.

References NUM_SKILLS, and PLAYER.

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(), create_aura(), fire_arch_from_position(), fire_swarm(), magic_wall(), mood_change(), remove_curse(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SP_level_spellpoint_cost(), summon_golem(), summon_object(), and write_rune().

Here is the caller graph for this function:

void* cfapi_archetype_get_property ( int *  type,
  ... 
)
void* cfapi_friendlylist_get_next ( int *  type,
  ... 
)

Friend list access, to get objects on it.

Expects one parameter, ob.

Parameters:
typeunused
Returns:
  • if ob is NULL, gets the first object on the friendlylist.
  • if not NULL, get next object on the friendlylist after ob. NULL if none or ob not on list.

Definition at line 4439 of file plugins.c.

References CFAPI_POBJECT, and first_friendly_object.

void* cfapi_generate_random_map ( int *  type,
  ... 
)

Wrapper for generate_random_map().

Parameters:
typeunused.
Returns:
NULL.

Definition at line 4511 of file plugins.c.

References generate_random_map().

Here is the call graph for this function:

void* cfapi_get_hooks ( int *  type,
  ... 
)

Definition at line 527 of file plugins.c.

References CFAPI_FUNC, CFAPI_NONE, _hook_entry::func, and NR_OF_HOOKS.

Referenced by plugins_init_plugin().

Here is the caller graph for this function:

void* cfapi_get_month_name ( int *  type,
  ... 
)

Wrapper for get_season_name().

Parameters:
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns:
NULL.

Definition at line 981 of file plugins.c.

References get_month_name(), and string_get_int.

Here is the call graph for this function:

void* cfapi_get_periodofday_name ( int *  type,
  ... 
)

Wrapper for get_season_name().

Parameters:
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns:
NULL.

Definition at line 993 of file plugins.c.

References get_periodofday(), and string_get_int.

Here is the call graph for this function:

void* cfapi_get_season_name ( int *  type,
  ... 
)

Wrapper for get_season_name().

Parameters:
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns:
NULL.

Definition at line 957 of file plugins.c.

References get_season_name(), and string_get_int.

Here is the call graph for this function:

void* cfapi_get_time ( int *  type,
  ... 
)

Wrapper for get_tod().

Parameters:
typewill be CFAPI_NONE.
Returns:
NULL.

Definition at line 924 of file plugins.c.

References CFAPI_NONE, and get_tod().

Here is the call graph for this function:

void* cfapi_get_weekday_name ( int *  type,
  ... 
)

Wrapper for get_season_name().

Parameters:
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns:
NULL.

Definition at line 969 of file plugins.c.

References get_weekday(), and string_get_int.

Here is the call graph for this function:

void* cfapi_log ( int *  type,
  ... 
)

Wrapper for LOG().

Parameters:
typewill be CFAPI_NONE.
Returns:
NULL.

Definition at line 1069 of file plugins.c.

References CFAPI_NONE, and LOG().

Here is the call graph for this function:

void* cfapi_map_change_light ( int *  type,
  ... 
)

Wrapper for change_map_light().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 1512 of file plugins.c.

References CFAPI_INT, and change_map_light().

Here is the call graph for this function:

void* cfapi_map_create_path ( int *  type,
  ... 
)

Wrapper for create_pathname() and create_overlay_pathname().

Parameters:
typewill be CFAPI_STRING.
Returns:
NULL.

Definition at line 1170 of file plugins.c.

References CFAPI_NONE, CFAPI_STRING, create_overlay_pathname(), create_pathname(), and MAX_BUF.

Here is the call graph for this function:

void* cfapi_map_delete_map ( int *  type,
  ... 
)

Definition at line 1413 of file plugins.c.

References CFAPI_NONE, and delete_map().

Here is the call graph for this function:

void* cfapi_map_get_map ( int *  type,
  ... 
)

Gets map information.

First parameter is a integer, which should be:

  • 0 with 2 int and a mapstruct**: new map of specified size.
  • 1 with char*, int, mapstruct**: call ready_map_name().
  • 2 with mapstruct*, 2 int and mapstruct**: call to get_map_from_coord().

Definition at line 1095 of file plugins.c.

References CFAPI_NONE, CFAPI_PMAP, get_empty_map(), get_map_from_coord(), and ready_map_name().

Here is the call graph for this function:

void* cfapi_map_get_map_property ( int *  type,
  ... 
)
void* cfapi_map_get_object_at ( int *  type,
  ... 
)

Wrapper for GET_MAP_OB().

Parameters:
typewill be CFAPI_POBJECT.
Returns:
NULL.

Definition at line 1451 of file plugins.c.

References CFAPI_POBJECT, get_map_flags(), GET_MAP_OB, and P_OUT_OF_MAP.

Here is the call graph for this function:

void* cfapi_map_has_been_loaded ( int *  type,
  ... 
)

Wrapper for has_been_loaded().

Parameters:
typewill be CFAPI_PMAP.
Returns:
NULL.

Definition at line 1149 of file plugins.c.

References CFAPI_PMAP, and has_been_loaded().

Here is the call graph for this function:

void* cfapi_map_message ( int *  type,
  ... 
)

Definition at line 1426 of file plugins.c.

References CFAPI_NONE, ext_info_map(), MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.

Here is the call graph for this function:

void* cfapi_map_out_of_map ( int *  type,
  ... 
)

Wrapper for out_of_map().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 1371 of file plugins.c.

References CFAPI_INT, and out_of_map().

Here is the call graph for this function:

void* cfapi_map_present_arch_by_name ( int *  type,
  ... 
)

Kinda wrapper for present_arch() (but uses a string, not an archetype*).

Parameters:
typewill be CFAPI_POBJECT.
Returns:
NULL.
Todo:
fix archetype instead of string.

Definition at line 1483 of file plugins.c.

References CFAPI_POBJECT, present_arch(), and try_find_archetype().

Here is the call graph for this function:

void* cfapi_map_set_map_property ( int *  type,
  ... 
)

Definition at line 1338 of file plugins.c.

References CFAPI_MAP_PROP_PATH, CFAPI_NONE, CFAPI_STRING, mapdef::path, and snprintf().

Here is the call graph for this function:

void* cfapi_map_trigger_connected ( int *  type,
  ... 
)

Wrapper for trigger_connected().

Expected parameters after type:

  • ::objectlink*: the link to trigger. Can be obtained from map structure
  • ::object*: the object that cause this link to trigger, may be NULL
  • int: the state to trigger. 0=APPLY_RELEASE other=APPLY_PUSH
Parameters:
[out]typeWill be CFAPI_NONE.
Returns:
NULL.

Definition at line 3729 of file plugins.c.

References CFAPI_NONE, and trigger_connected().

Here is the call graph for this function:

void* cfapi_map_update_position ( int *  type,
  ... 
)

Wrapper for update_position().

Parameters:
typeCFAPI_NONE.
Returns:
NULL.

Definition at line 1396 of file plugins.c.

References CFAPI_NONE, and update_position().

Here is the call graph for this function:

void* cfapi_object_apply ( int *  type,
  ... 
)

Applies an object.

Parameters:
typewill be CFAPI_INT.
Returns:
always NULL.

Definition at line 3084 of file plugins.c.

References CFAPI_INT, and manual_apply().

Here is the call graph for this function:

void* cfapi_object_apply_below ( int *  type,
  ... 
)

Applies an object below.

Parameters:
typewill be CFAPI_NONE.
Returns:
always NULL.

Definition at line 3061 of file plugins.c.

References CFAPI_NONE, and player_apply_below().

Here is the call graph for this function:

void* cfapi_object_cast ( int *  type,
  ... 
)

Wrapper for query_money().

Parameters:
typeWill be CFAPI_INT.
Returns:
NULL.

Definition at line 3800 of file plugins.c.

References cast_spell(), and CFAPI_INT.

Here is the call graph for this function:

void* cfapi_object_change_abil ( int *  type,
  ... 
)

Wrapper for change_abil().

Definition at line 4070 of file plugins.c.

References CFAPI_INT, and change_abil().

Here is the call graph for this function:

void* cfapi_object_change_exp ( int *  type,
  ... 
)

Wrapper for change_exp().

Parameters:
typewill be CFAPI_NONE.
Returns:
NULL.

Definition at line 4162 of file plugins.c.

References CFAPI_NONE, and change_exp().

Here is the call graph for this function:

void* cfapi_object_check_inventory ( int *  type,
  ... 
)

Definition at line 3621 of file plugins.c.

References CFAPI_NONE, CFAPI_POBJECT, check_inv(), and check_inv_recursive().

Here is the call graph for this function:

void* cfapi_object_check_spell ( int *  type,
  ... 
)

Wrapper for check_spell_known().

Parameters:
typeWill be CFAPI_POBJECT.
Returns:
NULL.

Definition at line 3868 of file plugins.c.

References CFAPI_POBJECT, and check_spell_known().

Here is the call graph for this function:

void* cfapi_object_check_trigger ( int *  type,
  ... 
)

Wrapper for check_trigger().

Parameters:
typeWill be CFAPI_INT.
Returns:
NULL.

Definition at line 3699 of file plugins.c.

References CFAPI_INT, and check_trigger().

Here is the call graph for this function:

void* cfapi_object_clean_object ( int *  type,
  ... 
)

Definition at line 3647 of file plugins.c.

References CFAPI_NONE, and clean_object().

Here is the call graph for this function:

void* cfapi_object_clear ( int *  type,
  ... 
)

Wrapper for clear_object().

Parameters:
typeWill be CFAPI_NONE.
Returns:
NULL.

Definition at line 3585 of file plugins.c.

References CFAPI_NONE, and clear_object().

Here is the call graph for this function:

void* cfapi_object_clone ( int *  type,
  ... 
)

Clone an object, either through object_create_clone() or copy_object().

Parameters:
typewill be CFAPI_POBJECT.
Returns:
NULL.

Definition at line 3274 of file plugins.c.

References CFAPI_POBJECT, copy_object(), get_object(), and object_create_clone().

Here is the call graph for this function:

void* cfapi_object_create ( int *  type,
  ... 
)

Wrapper for get_object(), create_archetype() and create_archetype_by_object_name().

Parameters:
typewill be CFAPI_POBJECT, or CFAPI_NONE if invalid value asked for.
Returns:
NULL.

Definition at line 3355 of file plugins.c.

References CFAPI_NONE, CFAPI_POBJECT, find_archetype_by_object_name(), get_object(), object_create_arch(), and try_find_archetype().

Here is the call graph for this function:

void* cfapi_object_delete ( int *  type,
  ... 
)

Definition at line 3245 of file plugins.c.

References CFAPI_NONE, FLAG_FREED, FLAG_REMOVED, free_object(), llevError, LOG(), and QUERY_FLAG.

Here is the call graph for this function:

void* cfapi_object_describe ( int *  type,
  ... 
)

Wrapper for describe_item().

Parameters:
typewill be CFAPI_STRING.
Returns:
NULL.

Definition at line 3134 of file plugins.c.

References CFAPI_STRING, and describe_item().

Here is the call graph for this function:

void* cfapi_object_distance ( int *  type,
  ... 
)

Wrapper for distance().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 3538 of file plugins.c.

References CFAPI_INT, and distance().

Here is the call graph for this function:

void* cfapi_object_drain ( int *  type,
  ... 
)

Definition at line 3154 of file plugins.c.

References CFAPI_NONE, and drain_specific_stat().

Here is the call graph for this function:

void* cfapi_object_drop ( int *  type,
  ... 
)

Wrapper for drop().

Parameters:
typewill be CFAPI_NONE.
Returns:
NULL.

Definition at line 4044 of file plugins.c.

References CFAPI_NONE, drop(), FLAG_NO_DROP, PLAYER, and QUERY_FLAG.

Here is the call graph for this function:

void* cfapi_object_find ( int *  type,
  ... 
)

Definition at line 3301 of file plugins.c.

References CFAPI_NONE, CFAPI_POBJECT, find_obj_by_type_subtype(), find_object(), find_object_name(), and get_player_container().

Here is the call graph for this function:

void* cfapi_object_find_archetype_inside ( int *  type,
  ... 
)

Kinda wrapper for present_arch_in_ob().

Definition at line 4004 of file plugins.c.

References CFAPI_POBJECT, MAX_BUF, present_arch_in_ob(), query_name(), and try_find_archetype().

Here is the call graph for this function:

void* cfapi_object_fix ( int *  type,
  ... 
)

Definition at line 3173 of file plugins.c.

References CFAPI_NONE, and fix_object().

Here is the call graph for this function:

void* cfapi_object_forget_spell ( int *  type,
  ... 
)

Definition at line 3845 of file plugins.c.

References CFAPI_NONE, do_forget_spell(), MAX_BUF, and query_name().

Here is the call graph for this function:

void* cfapi_object_get_key ( int *  type,
  ... 
)

Gets a key/value value for an object.

Parameters:
typewill contain CFAPI_SSTRING.
Returns:
NULL.
See also:
get_ob_key_value().

Definition at line 1588 of file plugins.c.

References CFAPI_SSTRING, and get_ob_key_value().

Here is the call graph for this function:

void* cfapi_object_get_property ( int *  type,
  ... 
)

Main object property getter.

Definition at line 1637 of file plugins.c.

References can_merge(), can_pick(), CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_MOVETYPE, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ARCH_NAME, CFAPI_OBJECT_PROP_ARCHETYPE, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_ATTACKED_BY, CFAPI_OBJECT_PROP_BASE_NAME, CFAPI_OBJECT_PROP_CARRYING, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CLIENT_TYPE, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CONTAINER, CFAPI_OBJECT_PROP_COUNT, CFAPI_OBJECT_PROP_CURRENT_WEAPON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_ENVIRONMENT, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GOD, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HEAD, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVENTORY, CFAPI_OBJECT_PROP_INVISIBLE, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MAGICAL, CFAPI_OBJECT_PROP_MAP, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MERGEABLE, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_ALLOW, CFAPI_OBJECT_PROP_MOVE_BLOCK, CFAPI_OBJECT_PROP_MOVE_OFF, CFAPI_OBJECT_PROP_MOVE_ON, CFAPI_OBJECT_PROP_MOVE_SLOW, CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_MOVE_TYPE, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NEXT_ACTIVE_OB, CFAPI_OBJECT_PROP_NO_SAVE, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OB_ABOVE, CFAPI_OBJECT_PROP_OB_BELOW, CFAPI_OBJECT_PROP_OTHER_ARCH, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PERM_EXP, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_PICKABLE, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_PRESENT, CFAPI_OBJECT_PROP_PREV_ACTIVE_OB, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SHORT_NAME, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_SUBTYPE, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_TYPE, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_OBJECT_PROP_X, CFAPI_OBJECT_PROP_Y, CFAPI_PARCH, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_IP, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_NEXT, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_PMAP, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_SSTRING, CFAPI_STRING, determine_god(), find_marked_object(), first_player, FLAG_WAS_WIZ, get_owner(), is_friendly(), is_magical(), pl::ob, present_arch_in_ob(), present_in_ob(), present_in_ob_by_name(), query_base_name(), QUERY_FLAG, query_name(), query_short_name(), and snprintf().

Here is the call graph for this function:

void* cfapi_object_give_skill ( int *  type,
  ... 
)

Definition at line 3189 of file plugins.c.

References CFAPI_POBJECT, and give_skill_by_name().

Here is the call graph for this function:

void* cfapi_object_identify ( int *  type,
  ... 
)

Wrapper for identify().

Parameters:
typewill be CFAPI_NONE.
Returns:
NULL.

Definition at line 3112 of file plugins.c.

References CFAPI_NONE, and identify().

Here is the call graph for this function:

void* cfapi_object_insert ( int *  type,
  ... 
)

Definition at line 3394 of file plugins.c.

References CFAPI_NONE, CFAPI_POBJECT, FLAG_FREED, FLAG_REMOVED, free_object(), insert_ob_in_map(), insert_ob_in_map_at(), insert_ob_in_ob(), llevError, LOG(), QUERY_FLAG, and remove_ob().

Here is the call graph for this function:

void* cfapi_object_learn_spell ( int *  type,
  ... 
)

Definition at line 3829 of file plugins.c.

References CFAPI_NONE, and do_learn_spell().

Here is the call graph for this function:

void* cfapi_object_merge ( int *  type,
  ... 
)

Wrapper for merge_ob().

Parameters:
typeWill be CFAPI_POBJECT.
Returns:
NULL.

Definition at line 3512 of file plugins.c.

References CFAPI_POBJECT, and merge_ob().

Here is the call graph for this function:

void* cfapi_object_move ( int *  type,
  ... 
)

Moves an object.

Syntax is: cfapi_object_move(&type, kind) where kind is:

Parameters:
typeunused
Returns:
NULL.

Definition at line 1546 of file plugins.c.

References CFAPI_INT, move_ob(), move_player(), and pl::ob.

Here is the call graph for this function:

void* cfapi_object_on_same_map ( int *  type,
  ... 
)

Definition at line 3659 of file plugins.c.

References CFAPI_INT, and on_same_map().

Here is the call graph for this function:

void* cfapi_object_pay_amount ( int *  type,
  ... 
)

Wrapper for pay_for_amount().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 3891 of file plugins.c.

References CFAPI_INT, and pay_for_amount().

Here is the call graph for this function:

void* cfapi_object_pay_item ( int *  type,
  ... 
)

Wrapper for pay_for_item().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 3914 of file plugins.c.

References CFAPI_INT, and pay_for_item().

Here is the call graph for this function:

void* cfapi_object_pickup ( int *  type,
  ... 
)

Definition at line 4246 of file plugins.c.

References CFAPI_NONE, and pick_up().

Here is the call graph for this function:

void* cfapi_object_query_cost ( int *  type,
  ... 
)

Wrapper for query_cost().

Parameters:
typeWill be CFAPI_INT.
Returns:
NULL.

Definition at line 3752 of file plugins.c.

References CFAPI_INT, flags, and query_cost().

Here is the call graph for this function:

void* cfapi_object_query_money ( int *  type,
  ... 
)

Wrapper for query_money().

Parameters:
typeWill be CFAPI_INT.
Returns:
NULL.

Definition at line 3778 of file plugins.c.

References CFAPI_INT, and query_money().

Here is the call graph for this function:

void* cfapi_object_remove ( int *  type,
  ... 
)

Definition at line 3224 of file plugins.c.

References CFAPI_NONE, FLAG_REMOVED, llevError, LOG(), QUERY_FLAG, and remove_ob().

Here is the call graph for this function:

void* cfapi_object_reset ( int *  type,
  ... 
)

Wrapper for clear_reset().

Parameters:
typeWill be CFAPI_NONE.
Returns:
NULL.

Definition at line 3606 of file plugins.c.

References CFAPI_NONE, and reset_object().

Here is the call graph for this function:

void* cfapi_object_say ( int *  type,
  ... 
)

Definition at line 4087 of file plugins.c.

References CFAPI_INT, command_say(), npc_say(), and PLAYER.

Here is the call graph for this function:

void* cfapi_object_set_key ( int *  type,
  ... 
)

Write a key/value for an object.

Parameters:
typewill contain CFAPI_SSTRING.
Returns:
NULL.
See also:
set_ob_key_value().

Definition at line 1613 of file plugins.c.

References CFAPI_INT, and set_ob_key_value().

Here is the call graph for this function:

void* cfapi_object_set_property ( int *  type,
  ... 
)

Sets the property of an object.

Will send changes to client if required. First argument should be an object*, second an integer.. Will not change an archetype's object.

Parameters:
typewill contain the type of the first argument used to change the property.
Returns:
NULL.

Definition at line 2459 of file plugins.c.

References add_friendly_object(), CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NO_SAVE, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PERM_EXP, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_STRING, CLEAR_FLAG, copy_message(), decrease_ob_nr(), esrv_update_item(), first_player, fix_object(), FREE_AND_COPY, get_player_container(), is_friendly(), MAX_BUF, new_faces, pl::next, pl::ob, object_get_env_recursive(), P_NEED_UPDATE, PLAYER, remove_friendly_object(), send_changed_object(), SET_ANIMATION, set_cheat(), SET_FLAG, SET_MAP_FLAGS, set_owner(), sum_weight(), UPD_NROF, UPD_WEIGHT, update_all_los(), update_ob_speed(), update_object(), and update_position().

Here is the call graph for this function:

void* cfapi_object_split ( int *  type,
  ... 
)

Wrapper for get_split_ob().

Parameters:
typewill be CFAPI_POBJECT.
Returns:
NULL.

Definition at line 3483 of file plugins.c.

References CFAPI_POBJECT, and get_split_ob().

Here is the call graph for this function:

void* cfapi_object_spring_trap ( int *  type,
  ... 
)

Definition at line 3677 of file plugins.c.

References CFAPI_NONE, and spring_trap().

Here is the call graph for this function:

void* cfapi_object_teleport ( int *  type,
  ... 
)

Teleports an object at a specified destination if possible.

Parameters:
typeWill be CFAPI_INT.
Returns:
NULL.

Definition at line 4210 of file plugins.c.

References CFAPI_INT, find_first_free_spot(), FLAG_REMOVED, insert_ob_in_map_at(), map_newmap_cmd(), out_of_map(), PLAYER, QUERY_FLAG, and remove_ob().

Here is the call graph for this function:

void* cfapi_object_transfer ( int *  type,
  ... 
)

Object transfer.

Parameters are object*, int meaning: 0: call to transfer_ob() 1: call to insert_ob_in_map_at() 2: call to move_to()

Returns:
NULL.

Definition at line 3941 of file plugins.c.

References CFAPI_INT, CFAPI_NONE, CFAPI_POBJECT, mapdef::enter_x, mapdef::enter_y, insert_ob_in_map_at(), move_to(), and transfer_ob().

Here is the call graph for this function:

void* cfapi_object_transmute ( int *  type,
  ... 
)

Definition at line 3206 of file plugins.c.

References CFAPI_NONE, and transmute_materialname().

Here is the call graph for this function:

void* cfapi_object_update ( int *  type,
  ... 
)

Wrapper for update_object().

Parameters:
typeWill be CFAPI_NONE.
Returns:
NULL.

Definition at line 3562 of file plugins.c.

References CFAPI_NONE, and update_object().

Here is the call graph for this function:

void* cfapi_object_user_event ( int *  type,
  ... 
)

Definition at line 4530 of file plugins.c.

References CFAPI_INT, and user_event().

Here is the call graph for this function:

void* cfapi_party_get_property ( int *  type,
  ... 
)

Party-related functions.

Parameters:
typedata type returned.
Returns:
NULL.

Definition at line 4320 of file plugins.c.

References CFAPI_NONE, CFAPI_PARTY_PROP_NAME, CFAPI_PARTY_PROP_NEXT, CFAPI_PARTY_PROP_PASSWORD, CFAPI_PARTY_PROP_PLAYER, CFAPI_PPARTY, CFAPI_PPLAYER, CFAPI_SSTRING, first_player, get_firstparty(), party_struct::next, pl::next, party_struct::partyname, and party_struct::passwd.

Here is the call graph for this function:

void* cfapi_player_can_pay ( int *  type,
  ... 
)

Wrapper for can_pay().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 4188 of file plugins.c.

References can_pay(), and CFAPI_INT.

Here is the call graph for this function:

void* cfapi_player_find ( int *  type,
  ... 
)

Wrapper for find_player_partial_name().

Parameters:
typewill be CFAPI_PPLAYER.
Returns:
NULL.

Definition at line 4118 of file plugins.c.

References CFAPI_PPLAYER, and find_player_partial_name().

Here is the call graph for this function:

void* cfapi_player_message ( int *  type,
  ... 
)

Definition at line 4134 of file plugins.c.

References CFAPI_NONE, draw_ext_info(), flags, MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.

Here is the call graph for this function:

void* cfapi_region_get_property ( int *  type,
  ... 
)
void* cfapi_set_random_map_variable ( int *  type,
  ... 
)

Wrapper for set_random_map_variable().

Parameters:
typeunused.
Returns:
NULL.

Definition at line 4485 of file plugins.c.

References CFAPI_INT, and set_random_map_variable().

Here is the call graph for this function:

void* cfapi_system_add_string ( int *  type,
  ... 
)

Wrapper for add_string().

Parameters:
typewill be CFAPI_SSTRING.
Returns:
NULL.

Definition at line 756 of file plugins.c.

References add_string(), and CFAPI_SSTRING.

Here is the call graph for this function:

void* cfapi_system_check_path ( int *  type,
  ... 
)

Wrapper for check_path().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 822 of file plugins.c.

References CFAPI_INT, and check_path().

Here is the call graph for this function:

void* cfapi_system_directory ( int *  type,
  ... 
)
void* cfapi_system_find_animation ( int *  type,
  ... 
)

Wrapper for find_animation().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 648 of file plugins.c.

References CFAPI_INT, and find_animation().

Here is the call graph for this function:

void* cfapi_system_find_face ( int *  type,
  ... 
)

Wrapper for find_face().

Parameters:
typewill be CFAPI_INT.
Returns:
NULL.

Definition at line 670 of file plugins.c.

References CFAPI_INT, and find_face().

Here is the call graph for this function:

void* cfapi_system_find_string ( int *  type,
  ... 
)

Wrapper for find_string().

Parameters:
typewill be CFAPI_SSTRING.
Returns:
NULL.

Definition at line 800 of file plugins.c.

References CFAPI_SSTRING, and find_string().

Here is the call graph for this function:

void* cfapi_system_re_cmp ( int *  type,
  ... 
)

Wrapper for re_cmp().

Parameters:
typewill be CFAPI_STRING.
Returns:
NULL.

Definition at line 848 of file plugins.c.

References CFAPI_STRING, and re_cmp().

Here is the call graph for this function:

void* cfapi_system_register_global_event ( int *  type,
  ... 
)

Definition at line 709 of file plugins.c.

References CFAPI_NONE, _crossfire_plugin::gevent, and plugins_find_plugin().

Here is the call graph for this function:

void* cfapi_system_remove_string ( int *  type,
  ... 
)

Wrapper for free_string().

Parameters:
typewill be CFAPI_NONE.
Returns:
NULL.

Definition at line 779 of file plugins.c.

References CFAPI_NONE, and free_string().

Here is the call graph for this function:

void* cfapi_system_strdup_local ( int *  type,
  ... 
)

Wrapper for strdup_local().

Parameters:
typewill be CFAPI_STRING.
Returns:
NULL.

Definition at line 694 of file plugins.c.

References CFAPI_STRING, and strdup_local().

Here is the call graph for this function:

void* cfapi_system_unregister_global_event ( int *  type,
  ... 
)

Definition at line 729 of file plugins.c.

References CFAPI_NONE, _crossfire_plugin::gevent, and plugins_find_plugin().

Here is the call graph for this function:

void* cfapi_timer_create ( int *  type,
  ... 
)

Wrapper for cfapi_timer_create().

Parameters:
typeunused
Returns:
always 0

Additional parameters:

  • ob : ::object *for which to create a timer
  • delay : long, ticks or seconds
  • mode : int, either TIMER_MODE_SECONDS or TIMER_MODE_CYCLES
  • timer : int *that will contain timer's id

Definition at line 1010 of file plugins.c.

References CFAPI_INT, cftimer_create(), cftimer_find_free_id(), TIMER_ERR_ID, and TIMER_ERR_NONE.

Here is the call graph for this function:

void* cfapi_timer_destroy ( int *  type,
  ... 
)

Wrapper for cftimer_destroy().

Parameters:
typewill be CFAPI_INT.
Returns:
always 0

Additional parameters:

  • timer: int that should be destroyed
  • err: int *which will contain the return code of cftimer_destroy().

Definition at line 1046 of file plugins.c.

References CFAPI_INT, and cftimer_destroy().

Here is the call graph for this function:

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 106 of file timers.c.

References _cftimer::delay, EVENT_CONNECTOR, EVENT_TIMER, find_obj_by_type_subtype(), MAX_TIMERS, _cftimer::mode, _cftimer::ob_tag, seconds(), TIMER_ERR_ID, TIMER_ERR_MODE, TIMER_ERR_NONE, TIMER_ERR_OBJ, TIMER_MODE_CYCLES, TIMER_MODE_DEAD, and TIMER_MODE_SECONDS.

Referenced by cfapi_timer_create().

Here is the call graph for this function:

Here is the caller graph for this function:

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 137 of file timers.c.

References MAX_TIMERS, _cftimer::mode, TIMER_ERR_ID, TIMER_ERR_NONE, and TIMER_MODE_DEAD.

Referenced by cfapi_timer_destroy().

Here is the caller graph for this function:

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 153 of file timers.c.

References MAX_TIMERS, TIMER_ERR_ID, and TIMER_MODE_DEAD.

Referenced by cfapi_timer_create().

Here is the caller graph for this function:

void cftimer_init ( void  )

Initialize timers.

Definition at line 166 of file timers.c.

References MAX_TIMERS.

Referenced by init().

Here is the caller graph for this function:

void cftimer_process_timers ( void  )

Processes all timers.

Definition at line 53 of file timers.c.

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

Referenced by server_main().

Here is the call graph for this function:

Here is the caller graph for this function:

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

This changes the objects 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 301 of file skill_util.c.

References AP_APPLY, AP_NOPRINT, AP_UNAPPLY, apply_special(), PLAYER, and range_skill.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void change_spell ( object *  op,
char  k 
)

Rotate the selected range attack.

Parameters:
opplayer.
k'+' selects next range, other values previous range.

Definition at line 321 of file c_range.c.

References draw_ext_info(), draw_ext_info_format(), legal_range(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, query_base_name(), query_name(), range_bottom, range_bow, range_golem, range_magic, range_misc, range_none, range_size, and range_skill.

Referenced by command_rotateshoottype().

Here is the call graph for this function:

Here is the caller graph for this function:

void check_active_maps ( void  )

Finds maps in memory to reset.

Todo:
The check for MAX_OBJECTS_LWM is wrongly placed, and should be moved elsewhere.

Definition at line 206 of file swap.c.

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

Referenced by server_main().

Here is the call graph for this function:

Here is the caller graph for this function:

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 242 of file spell_attack.c.

References explode_bullet(), FLAG_ALIVE, FLAG_REMOVED, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, QUERY_FLAG, and remove_ob().

Referenced by fire_bullet(), and move_bullet().

Here is the call graph for this function:

Here is the caller graph for this function:

void check_doors ( object *  op,
mapstruct m,
int  x,
int  y 
)

Definition at line 1802 of file monster.c.

References AT_PHYSICAL, DOOR, GET_MAP_OB, and hit_player().

Referenced by move_ob().

Here is the call graph for this function:

Here is the caller graph for this function:

void check_earthwalls ( object *  op,
mapstruct m,
int  x,
int  y 
)

Definition at line 1791 of file monster.c.

References AT_PHYSICAL, EARTHWALL, GET_MAP_OB, and hit_player().

Referenced by move_ob().

Here is the call graph for this function:

Here is the caller graph for this function:

object* 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 83 of file monster.c.

References can_detect_enemy(), FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NEUTRAL, FLAG_REMOVED, GOLEM, HI4, on_same_map(), PETMOVE, PLAYER, QUERY_FLAG, and should_arena_attack().

Referenced by find_enemy(), and get_pet_enemy().

Here is the call graph for this function:

Here is the caller graph for this function:

void check_login ( object *  op)

Actually login a player, load from disk and such.

Parameters:
opplayer.
Todo:
describe connect/login/logout/disconnect process.

Definition at line 473 of file login.c.

References pl::bed_x, pl::bed_y, pl::bowtype, liv::Cha, check_password(), check_path(), CLEAR_FLAG, close_and_delete(), liv::Con, confirm_password(), containers, liv::Dex, pl::digestion, draw_ext_info(), draw_ext_info_format(), enter_exit(), esrv_add_spells(), esrv_new_player(), esrv_send_inventory(), esrv_send_pickup(), EVENT_LOGIN, execute_global_event(), pl::explore, 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, form_party(), pl::gen_grace, pl::gen_hp, pl::gen_sp, get_firstparty(), socket_struct::host, liv::Int, is_dragon_pl(), key_inventory, keyrings, kill_player(), pl::language, leave(), legal_range(), pl::levgrace, pl::levhp, pl::levsp, link_player_skills(), pl::listening, llevDebug, llevError, llevInfo, LO_NEWFILE, load_object(), Settings::localdir, LOG(), pl::maplevel, MAX_BUF, pl::mode, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, pl::name_changed, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, party_struct::next, pl::next, pl::no_shout, Ns_Dead, NUM_LANGUAGES, pl::ob, open_and_uncompress(), pl::orig_stats, pl::outputs_count, pl::outputs_sync, pl::own_title, pl::party, party_rejoin_always, party_rejoin_no, party_struct::partyname, party_struct::passwd, pl::peaceful, pl::petmode, PLAYER, Settings::playerdir, liv::Pow, pticks, QUERY_FLAG, range_none, pl::rejoin_party, remove_ob(), remove_unpaid_objects(), Settings::reset_loc_time, reset_object(), save_player(), pl::savebed_map, Settings::search_items, pl::search_str, send_party_message(), set_dragon_name(), SET_FLAG, Settings::set_title, settings, pl::shoottype, snprintf(), pl::socket, pl::spellparam, ST_PLAYING, pl::state, liv::Str, strdup_local(), strtol(), sum_weight(), terminate_all_pets(), pl::title, TRUE, pl::unapply, unapply_always, unapply_never, unapply_nochoice, update_ob_speed(), pl::usekeys, pl::weapon_sp, liv::Wis, pl::write_buf, and wrong_password().

Referenced by receive_player_password().

Here is the call graph for this function:

Here is the caller graph for this function:

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 173 of file login.c.

References draw_ext_info(), draw_ext_info_format(), MAX_NAME, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, NDI_UNIQUE, pl::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:

int check_password ( char *  typed,
char *  crypted 
)

Check if 2 passwords match.

Parameters:
typedentered password. Not crypted.
cryptedpassword to check against. Must be crypted.
Returns:
1 if the passwords match, 0 else.

Definition at line 162 of file server.c.

References crypt_string().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 694 of file disease.c.

References DISEASE, 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:

int check_pick ( object *  op)
void check_score ( 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 289 of file hiscore.c.

References add_score(), BIG_NAME, draw_ext_info(), draw_ext_info_format(), draw_one_high_score(), scr::exp, FLAG_WAS_WIZ, HIGHSCORE_LENGTH, scr::killer, scr::maplevel, MAX_BUF, scr::maxgrace, scr::maxhp, scr::maxsp, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, scr::name, NDI_UNIQUE, scr::position, QUERY_FLAG, and scr::title.

Referenced by apply_savebed(), command_kick(), command_shutdown(), emergency_save(), key_confirm_quit(), kill_player(), leave(), and process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1854 of file spell_util.c.

References draw_ext_info_format(), get_ob_key_value(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, NDI_NAVY, NDI_UNIQUE, and PLAYER.

Referenced by move_aura(), and remove_force().

Here is the call graph for this function:

Here is the caller graph for this function:

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 408 of file spell_util.c.

References 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 caller graph for this function:

void check_spells ( void  )

It goes through the spells looking for any obvious errors.

This was most useful in debugging when re-doing all the spells to catch simple errors. To use it all the time will result in it spitting out messages that aren't really errors.

Definition at line 120 of file spell_util.c.

References find_archetype(), first_archetype, llevDebug, llevError, LOG(), NUM_SKILLS, skill_names, SPELL, and spell_mapping.

Referenced by init_beforeplay().

Here is the call graph for this function:

Here is the caller graph for this function:

int check_weapon_power ( const object *  who,
int  improvs 
)

This checks to see of the player (who) is sufficient level to use a weapon with improvs 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 usuable. we return 1 (true) if the player can use the weapon. See ../types/weapon_improver/weapon_improver.c

Parameters:
wholiving to check
improvsimprovement level.
Returns:
1 if who can use the item, 0 else.
Todo:
remove obsolete code.

Definition at line 1076 of file apply.c.

References IS_COMBAT_SKILL, llevError, LOG(), PLAYER, and SKILL.

Referenced by apply_special(), and improve_weapon().

Here is the call graph for this function:

Here is the caller graph for this function:

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 38 of file ban.c.

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

Referenced by do_server(), and receive_player_password().

Here is the call graph for this function:

Here is the caller graph for this function:

void clean_tmp_files ( void  )

Remove temporary map files.

Todo:
check logic, why is file only removed if map is in memory?

Definition at line 194 of file standalone.c.

References clean_tmp_map(), first_map, mapdef::in_memory, llevInfo, LOG(), MAP_IN_MEMORY, mapdef::next, Settings::recycle_tmp_maps, save_map(), SAVE_MODE_NORMAL, settings, swap_map(), TRUE, and write_todclock().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void cleanup ( void  )
void cleanupPlugins ( void  )

Call closePlugin() on the various plugins, used at server shutdown.

Definition at line 4623 of file plugins.c.

References _crossfire_plugin::closefunc, _crossfire_plugin::next, and plugin_number.

Referenced by cleanup().

Here is the caller graph for this function:

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 340 of file skill_util.c.

References CLEAR_FLAG, FLAG_READY_SKILL, PLAYER, range_none, and range_skill.

Referenced by unapply_special().

Here is the caller graph for this function:

int command_abil ( object *  op,
char *  params 
)

Changes an object's statistics.

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

Definition at line 1595 of file c_wiz.c.

References liv::Cha, liv::Con, liv::Dex, draw_ext_info(), draw_ext_info_format(), FALSE, first_player, fix_object(), FLAG_WAS_WIZ, liv::Int, MAX_STAT, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::next, pl::ob, pl::orig_stats, liv::Pow, Settings::real_wiz, SET_FLAG, settings, liv::Str, and liv::Wis.

Here is the call graph for this function:

int command_accuse ( object *  op,
char *  params 
)

'accuse' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1255 of file c_chat.c.

References basic_emote(), and EMOTE_ACCUSE.

Here is the call graph for this function:

int command_addexp ( object *  op,
char *  params 
)

This adds exp to a player.

We now allow adding to a specific skill.

Parameters:
opwizard.
paramsshould be "player quantity [skill]".
Returns:
1.

Definition at line 1433 of file c_wiz.c.

References calc_perm_exp(), check_exp_adjust(), draw_ext_info(), draw_ext_info_format(), FALSE, find_skill_by_name(), first_player, FLAG_WAS_WIZ, MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::next, pl::ob, player_lvl_adj(), Settings::real_wiz, SET_FLAG, and settings.

Here is the call graph for this function:

int command_afk ( object *  op,
char *  params 
)

Toggles the afk status of a player.

'afk' command.

Parameters:
opplayer to toggle status for.
paramsunused.
Returns:
1.

Definition at line 795 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_AFK, get_language(), I18N_MSG_CMISC_056, I18N_MSG_CMISC_057, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

int command_apply ( object *  op,
char *  params 
)

'apply' command.

Parameters:
opplayer.
paramswhat to apply.
Returns:
whether skill was used or not.

Definition at line 221 of file c_object.c.

References AP_APPLY, AP_UNAPPLY, draw_ext_info_format(), find_best_apply_object_match(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, player_apply(), and player_apply_below().

Here is the call graph for this function:

int command_applymode ( object *  op,
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.
Returns:
1.

Definition at line 1443 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_132, I18N_MSG_CMISC_133, I18N_MSG_CMISC_134, I18N_MSG_CMISC_135, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, unapply_always, unapply_never, and unapply_nochoice.

Here is the call graph for this function:

int command_archs ( object *  op,
char *  params 
)

Archetype-related statistics.

Wizard 'archs' command.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 915 of file c_misc.c.

References arch_info().

Here is the call graph for this function:

int command_arrest ( object *  op,
char *  params 
)

Wizard jails player.

Parameters:
opwizard.
paramsplayer to jail.
Returns:
1.

Definition at line 619 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), enter_exit(), free_object(), get_jail_exit(), get_other_player_from_name(), llevInfo, LOG(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and pl::ob.

Here is the call graph for this function:

int command_banish ( object *  op,
char *  params 
)

Add player's IP to ban_file and kick them off the server.

I know most people have dynamic IPs but this is more of a short term solution if they have to get a new IP to play maybe they'll calm down. This uses the banish_file in the local directory *not *the ban_file The action is logged with a ! for easy searching. -tm

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

Definition at line 293 of file c_wiz.c.

References BANISHFILE, command_kick(), draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), socket_struct::host, llevDebug, Settings::localdir, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_ALL, NDI_RED, NDI_UNIQUE, pl::ob, settings, snprintf(), and pl::socket.

Here is the call graph for this function:

int command_beg ( object *  op,
char *  params 
)

'beg' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1684 of file c_chat.c.

References basic_emote(), and EMOTE_BEG.

Here is the call graph for this function:

int command_bleed ( object *  op,
char *  params 
)

'bleed' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1697 of file c_chat.c.

References basic_emote(), and EMOTE_BLEED.

Here is the call graph for this function:

int command_blush ( object *  op,
char *  params 
)

'blush' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1307 of file c_chat.c.

References basic_emote(), and EMOTE_BLUSH.

Here is the call graph for this function:

int command_body ( object *  op,
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
Return values:
1.

Definition at line 157 of file c_misc.c.

References body_locations, draw_ext_info(), draw_ext_info_format(), FLAG_USE_ARMOUR, FLAG_USE_WEAPON, get_language(), I18N_MSG_CMISC_007, I18N_MSG_CMISC_008, I18N_MSG_CMISC_009, I18N_MSG_CMISC_010, I18N_MSG_CMISC_011, I18N_MSG_CMISC_012, I18N_MSG_CMISC_013, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_BODY, NDI_UNIQUE, and QUERY_FLAG.

Here is the call graph for this function:

int command_bounce ( object *  op,
char *  params 
)

'bounce' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1073 of file c_chat.c.

References basic_emote(), and EMOTE_BOUNCE.

Here is the call graph for this function:

int command_bow ( object *  op,
char *  params 
)

'bow' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1281 of file c_chat.c.

References basic_emote(), and EMOTE_BOW.

Here is the call graph for this function:

int command_bowmode ( object *  op,
char *  params 
)

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

Parameters:
opplayer asking for change.
paramsnew mode.
Returns:
1.

Definition at line 1491 of file c_misc.c.

References bow_bestarrow, bow_nw, draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_136, I18N_MSG_CMISC_137, i18n_translate(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, snprintf(), and types.

Here is the call graph for this function:

int command_brace ( object *  op,
char *  params 
)

Player toggles her braced status.

Parameters:
opplayer.
paramsbrace status (on/off).
Returns:
1.

Definition at line 2382 of file c_misc.c.

References draw_ext_info(), fix_object(), get_language(), I18N_MSG_CMISC_212, I18N_MSG_CMISC_213, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and onoff_value().

Here is the call graph for this function:

int command_burp ( object *  op,
char *  params 
)

'burp' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1320 of file c_chat.c.

References basic_emote(), and EMOTE_BURP.

Here is the call graph for this function:

int command_cackle ( object *  op,
char *  params 
)

'cackle' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1099 of file c_chat.c.

References basic_emote(), and EMOTE_CACKLE.

Here is the call graph for this function:

int command_cast ( object *  op,
char *  params 
)

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

Parameters:
opplayer.
paramsspell.
Returns:
1 for success, 0 for failure.

Definition at line 67 of file c_range.c.

References command_cast_spell().

Here is the call graph for this function:

int command_cast_spell ( object *  op,
char *  params,
char  command 
)

Sets up to cast a spell.

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

Parameters:
opcaster.
paramsspell name.
commandfirst letter of the spell type (c=cast, i=invoke, p=prepare).
Returns:
0 if success, 1 for failure.

Definition at line 178 of file c_range.c.

References cast_spell(), draw_ext_info(), draw_ext_info_format(), find_skill_by_name(), free_object(), lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, range_golem, range_magic, remove_friendly_object(), remove_ob(), show_matching_spells(), and SPELL.

Referenced by command_cast(), command_invoke(), and command_prepare().

Here is the call graph for this function:

Here is the caller graph for this function:

int command_chat ( object *  op,
char *  params 
)

'chat' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 254 of file c_chat.c.

References command_tell_all(), MSG_TYPE_COMMUNICATION_CHAT, and NDI_BLUE.

Here is the call graph for this function:

int command_chuckle ( object *  op,
char *  params 
)

'chuckle' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1333 of file c_chat.c.

References basic_emote(), and EMOTE_CHUCKLE.

Here is the call graph for this function:

int command_clap ( object *  op,
char *  params 
)

'clap' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1294 of file c_chat.c.

References basic_emote(), and EMOTE_CLAP.

Here is the call graph for this function:

int command_cointoss ( object *  op,
char *  params 
)

'cointoss' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 84 of file c_chat.c.

References draw_ext_info(), ext_info_map_except(), MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, NDI_UNIQUE, NDI_WHITE, rndm(), and snprintf().

Here is the call graph for this function:

int command_cough ( object *  op,
char *  params 
)

'cough' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1346 of file c_chat.c.

References basic_emote(), and EMOTE_COUGH.

Here is the call graph for this function:

int command_create ( object *  op,
char *  params 
)

Wizard wants to create an object.

This function is a real mess, because we're stucking getting the entire item description in one block of text, so we just can't simply parse it - we need to look for double quotes for example. This could actually get much simpler with just a little help from the client - if we could get line breaks, it makes parsing much easier, eg, something like:

  • 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.
Returns:
1 unless op is NULL.
Todo:
enable line breaks in command.

Definition at line 783 of file c_wiz.c.

References arch_to_object(), CLEAR_FLAG, copy_object(), create_treasure(), dm_stack_pop(), dm_stack_push(), draw_ext_info(), draw_ext_info_format(), FALSE, find_archetype(), find_archetype_by_object_name(), find_artifactlist(), FLAG_ALIVE, FLAG_IDENTIFIED, FLAG_KNOWN_MAGICAL, FLAG_WAS_WIZ, free_object(), give_artifact_abilities(), GT_APPLY, HORN, insert_ob_in_map(), insert_ob_in_map_at(), insert_ob_in_ob(), artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), MAX, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, need_identify(), artifactstruct::next, object_create_arch(), out_of_map(), QUERY_FLAG, Settings::real_wiz, ROD, SCROLL, set_abs_magic(), SET_FLAG, set_magic(), set_variable(), settings, SPELL, SPELLBOOK, and WAND.

Here is the call graph for this function:

int command_cringe ( object *  op,
char *  params 
)

'cringe' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1710 of file c_chat.c.

References basic_emote(), and EMOTE_CRINGE.

Here is the call graph for this function:

int command_cry ( object *  op,
char *  params 
)

'cry' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1229 of file c_chat.c.

References basic_emote(), and EMOTE_CRY.

Here is the call graph for this function:

int command_dance ( object *  op,
char *  params 
)

'dance' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1047 of file c_chat.c.

References basic_emote(), and EMOTE_DANCE.

Here is the call graph for this function:

int command_debug ( object *  op,
char *  params 
)

Player wants to see/change the debug level.

Parameters:
opplayer asking for information.
paramsnew debug value.
Returns:
1.

Definition at line 945 of file c_misc.c.

References Settings::debug, draw_ext_info(), draw_ext_info_format(), FABS, FLAG_WIZ, get_language(), I18N_MSG_CMISC_092, I18N_MSG_CMISC_093, I18N_MSG_CMISC_094, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and settings.

Here is the call graph for this function:

int command_diff ( object *  op,
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.
Returns:
0.

Definition at line 2664 of file c_wiz.c.

References dm_stack_pop(), draw_ext_info(), find_object(), get_dm_object(), get_ob_diff(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, STACK_FROM_NUMBER, STACK_FROM_TOP, stringbuffer_finish(), and stringbuffer_new().

Here is the call graph for this function:

int command_disarm ( object *  op,
char *  params 
)

'disarm' command.

Parameters:
opplayer.
paramsunused.
Returns:
whether skill was used or not.

Definition at line 181 of file c_object.c.

References SK_DISARM_TRAPS, skill_names, and use_skill().

Here is the call graph for this function:

int command_dm ( object *  op,
char *  params 
)

Actual command to perhaps become dm.

Changed around a bit in version 0.92.2 to allow people on sockets to become dm, and allow better dm file

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

Definition at line 1983 of file c_wiz.c.

References do_wizard_dm().

Here is the call graph for this function:

int command_dmhide ( object *  op,
char *  params 
)

A players wants to become DM and hide.

Let's see if that's authorized. Make sure to not tell anything to anyone.

Parameters:
opwizard.
paramspassword.
Return values:
0failure.
1success.

Definition at line 2333 of file c_wiz.c.

References do_wizard_dm(), and do_wizard_hide().

Here is the call graph for this function:

int command_dmtell ( object *  op,
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.
Returns:
1.

Definition at line 357 of file c_chat.c.

References do_tell().

Here is the call graph for this function:

int command_drop ( object *  op,
char *  params 
)

'drop' command.

Parameters:
opplayer.
paramswhat to drop.
Returns:
0.

Definition at line 1173 of file c_object.c.

References draw_ext_info(), draw_ext_info_format(), drop(), FLAG_INV_LOCKED, FLAG_NO_DROP, item_matched_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, and QUERY_FLAG.

Here is the call graph for this function:

int command_dropall ( object *  op,
char *  params 
)

Command to drop all items that have not been locked.

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

Definition at line 1021 of file c_object.c.

References AMULET, ARMOUR, ARMOUR_IMPROVER, ARROW, BOOK, BOOTS, BOW, BRACERS, CLEAR_FLAG, CLOAK, CONTAINER, draw_ext_info(), DRINK, drop(), esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_INV_LOCKED, FLAG_NO_FIX_PLAYER, FLESH, FOOD, GEM, GIRDLE, GLOVES, HELMET, HORN, KEY, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, RING, ROD, SCROLL, SET_FLAG, SHIELD, SPECIAL_KEY, SPELLBOOK, UPD_WEIGHT, WAND, WEAPON, and WEAPON_IMPROVER.

Here is the call graph for this function:

int command_dump ( object *  op,
char *  params 
)

Dumps the difference between an object and its archetype.

Parameters:
opwiard.
paramsobject to dump.
Returns:
1.

Definition at line 1171 of file c_wiz.c.

References draw_ext_info(), dump_object(), FLAG_OBJ_ORIGINAL, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, QUERY_FLAG, stringbuffer_finish(), and stringbuffer_new().

Here is the call graph for this function:

int command_dumpallarchetypes ( object *  op,
char *  params 
)

Various archetypes-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1102 of file c_misc.c.

References dump_all_archetypes().

Here is the call graph for this function:

int command_dumpallmaps ( object *  op,
char *  params 
)

Various map-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1148 of file c_misc.c.

References dump_all_maps().

Here is the call graph for this function:

int command_dumpallobjects ( object *  op,
char *  params 
)

Various object-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1072 of file c_misc.c.

References dump_all_objects().

Here is the call graph for this function:

int command_dumpbelow ( object *  op,
char *  params 
)

Player wants to dump object below her.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 979 of file c_misc.c.

References dm_stack_push(), draw_ext_info(), dump_object(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, stringbuffer_finish(), and stringbuffer_new().

Here is the call graph for this function:

int command_dumpfriendlyobjects ( object *  op,
char *  params 
)

Various friendly object-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1087 of file c_misc.c.

References dump_friendly_objects().

Here is the call graph for this function:

int command_dumpmap ( object *  op,
char *  params 
)

Various map-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1132 of file c_misc.c.

References dump_map().

Here is the call graph for this function:

int command_east ( object *  op,
char *  params 
)

'east' command.

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

Definition at line 77 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_empty ( object *  op,
char *  params 
)

'empty' command.

Parameters:
opplayer.
paramsitem specifier.
Returns:
0.

Definition at line 1263 of file c_object.c.

References CONTAINER, draw_ext_info(), empty_container(), find_best_object_match(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Here is the call graph for this function:

int command_examine ( object *  op,
char *  params 
)

'examine' command.

Parameters:
opplayer.
paramsoptional item specifier.
Returns:
0.

Definition at line 1306 of file c_object.c.

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

Here is the call graph for this function:

int command_explore ( object *  op,
char *  params 
)

Player wants to enter explore mode, that is never-dying mode.

Don't allow people to exit explore mode. It otherwise becomes really easy to abuse this.

Parameters:
opplayer asking for explore mode.
paramsunused.
Returns:
1.

Definition at line 2086 of file c_misc.c.

References draw_ext_info(), Settings::explore_mode, FALSE, first_player, get_language(), I18N_MSG_CMISC_182, I18N_MSG_CMISC_183, I18N_MSG_CMISC_184, I18N_MSG_CMISC_185, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, pl::next, and settings.

Here is the call graph for this function:

int command_fire ( object *  op,
char *  params 
)

Player wants to start furing.

Parameters:
opplayer.
paramsadditional parameters.
Returns:
0.

Definition at line 206 of file c_new.c.

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

Here is the call graph for this function:

int command_fire_stop ( object *  op,
char *  params 
)

Player wants to stop firing.

Parameters:
opplayer.
paramsignored.
Returns:
0.

Definition at line 229 of file c_new.c.

int command_fix_me ( object *  op,
char *  params 
)

Wrapper to fix a player.

Parameters:
opplayer asking to be fixed.
paramsunused.
Returns:
1.

Definition at line 1374 of file c_misc.c.

References fix_object(), and sum_weight().

Here is the call graph for this function:

int command_flip ( object *  op,
char *  params 
)

'flip' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1359 of file c_chat.c.

References basic_emote(), and EMOTE_FLIP.

Here is the call graph for this function:

int command_follow ( object *  op,
char *  params 
)

DM wants to follow a player, or stop following a player.

Parameters:
opwizard.
paramsplayer to follow. If NULL, stop following player.
Returns:
0.

Definition at line 2863 of file c_wiz.c.

References add_string(), draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), FREE_AND_CLEAR_STR, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_UNIQUE, and pl::ob.

Here is the call graph for this function:

int command_forget_spell ( object *  op,
char *  params 
)

Wizard wishes to forget a spell.

Parameters:
opwizard.
paramsspell name to forget.
Returns:
0 if no spell was forgotten, 1 else.

Definition at line 2210 of file c_wiz.c.

References do_forget_spell(), draw_ext_info(), draw_ext_info_format(), lookup_spell_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Here is the call graph for this function:

int command_free ( object *  op,
char *  params 
)

Totally free an object.

Parameters:
opwizard.
paramsobject to free.
Returns:
1.

Definition at line 1394 of file c_wiz.c.

References dm_stack_pop(), draw_ext_info(), FLAG_REMOVED, free_object(), get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, remove_ob(), and STACK_FROM_STACK.

Here is the call graph for this function:

int command_freeze ( object *  op,
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.
Returns:
1.

Definition at line 571 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_RED, NDI_UNIQUE, and pl::ob.

Here is the call graph for this function:

int command_frown ( object *  op,
char *  params 
)

'frown' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1372 of file c_chat.c.

References basic_emote(), and EMOTE_FROWN.

Here is the call graph for this function:

int command_gasp ( object *  op,
char *  params 
)

'gasp' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1385 of file c_chat.c.

References basic_emote(), and EMOTE_GASP.

Here is the call graph for this function:

int command_giggle ( object *  op,
char *  params 
)

'giggle' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1125 of file c_chat.c.

References basic_emote(), and EMOTE_GIGGLE.

Here is the call graph for this function:

int command_glare ( object *  op,
char *  params 
)

'glare' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1398 of file c_chat.c.

References basic_emote(), and EMOTE_GLARE.

Here is the call graph for this function:

int command_goto ( object *  op,
char *  params 
)

Wizard teleports to a map.

Parameters:
opwizard teleporting.
paramsmap to teleport to. Can be absolute or relative path.
Returns:
1 unless op is NULL.

Definition at line 532 of file c_wiz.c.

References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, free_object(), get_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by command_loadtest().

Here is the call graph for this function:

Here is the caller graph for this function:

int command_grin ( object *  op,
char *  params 
)

'grin' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1268 of file c_chat.c.

References basic_emote(), and EMOTE_GRIN.

Here is the call graph for this function:

int command_groan ( object *  op,
char *  params 
)

'groan' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1411 of file c_chat.c.

References basic_emote(), and EMOTE_GROAN.

Here is the call graph for this function:

int command_growl ( object *  op,
char *  params 
)

'growl' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1164 of file c_chat.c.

References basic_emote(), and EMOTE_GROWL.

Here is the call graph for this function:

int command_gsay ( object *  op,
char *  params 
)

'gsay' command, talks to party.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 304 of file c_party.c.

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

Here is the call graph for this function:

int command_help ( object *  op,
char *  params 
)

Player is asking for some help.

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

Definition at line 1900 of file c_misc.c.

References Settings::datadir, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_language(), help_topics(), I18N_MSG_CMISC_178, I18N_MSG_CMISC_179, I18N_MSG_CMISC_180, i18n_translate(), language_codes, llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, QUERY_FLAG, S_ISREG, settings, show_commands(), snprintf(), and strerror_local().

Here is the call graph for this function:

int command_hiccup ( object *  op,
char *  params 
)

'hiccup' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1424 of file c_chat.c.

References basic_emote(), and EMOTE_HICCUP.

Here is the call graph for this function:

int command_hide ( object *  op,
char *  params 
)

Wizard 'hide' command.

Parameters:
opDM wanting to hide.
paramsignored.
Returns:
1.

Definition at line 197 of file c_wiz.c.

References do_wizard_hide().

Here is the call graph for this function:

int command_hiscore ( object *  op,
char *  params 
)

Player is asking for the hiscore.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 930 of file c_misc.c.

References display_high_score().

Here is the call graph for this function:

int command_hug ( object *  op,
char *  params 
)

'hug' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1216 of file c_chat.c.

References basic_emote(), and EMOTE_HUG.

Here is the call graph for this function:

int command_insert_into ( object *  op,
char *  params 
)

Puts an object into another.

Parameters:
opwizard.
paramsobject specifier.
Returns:
0.

Definition at line 2733 of file c_wiz.c.

References dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_object(), FLAG_REMOVED, get_dm_object(), insert_ob_in_ob(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), STACK_FROM_NUMBER, STACK_FROM_TOP, UPD_NAME, UPD_NROF, and UPD_WEIGHT.

Here is the call graph for this function:

int command_inventory ( object *  op,
char *  params 
)

Shows the inventory or some item.

Parameters:
opplayer.
paramsobject count to get the inventory of. If NULL then defaults to op.
Returns:
1 unless params is NULL.

Definition at line 1123 of file c_wiz.c.

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

Here is the call graph for this function:

int command_invisible ( object *  op,
char *  params 
)

Wizard wants to become invisible.

Parameters:
opwizard.
paramsignored.
Returns:
0.

Definition at line 1998 of file c_wiz.c.

References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, and update_object().

Here is the call graph for this function:

int command_invoke ( object *  op,
char *  params 
)

'invoke' command, fires a spell immediately.

Parameters:
opplayer.
paramsspell.
Returns:
1 for success, 0 for failure.

Definition at line 53 of file c_range.c.

References command_cast_spell().

Here is the call graph for this function:

int 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.
Returns:
1.

Definition at line 352 of file c_wiz.c.

References check_score(), draw_ext_info_format(), EVENT_KICK, execute_global_event(), first_player, FLAG_FREED, FLAG_REMOVED, MAP_TIMEOUT, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_ALL, NDI_RED, NDI_UNIQUE, pl::next, Ns_Dead, pl::ob, QUERY_FLAG, remove_ob(), save_player(), pl::socket, and socket_struct::status.

Referenced by command_banish(), and command_shutdown().

Here is the call graph for this function:

Here is the caller graph for this function:

int command_kill_pets ( object *  op,
char *  params 
)

Player wants to get rid of pets.

Parameters:
opplayer.
paramsunused.
Returns:
0.

Definition at line 2410 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), first_friendly_object, FLAG_REMOVED, free_object(), get_language(), get_owner(), I18N_MSG_CMISC_214, I18N_MSG_CMISC_215, I18N_MSG_CMISC_216, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, remove_friendly_object(), remove_ob(), strcasecmp(), and terminate_all_pets().

Here is the call graph for this function:

int command_kiss ( object *  op,
char *  params 
)

'kiss' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1060 of file c_chat.c.

References basic_emote(), and EMOTE_KISS.

Here is the call graph for this function:

int command_language ( object *  op,
char *  params 
)

This is the 'language' command.

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

Definition at line 97 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_005, I18N_MSG_CMISC_006, I18N_MSG_CMISC_051, i18n_translate(), language_codes, language_names, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and NUM_LANGUAGES.

Here is the call graph for this function:

int command_laugh ( object *  op,
char *  params 
)

'laugh' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1112 of file c_chat.c.

References basic_emote(), and EMOTE_LAUGH.

Here is the call graph for this function:

int command_learn_special_prayer ( object *  op,
char *  params 
)

Wizard wants to learn a god-given spell.

Parameters:
opwizard.
paramsspell name.
Return values:
0failure.
1success.

Definition at line 2196 of file c_wiz.c.

References command_learn_spell_or_prayer().

Here is the call graph for this function:

int command_learn_spell ( object *  op,
char *  params 
)

Wizard wants to learn a regular spell.

Parameters:
opwizard.
paramsspell name.
Return values:
0failure.
1success.

Definition at line 2180 of file c_wiz.c.

References command_learn_spell_or_prayer().

Here is the call graph for this function:

int command_lick ( object *  op,
char *  params 
)

'lick' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1437 of file c_chat.c.

References basic_emote(), and EMOTE_LICK.

Here is the call graph for this function:

int command_listen ( object *  op,
char *  params 
)

Change the player's listen level.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 1264 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_105, I18N_MSG_CMISC_106, I18N_MSG_CMISC_107, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

int command_listplugins ( object *  op,
char *  params 
)

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

Parameters:
opwizard.
paramsignored.
Returns:
1.

Definition at line 2242 of file c_wiz.c.

References plugins_display_list().

Here is the call graph for this function:

int command_loadplugin ( object *  op,
char *  params 
)

Loads the given plugin.

The DM specifies the name of the library to load (no pathname is needed). Do not ever attempt to load the same plugin more than once at a time, or bad things could happen.

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

Definition at line 2259 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), LIBDIR, llevDebug, llevInfo, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and plugins_init_plugin().

Here is the call graph for this function:

int command_loadtest ( object *  op,
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.
Returns:
0.

Definition at line 108 of file c_wiz.c.

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

Here is the call graph for this function:

int command_lock_item ( object *  op,
char *  params 
)

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

Parameters:
opplayer
paramssent command line.

Definition at line 2234 of file c_object.c.

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

Here is the call graph for this function:

int command_malloc ( object *  op,
char *  params 
)

Display memory information.

Parameters:
opplayer requesting information.
paramsunused.
Returns:
1.

Definition at line 818 of file c_misc.c.

References malloc_info().

Here is the call graph for this function:

int command_mapinfo ( object *  op,
char *  params 
)

'mapinfo' command.

Parameters:
opplayer requesting the information.
paramsunused.
Returns:
1.

Definition at line 833 of file c_misc.c.

References current_map_info().

Here is the call graph for this function:

int command_maps ( object *  op,
char *  params 
)

'maps' command.

Parameters:
opplayer requesting the information.
paramsregion to restrict to.

Definition at line 861 of file c_misc.c.

References map_info().

Here is the call graph for this function:

int command_mark ( object *  op,
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.
Returns:
1 or 0.

Definition at line 1376 of file c_object.c.

References draw_ext_info(), draw_ext_info_format(), find_best_object_match(), find_marked_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, and query_name().

Here is the call graph for this function:

int command_me ( object *  op,
char *  params 
)

'me' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 64 of file c_chat.c.

References ext_info_map(), MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_ME, NDI_BLUE, NDI_UNIQUE, and snprintf().

Here is the call graph for this function:

int command_mon_aggr ( object *  op,
char *  params 
)

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

Parameters:
opwiard.
paramsignored.
Returns:
1.

Definition at line 1202 of file c_wiz.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

int command_motd ( object *  op,
char *  params 
)

Display the message of the day.

Parameters:
opplayer requesting the motd.
paramsunused.
Return values:
1.

Definition at line 203 of file c_misc.c.

References display_motd().

Here is the call graph for this function:

int command_news ( object *  op,
char *  params 
)

Display the server news.

Parameters:
opplayer requesting the news.
paramsunused.
Return values:
1.

Definition at line 233 of file c_misc.c.

References send_news().

Here is the call graph for this function:

int command_nod ( object *  op,
char *  params 
)

'nod' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1034 of file c_chat.c.

References basic_emote(), and EMOTE_NOD.

Here is the call graph for this function:

int command_north ( object *  op,
char *  params 
)

'north' command.

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

Definition at line 90 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_northeast ( object *  op,
char *  params 
)

'northeast' command.

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

Definition at line 103 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_northwest ( object *  op,
char *  params 
)

'northwest' command.

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

Definition at line 116 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_nowiz ( object *  op,
char *  params 
)

Steps down from wizard mode.

Parameters:
opwizard.
paramsignored.
Returns:
1.

Definition at line 1839 of file c_wiz.c.

References CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, FREE_AND_CLEAR_STR, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_ALL, NDI_DK_ORANGE, NDI_LT_GREEN, NDI_UNIQUE, Settings::real_wiz, settings, TRUE, and update_los().

Here is the call graph for this function:

int command_orcknuckle ( object *  op,
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.
Returns:
always 0.

Definition at line 134 of file c_chat.c.

int command_output_count ( object *  op,
char *  params 
)

output-count command.

Parameters:
opplayer asking for information.
paramsnew value.
Returns:
1.

Definition at line 1230 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_102, I18N_MSG_CMISC_103, I18N_MSG_CMISC_104, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

int command_output_sync ( object *  op,
char *  params 
)

Output-sync command.

Parameters:
opplayer asking for information.
paramsnew value.
Returns:
1.

Definition at line 1196 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_099, I18N_MSG_CMISC_100, I18N_MSG_CMISC_101, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

int command_overlay_reset ( object *  op,
char *  params 
)

Removes the overlay for op's current map.

Parameters:
opDM acting.
paramsignored.
Returns:
1.

Definition at line 430 of file c_wiz.c.

References create_overlay_pathname(), draw_ext_info(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, and unlink.

Here is the call graph for this function:

int command_overlay_save ( object *  op,
char *  params 
)

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

Parameters:
opDM wanting to save.
paramsignored.
Returns:
1 unless op is NULL.

Definition at line 406 of file c_wiz.c.

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

Here is the call graph for this function:

int command_party ( object *  op,
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 350 of file c_party.c.

References draw_ext_info(), draw_ext_info_format(), first_player, firstparty, form_party(), get_party_password(), party_struct::kills, list_players(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_UNIQUE, NDI_WHITE, party_struct::next, pl::next, pl::party, party_help(), party_struct::partyleader, party_struct::partyname, party_struct::passwd, remove_party(), replace_unprintable_chars(), send_party_message(), snprintf(), and party_struct::total_exp.

Referenced by command_gsay().

Here is the call graph for this function:

Here is the caller graph for this function:

int command_party_rejoin ( object *  op,
char *  params 
)

Handles the 'party_rejoin' command.

Parameters:
opplayer.
paramsoptional parameters.
Returns:
1.

Definition at line 688 of file c_party.c.

References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, and NDI_UNIQUE.

Here is the call graph for this function:

int command_passwd ( object *  pl,
char *  params 
)

Player is asking to change password.

Parameters:
plplayer.
paramsunused.
Returns:
1.

Definition at line 2454 of file c_misc.c.

References CS_QUERY_HIDEINPUT, get_language(), I18N_MSG_CMISC_217, i18n_translate(), send_query(), and ST_CHANGE_PASSWORD_OLD.

Here is the call graph for this function:

int command_patch ( object *  op,
char *  params 
)

Wizard wants to altar an object.

Parameters:
opwizard.
paramsobject and what to patch.
Returns:
1.

Definition at line 1296 of file c_wiz.c.

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

Here is the call graph for this function:

int command_peaceful ( object *  op,
char *  params 
)

Player toggles her peaceful status.

Parameters:
opplayer.
paramsunused.
Returns:
1.

Definition at line 2333 of file c_misc.c.

References draw_ext_info(), get_language(), I18N_MSG_CMISC_208, I18N_MSG_CMISC_209, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, and NDI_UNIQUE.

Here is the call graph for this function:

int command_petmode ( object *  op,
char *  params 
)

Player wants to change how her pets behave.

Parameters:
opplayer asking for change.
paramsnew mode.
Returns:
1.

Definition at line 1556 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_138, I18N_MSG_CMISC_139, I18N_MSG_CMISC_140, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, pet_arena, pet_defend, pet_normal, pet_sad, and types.

Here is the call graph for this function:

int command_pickup ( object *  op,
char *  params 
)

'pickup' command.

Parameters:
opplayer.
paramspickup mode. Can be empty to display the current mode.
Returns:
1 if success, 0 else.
Todo:
trash old pickup mode, merge with new pickup.

Definition at line 1867 of file c_object.c.

References display_new_pickup(), draw_ext_info(), draw_ext_info_format(), llevDebug, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PU_ALLWEAPON, PU_ARMOUR, PU_ARROW, PU_BOOTS, PU_BOW, PU_CLOAK, PU_DEBUG, PU_DRINK, PU_FLESH, PU_FOOD, PU_GLOVES, PU_HELMET, PU_INHIBIT, PU_JEWELS, PU_KEY, PU_MAGIC_DEVICE, PU_MAGICAL, PU_MISSILEWEAPON, PU_NEWMODE, PU_NOT_CURSED, PU_POTION, PU_READABLES, PU_SHIELD, PU_SKILLSCROLL, PU_SPELLBOOK, PU_STOP, PU_VALUABLES, and set_pickup_mode().

Here is the call graph for this function:

int command_players ( object *  op,
char *  params 
)

Display all known players.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1390 of file c_misc.c.

References closedir(), dirent::d_name, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_130, I18N_MSG_CMISC_131, i18n_translate(), Settings::localdir, MAX_BUF, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, opendir(), Settings::playerdir, readdir(), S_ISDIR, settings, and snprintf().

Here is the call graph for this function:

int command_poke ( object *  op,
char *  params 
)

'poke' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1242 of file c_chat.c.

References basic_emote(), and EMOTE_POKE.

Here is the call graph for this function:

int command_possess ( object *  op,
char *  params 
)

DM can possess a monster.

Basically, this tricks the client into thinking a given monster, is actually the player it controls. This allows a DM to inhabit a monster's body, and run around the game with it. This function is severely broken - it has tons of hardcoded values,

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

Definition at line 1232 of file c_wiz.c.

References do_some_living(), draw_ext_info(), esrv_new_player(), esrv_send_inventory(), find_object(), find_object_name(), fix_object(), FLAG_WIZ, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, PLAYER, and SET_FLAG.

Here is the call graph for this function:

int command_pout ( object *  op,
char *  params 
)

'pout' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1450 of file c_chat.c.

References basic_emote(), and EMOTE_POUT.

Here is the call graph for this function:

int command_prepare ( object *  op,
char *  params 
)

Equivalent to command_cast().

Parameters:
opplayer.
paramsspell.
Returns:
1 for success, 0 for failure.
Todo:
remove.

Definition at line 82 of file c_range.c.

References command_cast_spell().

Here is the call graph for this function:

int command_printlos ( object *  op,
char *  params 
)

Various LOS-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1163 of file c_misc.c.

References print_los().

Here is the call graph for this function:

int command_puke ( object *  op,
char *  params 
)

'puke' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1151 of file c_chat.c.

References basic_emote(), and EMOTE_PUKE.

Here is the call graph for this function:

int command_quit ( object *  op,
char *  params 
)

Player wants to totally delete her character.

Parameters:
opplayer wanting to delete her character.
paramsunused.
Returns:
1.

Definition at line 2065 of file c_misc.c.

References CS_QUERY_SINGLECHAR, get_language(), I18N_MSG_CMISC_181, i18n_translate(), send_query(), and ST_CONFIRM_QUIT.

Here is the call graph for this function:

int command_remove ( object *  op,
char *  params 
)

Remove an object from its position.

Parameters:
opwizard.
paramsobject to remove.
Returns:
1.

Definition at line 1342 of file c_wiz.c.

References dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), FLAG_REMOVED, get_dm_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), STACK_FROM_STACK, and update_ob_speed().

Here is the call graph for this function:

int command_rename_item ( object *  op,
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.
Returns:
1

Definition at line 2047 of file c_object.c.

References draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_best_object_match(), find_marked_object(), FREE_AND_CLEAR_STR, FREE_AND_COPY, MAX_BUF, merge_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, query_base_name(), snprintf(), UPD_NAME, and VERY_BIG_BUF.

Here is the call graph for this function:

int command_reply ( object *  op,
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 373 of file c_chat.c.

References draw_ext_info(), draw_ext_info_format(), find_player(), FLAG_WIZ, pl::hidden, pl::last_tell, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, NDI_ORANGE, NDI_UNIQUE, pl::ob, and QUERY_FLAG.

Here is the call graph for this function:

int command_reset ( object *  op,
char *  params 
)
int command_resistances ( object *  op,
char *  params 
)

Players wants to know her resistances.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1740 of file c_misc.c.

References ATNR_INTERNAL, atnr_is_dragon_enabled(), attacktype_desc, change_resist_msg, draw_ext_info(), draw_ext_info_format(), FORCE, get_language(), I18N_MSG_CMISC_168, I18N_MSG_CMISC_169, I18N_MSG_CMISC_170, I18N_MSG_CMISC_171, i18n_translate(), is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, and NROFATTACKS.

Here is the call graph for this function:

int command_rotateshoottype ( object *  op,
char *  params 
)

'rotateshoottype' command, switch range attack.

Parameters:
opplayer.
paramsarguments to the command.
Returns:
0.

Definition at line 394 of file c_range.c.

References change_spell().

Here is the call graph for this function:

int command_rskill ( object *  pl,
char *  params 
)

'ready_skill' command.

Parameters:
plplayer.
paramsskill name.
Returns:
whether skill was readied or not.

Definition at line 132 of file c_object.c.

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, and NDI_UNIQUE.

Here is the call graph for this function:

int command_rules ( object *  op,
char *  params 
)

Display the server rules.

Parameters:
opplayer requesting the rules.
paramsunused.
Return values:
1.

Definition at line 218 of file c_misc.c.

References send_rules().

Here is the call graph for this function:

int command_run ( object *  op,
char *  params 
)

Player wants to start running.

Parameters:
opplayer.
paramsadditional parameters.
Returns:
0.

Definition at line 168 of file c_new.c.

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

Here is the call graph for this function:

int command_run_stop ( object *  op,
char *  params 
)

Player wants to stop running.

Parameters:
opplayer.
paramsignored.
Returns:
1.

Definition at line 191 of file c_new.c.

int command_save ( object *  op,
char *  params 
)

Player wants to get saved.

Parameters:
opplayer.
paramsunused.
Returns:
1.

Definition at line 2305 of file c_misc.c.

References draw_ext_info(), get_language(), get_map_flags(), I18N_MSG_CMISC_204, I18N_MSG_CMISC_205, I18N_MSG_CMISC_206, I18N_MSG_CMISC_207, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, P_NO_CLERIC, and save_player().

Here is the call graph for this function:

int command_say ( object *  op,
char *  params 
)

'say' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 47 of file c_chat.c.

References communicate().

Referenced by cfapi_object_say().

Here is the call graph for this function:

Here is the caller graph for this function:

int command_scream ( object *  op,
char *  params 
)

'scream' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1177 of file c_chat.c.

References basic_emote(), and EMOTE_SCREAM.

Here is the call graph for this function:

int command_search ( object *  op,
char *  params 
)

'search' command.

Parameters:
opplayer.
paramsunused.
Returns:
whether skill was used or not.

Definition at line 167 of file c_object.c.

References SK_FIND_TRAPS, skill_names, and use_skill().

Here is the call graph for this function:

int command_search_items ( object *  op,
char *  params 
)

'search-items' command.

Parameters:
opplayer.
paramsoptions.
Returns:
1.

Definition at line 1998 of file c_object.c.

References 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, and settings.

Here is the call graph for this function:

int command_setgod ( object *  op,
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.
Return values:
0syntax error.
1correct syntax.

Definition at line 232 of file c_wiz.c.

References become_follower(), draw_ext_info(), draw_ext_info_format(), find_god(), find_object_both(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and PLAYER.

Here is the call graph for this function:

int command_shake ( object *  op,
char *  params 
)

'shake' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1138 of file c_chat.c.

References basic_emote(), and EMOTE_SHAKE.

Here is the call graph for this function:

int command_shiver ( object *  op,
char *  params 
)

'shiver' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1463 of file c_chat.c.

References basic_emote(), and EMOTE_SHIVER.

Here is the call graph for this function:

int command_shout ( object *  op,
char *  params 
)

'sbout' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 241 of file c_chat.c.

References command_tell_all(), MSG_TYPE_COMMUNICATION_SHOUT, and NDI_RED.

Here is the call graph for this function:

int command_showpets ( object *  op,
char *  params 
)
int command_shrug ( object *  op,
char *  params 
)

'shrug' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1476 of file c_chat.c.

References basic_emote(), and EMOTE_SHRUG.

Here is the call graph for this function:

int command_shutdown ( object *  op,
char *  params 
)

Totally shutdowns the server.

Parameters:
opwizard shutting down the server.
paramsignored.
Returns:
1.

Definition at line 508 of file c_wiz.c.

References check_score(), cleanup(), command_kick(), play_again(), and save_player().

Here is the call graph for this function:

int command_sigh ( object *  op,
char *  params 
)

'sigh' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1190 of file c_chat.c.

References basic_emote(), and EMOTE_SIGH.

Here is the call graph for this function:

int command_skills ( object *  op,
char *  params 
)

Player is asking for her skills.

Just show player's their skills for now. Dm's can already see skills w/ inventory command - b.t.

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

Definition at line 1156 of file c_wiz.c.

References show_skills().

Here is the call graph for this function:

int command_slap ( object *  op,
char *  params 
)

'slap' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1489 of file c_chat.c.

References basic_emote(), and EMOTE_SLAP.

Here is the call graph for this function:

int command_smile ( object *  op,
char *  params 
)

'smile' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1086 of file c_chat.c.

References basic_emote(), and EMOTE_SMILE.

Here is the call graph for this function:

int command_smirk ( object *  op,
char *  params 
)

'smirk' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1502 of file c_chat.c.

References basic_emote(), and EMOTE_SMIRK.

Here is the call graph for this function:

int command_snap ( object *  op,
char *  params 
)

'snap' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1515 of file c_chat.c.

References basic_emote(), and EMOTE_SNAP.

Here is the call graph for this function:

int command_sneeze ( object *  op,
char *  params 
)

'sneeze' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1528 of file c_chat.c.

References basic_emote(), and EMOTE_SNEEZE.

Here is the call graph for this function:

int command_snicker ( object *  op,
char *  params 
)

'snicker' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1541 of file c_chat.c.

References basic_emote(), and EMOTE_SNICKER.

Here is the call graph for this function:

int command_sniff ( object *  op,
char *  params 
)

'sniff' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1554 of file c_chat.c.

References basic_emote(), and EMOTE_SNIFF.

Here is the call graph for this function:

int command_snore ( object *  op,
char *  params 
)

'snore' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1567 of file c_chat.c.

References basic_emote(), and EMOTE_SNORE.

Here is the call graph for this function:

int command_sound ( object *  op,
char *  params 
)

Player wants to change sound status.

Parameters:
opplayer asking for change.
paramsunused.
Returns:
1.

Definition at line 2120 of file c_misc.c.

References draw_ext_info(), get_language(), I18N_MSG_CMISC_186, I18N_MSG_CMISC_187, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and SND_MUTE.

Here is the call graph for this function:

int command_south ( object *  op,
char *  params 
)

'south' command.

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

Definition at line 129 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_southeast ( object *  op,
char *  params 
)

'southeast' command.

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

Definition at line 142 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_southwest ( object *  op,
char *  params 
)

'southwest' command.

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

Definition at line 155 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_speed ( object *  op,
char *  params 
)

Changes the server speed.

Parameters:
opwizard.
paramsnew speed, or NULL to see the speed.
Returns:
1.

Definition at line 1493 of file c_wiz.c.

References draw_ext_info_format(), max_time, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, reset_sleep(), and set_max_time().

Here is the call graph for this function:

int command_spit ( object *  op,
char *  params 
)

'spit' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1580 of file c_chat.c.

References basic_emote(), and EMOTE_SPIT.

Here is the call graph for this function:

int command_ssdumptable ( object *  op,
char *  params 
)

Various string-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1117 of file c_misc.c.

References SS_DUMP_TABLE, and ss_dump_table().

Here is the call graph for this function:

int command_stack_clear ( object *  op,
char *  params 
)

Empty DM item stack.

Parameters:
opwizard.
paramsignored.
Returns:
0.

Definition at line 2636 of file c_wiz.c.

References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, and NDI_UNIQUE.

Here is the call graph for this function:

int command_stack_list ( object *  op,
char *  params 
)

Displays stack contents.

Parameters:
opwizard.
paramsignored.
Returns:
0.

Definition at line 2600 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, pl::stack_items, and pl::stack_position.

Here is the call graph for this function:

int command_stack_pop ( object *  op,
char *  params 
)

Pop the stack top.

Parameters:
opwizard.
paramsignored.
Returns:
0.

Definition at line 2563 of file c_wiz.c.

References dm_stack_pop().

Here is the call graph for this function:

int command_stack_push ( object *  op,
char *  params 
)

Push specified item on stack.

Parameters:
opwizard.
paramsobject specifier.
Returns:
0.

Definition at line 2578 of file c_wiz.c.

References dm_stack_push(), get_dm_object(), and STACK_FROM_NUMBER.

Here is the call graph for this function:

int command_statistics ( object *  pl,
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.
Returns:
1.

Definition at line 1300 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_108, I18N_MSG_CMISC_109, I18N_MSG_CMISC_110, I18N_MSG_CMISC_111, I18N_MSG_CMISC_112, I18N_MSG_CMISC_113, I18N_MSG_CMISC_114, I18N_MSG_CMISC_115, I18N_MSG_CMISC_116, I18N_MSG_CMISC_117, I18N_MSG_CMISC_118, I18N_MSG_CMISC_119, I18N_MSG_CMISC_120, I18N_MSG_CMISC_121, I18N_MSG_CMISC_122, I18N_MSG_CMISC_123, I18N_MSG_CMISC_124, I18N_MSG_CMISC_125, I18N_MSG_CMISC_126, I18N_MSG_CMISC_127, I18N_MSG_CMISC_128, I18N_MSG_CMISC_129, i18n_translate(), level_exp(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, and NDI_UNIQUE.

Here is the call graph for this function:

int command_stats ( object *  op,
char *  params 
)

Displays the statistics of a player.

Parameters:
opwizard.
paramsplayer's name.
Returns:
1.

Definition at line 1528 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and pl::ob.

Here is the call graph for this function:

int command_stay ( object *  op,
char *  params 
)

'stay' command.

Used to specify to fire under oneself.

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

Definition at line 181 of file c_move.c.

References fire().

Here is the call graph for this function:

int command_strings ( object *  op,
char *  params 
)

Various string-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 876 of file c_misc.c.

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

Here is the call graph for this function:

int command_strut ( object *  op,
char *  params 
)

'strut' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1593 of file c_chat.c.

References basic_emote(), and EMOTE_STRUT.

Here is the call graph for this function:

int command_style_map_info ( object *  op,
char *  params 
)

Displays information about styles loaded for random maps.

Parameters:
opwizard.
paramsignored.
Returns:
0.

Definition at line 2815 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), GET_MAP_OB, MAP_HEIGHT, MAP_WIDTH, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapdef::next, and styles.

Here is the call graph for this function:

int command_sulk ( object *  op,
char *  params 
)

'sulk' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1203 of file c_chat.c.

References basic_emote(), and EMOTE_SULK.

Here is the call graph for this function:

int command_summon ( object *  op,
char *  params 
)

Summons player near DM.

Parameters:
opDM.
paramsplayer to summon.
Returns:
1 unless op is NULL.

Definition at line 661 of file c_wiz.c.

References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_free_spot(), free_object(), freearr_x, freearr_y, get_object(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and pl::ob.

Here is the call graph for this function:

int command_take ( object *  op,
char *  params 
)

This takes (picks up) and item.

Parameters:
opplayer who issued the command.
paramsstring to match against the item name.
Returns:
0.

Definition at line 602 of file c_object.c.

References can_pick(), draw_ext_info(), draw_ext_info_format(), FLAG_IS_FLOOR, item_matched_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, NDI_UNIQUE, pick_up(), and QUERY_FLAG.

Here is the call graph for this function:

int command_teleport ( object *  op,
char *  params 
)

Teleport next to target player.

Parameters:
opDM teleporting.
paramsoptions sent by player.
Returns:
0 if couldn't teleport, 1 if teleport successful.

Definition at line 712 of file c_wiz.c.

References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_free_spot(), find_player_partial_name(), free_object(), freearr_x, freearr_y, get_object(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and pl::ob.

Here is the call graph for this function:

int command_tell ( object *  op,
char *  params 
)

Private communication.

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

Definition at line 343 of file c_chat.c.

References do_tell().

Here is the call graph for this function:

int command_thank ( object *  op,
char *  params 
)

'thank' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1606 of file c_chat.c.

References basic_emote(), and EMOTE_THANK.

Here is the call graph for this function:

int command_think ( object *  op,
char *  params 
)

'think' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1723 of file c_chat.c.

References basic_emote(), and EMOTE_THINK.

Here is the call graph for this function:

int command_throw ( object *  op,
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.
Returns:
whether skill was used or not.

Definition at line 198 of file c_object.c.

References do_skill(), draw_ext_info(), find_skill_by_name(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, SK_THROWING, and skill_names.

Here is the call graph for this function:

int command_time ( object *  op,
char *  params 
)

Players asks for the time.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 900 of file c_misc.c.

References time_info().

Here is the call graph for this function:

int command_title ( object *  op,
char *  params 
)

Player wishes to change her title.

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

Definition at line 2250 of file c_misc.c.

References draw_ext_info(), FALSE, get_language(), I18N_MSG_CMISC_197, I18N_MSG_CMISC_198, I18N_MSG_CMISC_199, I18N_MSG_CMISC_200, I18N_MSG_CMISC_201, I18N_MSG_CMISC_202, I18N_MSG_CMISC_203, i18n_translate(), is_dragon_pl(), MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, replace_unprintable_chars(), Settings::set_title, settings, and snprintf().

Here is the call graph for this function:

int command_toggle_shout ( object *  op,
char *  params 
)

A simple toggle for the no_shout field.

AKA the MUZZLE command.

Parameters:
opwizard toggling.
paramsplayer to mute/unmute.
Returns:
1.

Definition at line 459 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), EVENT_MUZZLE, execute_global_event(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_ORANGE, NDI_RED, NDI_UNIQUE, and pl::ob.

Here is the call graph for this function:

int command_twiddle ( object *  op,
char *  params 
)

'twiddle' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1619 of file c_chat.c.

References basic_emote(), and EMOTE_TWIDDLE.

Here is the call graph for this function:

int command_unloadplugin ( object *  op,
char *  params 
)

Unloads the given plugin.

The DM specified the ID of the library to unload. Note that some things may behave strangely if the correct plugins are not loaded.

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

Definition at line 2298 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), llevInfo, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and plugins_remove_plugin().

Here is the call graph for this function:

int command_use ( object *  op,
char *  params 
)

Try to use an item on another.

Items are checked for key/values matching.

Parameters:
opplayer.
paramssent string, with all parameters.
Returns:
1.

Definition at line 2282 of file c_object.c.

References decrease_ob, draw_ext_info(), draw_ext_info_format(), find_archetype(), find_best_object_match(), get_ob_key_value(), insert_ob_in_ob(), llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, NDI_UNIQUE, object_create_arch(), PLAYER, and snprintf().

Here is the call graph for this function:

int command_usekeys ( object *  op,
char *  params 
)

Player wants to change how keys are used.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 1692 of file c_misc.c.

References containers, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_165, I18N_MSG_CMISC_166, I18N_MSG_CMISC_167, i18n_translate(), key_inventory, keyrings, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and types.

Here is the call graph for this function:

int command_uskill ( object *  pl,
char *  params 
)

'use_skill' command.

Parameters:
plplayer.
paramsskill to use, and optional parameters.
Returns:
whether skill was used or not.

Definition at line 113 of file c_object.c.

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

Here is the call graph for this function:

int command_version ( object *  op,
char *  params 
)

Server version.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1180 of file c_misc.c.

References version().

Here is the call graph for this function:

int command_wave ( object *  op,
char *  params 
)

'wave' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1632 of file c_chat.c.

References basic_emote(), and EMOTE_WAVE.

Here is the call graph for this function:

int command_west ( object *  op,
char *  params 
)

'west' command.

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

Definition at line 168 of file c_move.c.

References move_internal().

Here is the call graph for this function:

int command_whereabouts ( object *  op,
char *  params 
)

'whereabouts' command.

Displays how many players are in which regions.

Parameters:
opplayer requesting information.
paramsunused.
Returns:
1.

Definition at line 482 of file c_misc.c.

References regiondef::counter, draw_ext_info(), draw_ext_info_format(), first_player, first_region, get_language(), get_region_by_map(), get_region_longname(), I18N_MSG_CMISC_049, I18N_MSG_CMISC_050, i18n_translate(), llevError, LOG(), regiondef::longname, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, regiondef::name, NDI_UNIQUE, pl::next, regiondef::next, pl::ob, and regiondef::parent.

Here is the call graph for this function:

int command_whereami ( object *  op,
char *  params 
)

'whereami' command.

Parameters:
opplayer requesting the information.
paramsunused.
Returns:
1.

Definition at line 848 of file c_misc.c.

References current_region_info().

Here is the call graph for this function:

int command_whistle ( object *  op,
char *  params 
)

'whistle' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1645 of file c_chat.c.

References basic_emote(), and EMOTE_WHISTLE.

Here is the call graph for this function:

int command_who ( object *  op,
char *  params 
)

'who' command.

Parameters:
opplayer requesting the information.
paramsoptional region to limit the information to.
Returns:
1.

Definition at line 629 of file c_misc.c.

References get_region_from_string(), and list_players().

Here is the call graph for this function:

int command_wimpy ( object *  op,
char *  params 
)

Player wants to change how soon she'll flee.

Parameters:
opplayer.
paramsnew value.
Returns:
1.

Definition at line 2353 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_210, I18N_MSG_CMISC_211, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, and NDI_UNIQUE.

Here is the call graph for this function:

int command_wink ( object *  op,
char *  params 
)

'wink' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1658 of file c_chat.c.

References basic_emote(), and EMOTE_WINK.

Here is the call graph for this function:

int command_wizcast ( object *  op,
char *  params 
)

Wizard toggling "cast everywhere" ability.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1039 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZCAST, get_language(), I18N_MSG_CMISC_097, I18N_MSG_CMISC_098, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

int command_wizpass ( object *  op,
char *  params 
)

Wizard toggling wall-crossing.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1006 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZPASS, get_language(), I18N_MSG_CMISC_095, I18N_MSG_CMISC_096, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

int command_yawn ( object *  op,
char *  params 
)

'yawn' command.

Parameters:
opplayer.
paramsmessage.
Returns:
0.

Definition at line 1671 of file c_chat.c.

References basic_emote(), and EMOTE_YAWN.

Here is the call graph for this function:

void communicate ( object *  op,
const char *  txt 
)

This function looks for an object or creature that is listening to said text.

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 1831 of file monster.c.

References ext_info_map(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, llevDebug, LOG(), MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_SAY, NDI_WHITE, P_OUT_OF_MAP, PLAYER, SIZEOFFREE2, snprintf(), and talk_to_npc().

Referenced by command_say().

Here is the call graph for this function:

Here is the caller graph for this function:

int 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.

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 ajustment and such things to not compute all the time ; try directions randomly.

Definition at line 371 of file monster.c.

References absdir(), fatal(), freearr_x, freearr_y, MAX_EXPLORE, ob_blocked(), OUT_OF_MEMORY, and OUT_OF_REAL_MAP.

Referenced by move_monster(), and move_to().

Here is the call graph for this function:

Here is the caller graph for this function:

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 369 of file spell_attack.c.

References add_refcount(), arch_to_object(), free_string(), insert_ob_in_map(), and set_owner().

Referenced by cast_cone(), and move_cone().

Here is the call graph for this function:

Here is the caller graph for this function:

int confirm_party_password ( object *  op)

Is the password the player entered to join a party the right one?

Parameters:
opplayer. Must have party_to_join correctly set.
Return values:
0password is correct.
1invalid password or party not found.

Definition at line 228 of file c_party.c.

References party_struct::next, party_struct::partyname, and party_struct::passwd.

Referenced by receive_party_password().

Here is the caller graph for this function:

void confirm_password ( object *  op)

Ask the player to confirm her password during creation.

Parameters:
opplayer.

Definition at line 877 of file player.c.

References CS_QUERY_HIDEINPUT, send_query(), and ST_CONFIRM_PASSWORD.

Referenced by check_login().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Confuse a living thing.

Parameters:
opvictim.
hitterwho is attacking.
damdamage to deal.

Definition at line 2237 of file attack.c.

References add_string(), ATNR_CONFUSION, create_archetype(), draw_ext_info(), FLAG_CONFUSED, FORCE, FORCE_CONFUSION, FORCE_NAME, free_string(), insert_ob_in_ob(), MAX, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_UNIQUE, PLAYER, present_in_ob_by_name(), QUERY_FLAG, and SET_FLAG.

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:

void 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 648 of file pets.c.

Referenced by animate_weapon(), and fire().

Here is the caller graph for this function:

int coords_in_shop ( mapstruct map,
int  x,
int  y 
)

Check if given map coords are in a shop.

Parameters:
map
x
ycoordinates to check.
Returns:
1 if coordinates are a shop, 0 otherwise.

Definition at line 1429 of file shop.c.

References GET_MAP_OB, and SHOP_FLOOR.

Referenced by is_in_shop().

Here is the caller graph for this function:

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 2795 of file spell_effect.c.

References AT_COUNTERSPELL, AT_MAGIC, FLAG_MONSTER, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, P_OUT_OF_MAP, QUERY_FLAG, remove_ob(), rndm(), RUNE, and SPELL_EFFECT.

Referenced by hit_map().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

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

Definition at line 3213 of file spell_effect.c.

References arch_to_object(), caster_level(), draw_ext_info(), insert_ob_in_ob(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, present_arch_in_ob(), set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), and store_spell_expiry().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 552 of file spell_attack.c.

References arch_to_object(), draw_ext_info(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), MOVE_WALK, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, P_OUT_OF_MAP, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

char* crypt_string ( char *  str,
char *  salt 
)

Encrypt a string.

Used for password storage on disk.

Really, there is no reason to crypt the passwords any system. But easier to just leave this enabled for backward compatibility. Put the simple case at top - no encryption - makes it easier to read.

Parameters:
strstring to crypt.
saltsalt to crypt with.
Returns:
crypted str.
Todo:
make thread-safe?

Definition at line 130 of file server.c.

Referenced by check_password(), and receive_player_password().

Here is the caller graph for this function:

int cure_disease ( object *  sufferer,
object *  caster 
)

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.
Return values:
0no disease was cured.
1at least one disease was cured.

Definition at line 715 of file disease.c.

References change_exp(), DISEASE, draw_ext_info(), draw_ext_info_format(), FLAG_STARTEQUIP, free_object(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_SPELL, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, PREFER_LOW, QUERY_FLAG, random_roll(), remove_ob(), and remove_symptoms().

Referenced by cast_heal(), and kill_player().

Here is the call graph for this function:

Here is the caller graph for this function:

void current_map_info ( object *  op)

'mapinfo' command.

Parameters:
opplayer requesting the information.

Definition at line 421 of file c_misc.c.

References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_language(), get_region_by_map(), get_region_longname(), I18N_MSG_CMISC_046, i18n_translate(), MAP_ENTER_X, MAP_ENTER_Y, MAP_HEIGHT, MAP_TIMEOUT, MAP_WIDTH, mapdef::msg, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, mapdef::name, NDI_UNIQUE, mapdef::path, mapdef::players, and QUERY_FLAG.

Referenced by command_mapinfo().

Here is the call graph for this function:

Here is the caller graph for this function:

void current_region_info ( object *  op)

'whereami' command.

Pretty much identical to current map_info(), but on a bigger scale

This function returns the name of the players current region, and a description of it. It is there merely for flavour text.

Parameters:
opplayer wanting information.

Definition at line 398 of file c_misc.c.

References draw_ext_info_format(), get_language(), get_name_of_region_for_map(), get_region_by_name(), get_region_longname(), get_region_msg(), I18N_MSG_CMISC_045, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Referenced by command_whereami().

Here is the call graph for this function:

Here is the caller graph for this function:

void dead_player ( object *  op)

Kill a player on a permanent death server with resurrection.

Parameters:
opplayer to kill.

Definition at line 291 of file resurrection.c.

References llevError, Settings::localdir, LOG(), MAX_BUF, Settings::playerdir, settings, snprintf(), and strerror_local().

Referenced by kill_player().

Here is the call graph for this function:

Here is the caller graph for this function:

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 97 of file login.c.

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

Referenced by key_confirm_quit(), and kill_player().

Here is the call graph for this function:

Here is the caller graph for this function:

int describe_shop ( const object *  op)

Gives a desciption of the shop on their current map to the player op.

Parameters:
opplayer to describe the shop for. Mustn't be NULL.
Returns:
0 if op is not a player, 1 else.
Todo:
is return value meaningful?

Definition at line 1311 of file shop.c.

References cost_string_from_value(), draw_ext_info(), draw_ext_info_format(), shopitem::index, make_list_like(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_LISTING, MSG_TYPE_SHOP_MISC, shopitem::name, shopitem::name_pl, NDI_UNIQUE, PLAYER, mapdef::shopgreed, mapdef::shopitems, shopkeeper_approval(), mapdef::shopmax, mapdef::shopmin, mapdef::shoprace, snprintf(), shopitem::strength, and stringbuffer_finish().

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_object ( object *  op)

Recursively free_object() op and its inventory.

Parameters:
opobject to totally free_object().
Todo:
doesn't free_object() handle inventory?

Definition at line 201 of file login.c.

References destroy_object(), FLAG_REMOVED, free_object(), QUERY_FLAG, and remove_ob().

Referenced by destroy_object(), save_player(), and trap_disarm().

Here is the call graph for this function:

Here is the caller graph for this function:

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 118 of file gods.c.

References add_string(), first_god, FLAG_ALIVE, get_god_for_race(), glnk::id, lookup_god_by_name(), glnk::name, glnk::next, PLAYER, QUERY_FLAG, rndm(), SK_PRAYING, SKILL, SPELL, and SPELL_EFFECT.

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(), mood_change(), perceive_self(), pray_at_altar(), prayer_failure(), show_skills(), summon_golem(), summon_object(), and tailor_god_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 782 of file gods.c.

References BOOK, treasurestruct::item, llevError, LOG(), treasurestruct::next, and rndm().

Referenced by summon_golem().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1551 of file spell_effect.c.

References draw_ext_info(), FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), map_newmap_cmd(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_BLOCKSVIEW, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, remove_ob(), and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

int dispel_rune ( object *  op,
object *  caster,
object *  spell,
object *  skill,
int  dir 
)

Someone is trying to disarm a rune.

The actual attempt is done in trap_disarm().

Parameters:
opobject trying to disarm.
casterobject casting the disarm spell.
spellactual spell for casting.
skillskill to disarm runes.
dirdirection to disarm.
Return values:
0rune wasn't disarmed.
1a rune was disarmed.

Definition at line 323 of file rune.c.

References draw_ext_info(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, P_OUT_OF_MAP, remove_ob(), RUNE, SIGN, TRAP, and trap_disarm().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

void display_high_score ( 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 set, will only print players with name or title containing the string (non case-sensitive).

Definition at line 402 of file hiscore.c.

References close_and_delete(), draw_ext_info(), draw_one_high_score(), get_score(), HIGHSCORE, HIGHSCORE_LENGTH, llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, scr::name, NDI_UNIQUE, open_and_uncompress(), scr::position, settings, snprintf(), strcasestr_local(), strerror_local(), and scr::title.

Referenced by command_hiscore(), showscores(), and showscoresparm().

Here is the call graph for this function:

Here is the caller graph for this function:

void display_motd ( const object *  op)

Sends the message of the day to the player.

Parameters:
opplayer to send to.

Definition at line 112 of file player.c.

References close_and_delete(), Settings::confdir, draw_ext_info(), HUGE_BUF, MAX_BUF, Settings::motd, MSG_SUBTYPE_NONE, MSG_TYPE_MOTD, NDI_GREEN, NDI_UNIQUE, open_and_uncompress(), settings, and snprintf().

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:

void display_who_entry ( object *  op,
player pl,
const char *  format 
)

Display a line of 'who' to op, about pl, using the formatting specified by format.

Parameters:
opplayer getting the information.
plplayer to display information for.
formatformat to display.

Definition at line 648 of file c_misc.c.

References draw_ext_info(), get_who_escape_code_value(), llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, NDI_UNIQUE, and snprintf().

Referenced by list_players().

Here is the call graph for this function:

Here is the caller graph for this function:

object* dm_stack_peek ( player pl)

Get current stack top item for player.

Returns NULL if no stacked item. If stacked item disappeared (freed), remove it.

Ryo, august 2004

Parameters:
plwizard.
Returns:
item on top of stack, or NULL if deleted/stack empty.

Definition at line 2373 of file c_wiz.c.

References dm_stack_pop(), draw_ext_info(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, and pl::stack_position.

Referenced by get_dm_object().

Here is the call graph for this function:

Here is the caller graph for this function:

void dm_stack_pop ( player pl)

Remove an item from the wizard's item stack.

Parameters:
plwizard.

Definition at line 2347 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, and pl::stack_position.

Referenced by command_create(), command_diff(), command_free(), command_insert_into(), command_remove(), command_stack_pop(), and dm_stack_peek().

Here is the call graph for this function:

Here is the caller graph for this function:

void dm_stack_push ( player pl,
tag_t  item 
)

Push specified item on player stack.

Inform player of position. Initializes variables if needed.

Parameters:
plwizard.
itemitem to put on stack.

Definition at line 2403 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, pl::stack_position, and STACK_SIZE.

Referenced by command_create(), command_dumpbelow(), command_stack_push(), and get_dm_object().

Here is the call graph for this function:

Here is the caller graph for this function:

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 440 of file apply.c.

References check_spell_known(), draw_ext_info_format(), esrv_remove_spell(), free_object(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, NDI_NAVY, NDI_UNIQUE, PLAYER, player_unready_range_ob(), and remove_ob().

Referenced by cfapi_object_forget_spell(), check_special_prayers(), command_forget_spell(), and spellbook_type_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

int do_harvest ( object *  pl,
int  dir,
object *  skill 
)

Player is trying to harvest something.

Parameters:
plplayer trying to harvest.
dirdirection.
skillskill being used.
Returns:
0

Definition at line 2472 of file c_misc.c.

References change_exp(), copy_object_with_inv(), draw_ext_info_format(), find_free_spot(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_ob_key_value(), get_object(), insert_ob_in_map(), insert_ob_in_ob(), llevError, LOG(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_WHITE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, random_roll(), remove_ob(), rndm(), set_ob_key_value(), SIZEOFFREE, and SK_EXP_ADD_SKILL.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3796 of file player.c.

References calc_skill_exp(), change_exp(), draw_ext_info(), find_obj_by_type_subtype(), hide(), hideability(), make_visible(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, PREFER_LOW, random_roll(), SK_HIDING, and SKILL.

Referenced by move_monster(), and move_player().

Here is the call graph for this function:

Here is the caller graph for this function:

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 398 of file apply.c.

References check_spell_known(), copy_object(), draw_ext_info_format(), esrv_add_spells(), FLAG_STARTEQUIP, get_object(), insert_ob_in_ob(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, NDI_UNIQUE, play_sound_player_only(), PLAYER, QUERY_FLAG, SET_FLAG, and SOUND_TYPE_SPELL.

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:

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 373 of file skill_util.c.

References apply_anim_suffix(), attack_hth(), attack_melee_weapon(), change_exp(), CLEAR_FLAG, describe_shop(), do_harvest(), draw_ext_info(), find_traps(), fix_object(), FLAG_APPLIED, give_skill_by_name(), hide(), jump(), llevDebug, LOG(), MAX_BUF, meditate(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, pick_lock(), PLAYER, pray(), QUERY_FLAG, query_name(), remove_trap(), SET_FLAG, singing(), SK_ALCHEMY, SK_BARGAINING, SK_BOWYER, SK_CLAWING, SK_CLIMBING, SK_DET_CURSE, SK_DET_MAGIC, SK_DISARM_TRAPS, SK_EVOCATION, SK_FIND_TRAPS, 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_WOODSMAN, SK_WRAITH_FEED, SKILL, skill_ident(), skill_throw(), steal(), use_alchemy(), use_oratory(), and write_on_item().

Referenced by command_throw(), fire(), monster_use_skill(), and use_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3017 of file player.c.

References flush_output_element(), NUM_OUTPUT_BUFS, pticks, and ST_PLAYING.

Referenced by command_possess(), and process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

int do_wizard_dm ( object *  op,
char *  params,
int  silent 
)

Actually changes a player to wizard.

Parameters:
opplayer.
paramspassword.
silentif zero, don't inform players of the mode change.
Return values:
0no mode change.
1op is now a wizard.

Definition at line 1932 of file c_wiz.c.

References checkdm(), clear_los(), draw_ext_info(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_ALL, NDI_LT_GREEN, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.

Referenced by command_dm(), and command_dmhide().

Here is the call graph for this function:

Here is the caller graph for this function:

void do_wizard_hide ( object *  op,
int  silent_dm 
)

Actually hides or unhides specified player (obviously a DM).

Parameters:
opDM hiding.
silent_dmif non zero, other players are informed of DM entering/leaving, else they just think someone left/entered.

Definition at line 147 of file c_wiz.c.

References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_ALL, NDI_DK_ORANGE, NDI_LT_GREEN, and NDI_UNIQUE.

Referenced by command_dmhide(), and command_hide().

Here is the call graph for this function:

Here is the caller graph for this function:

void dragon_ability_gain ( object *  who,
int  atnr,
int  level 
)

When a dragon-player gains a new stage of evolution, he gets some treasure.

Parameters:
whothe dragon player.
atnrthe attack-number of the ability focus.
levelability level.

Definition at line 203 of file standalone.c.

References animate_object(), arch_to_object(), AT_PHYSICAL, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_POISON, check_spell_known(), do_learn_spell(), draw_ext_info(), draw_ext_info_format(), esrv_send_item(), find_skill_by_name(), find_treasurelist(), FLAG_SEE_IN_DARK, FLAG_STEALTH, FLAG_XRAYS, FORCE, HUGE_BUF, insert_ob_in_ob(), treasurestruct::item, treasureliststruct::items, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_RACE, MSG_TYPE_ITEM, MSG_TYPE_ITEM_ADD, NDI_BLUE, NDI_UNIQUE, NRSPELLPATHS, PLAYER, QUERY_FLAG, query_short_name(), SET_FLAG, SK_CLAWING, SKILL_TOOL, snprintf(), SPELL, SPELLBOOK, and spellpathnames.

Referenced by dragon_level_gain().

Here is the call graph for this function:

Here is the caller graph for this function:

void drain_rod_charge ( object *  rod)

Drain charges from a rod.

Parameters:
rodrod to drain.

Definition at line 743 of file spell_util.c.

References SP_level_spellpoint_cost(), and SPELL_HIGHEST.

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:

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 753 of file spell_util.c.

References CLEAR_FLAG, esrv_update_item(), FLAG_ANIMATE, get_player_container(), UPD_ANIM, update_ob_speed(), 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:

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 943 of file c_object.c.

References draw_ext_info(), drop_object(), FLAG_INV_LOCKED, FLAG_NO_DROP, free_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, put_object_in_sack(), QUERY_FLAG, and remove_ob().

Referenced by cfapi_object_drop(), command_drop(), command_dropall(), empty_container(), and handle_apply_yield().

Here is the call graph for this function:

Here is the caller graph for this function:

object* drop_object ( object *  op,
object *  tmp,
uint32  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 was_destroyed returns true?

Definition at line 847 of file c_object.c.

References AP_NO_MERGE, AP_UNAPPLY, apply_special(), draw_ext_info(), draw_ext_info_format(), esrv_update_item(), EVENT_DROP, execute_event(), fix_object(), FLAG_APPLIED, FLAG_NO_DROP, FLAG_NO_FIX_PLAYER, FLAG_STARTEQUIP, FLAG_UNPAID, free_object(), get_split_ob(), insert_ob_in_map(), is_in_shop(), MAX_BUF, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), save_player(), SCRIPT_FIX_ALL, sell_item(), and UPD_WEIGHT.

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:

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 157 of file spell_util.c.

References first_archetype, and SPELL.

Referenced by init_beforeplay().

Here is the caller graph for this function:

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 191 of file standalone.c.

References check_score(), draw_ext_info(), first_map_path, first_player, llevError, llevInfo, LOG(), pl::maplevel, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, NDI_UNIQUE, pl::next, pl::ob, save_player(), and trying_emergency_save.

Referenced by fatal(), fatal_signal(), LOG(), and server_main().

Here is the call graph for this function:

Here is the caller graph for this function:

void enter_exit ( object *  op,
object *  exit_ob 
)

Tries to move 'op' to exit_ob.

This is used when loading the player.

Largely redone by MSW 2001-01-21 - this function was overly complex and had some obscure bugs.

Parameters:
opcharacter or monster that is using the exit.
exit_obexit object (boat, door, teleporter, etc.). if null, then op->contr->maplevel contains that map to move the object to.

Definition at line 740 of file server.c.

References AP_UNAPPLY, draw_ext_info_format(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, 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, flags, FORCE, free_object(), hit_player(), HUGE_BUF, llevDebug, llevError, Settings::localdir, LOG(), MAP_ENTER_X, MAP_ENTER_Y, MAP_PLAYER_UNIQUE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, NDI_UNIQUE, ob_apply(), path_combine_and_normalize(), PLAYER, PORTAL_DESTINATION_NAME, QUERY_FLAG, ready_map_name(), remove_ob(), save_player(), and settings.

Referenced by check_login(), command_arrest(), command_goto(), command_reset(), command_summon(), command_teleport(), enter_player_savebed(), execute_word_of_recall(), exit_type_apply(), exit_type_move_on(), key_change_class(), move_teleporter(), player_changer_type_process(), and set_first_map().

Here is the call graph for this function:

Here is the caller graph for this function:

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 175 of file server.c.

References add_string(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, free_object(), free_string(), get_object(), llevDebug, LOG(), mapdef::path, and settings.

Referenced by kill_player(), and save_life().

Here is the call graph for this function:

Here is the caller graph for this function:

void examine ( object *  op,
object *  tmp 
)
void examine_monster ( object *  op,
object *  tmp 
)

Player examine a monster.

Parameters:
opplayer.
tmpmonster being examined.

Definition at line 1424 of file c_object.c.

References AT_ACID, draw_ext_info(), FLAG_UNDEAD, mon, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, NDI_UNIQUE, POISONING, present_in_ob(), and QUERY_FLAG.

Referenced by examine(), and probe().

Here is the call graph for this function:

Here is the caller graph for this function:

int execute_event ( object *  op,
int  eventcode,
object *  activator,
object *  third,
const char *  message,
int  fix 
)
int execute_global_event ( int  eventcode,
  ... 
)
int execute_newserver_command ( object *  pl,
char *  command 
)

Player issued a command, let's handle it.

This function is called from the new client/server code.

Parameters:
plplayer who is issuing the command
commandthe actual command with its arguments.
Returns:
0 if invalid command, else actual command's return value (which may be zero).

Definition at line 98 of file c_new.c.

References Commands, CommandsSize, CommunicationCommands, CommunicationCommandSize, draw_ext_info_format(), find_command_element(), find_plugin_command(), FLAG_WIZ, command_array_struct::func, llevDebug, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, command_array_struct::time, tolower, WizCommands, and WizCommandsSize.

Referenced by new_player_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void explode_bullet ( object *  op)

Causes an object to explode, eg, a firebullet, poison cloud ball, etc.

Parameters:
opthe object to explode.

Definition at line 144 of file spell_attack.c.

References add_refcount(), arch_to_object(), AT_GODPOWER, AT_HOLYWORD, AT_MAGIC, copy_owner(), FREE_AND_CLEAR_STR, free_object(), get_owner(), hit_map(), insert_ob_in_map(), llevError, LOG(), object_get_env_recursive(), out_of_map(), remove_ob(), SP_BOMB, SP_CONE, SPELL_EFFECT, and tailor_god_spell().

Referenced by animate_bomb(), check_bullet(), and move_bullet().

Here is the call graph for this function:

Here is the caller graph for this function:

const object* find_god ( const char *  name)

Returns pointer to specified god's object through pntr_to_god_obj().

Note:
returned object shouldn't be modified.
Parameters:
namegod's name.
Returns:
pointer to god's object, NULL if doesn't match any god.

Definition at line 92 of file gods.c.

References first_god, glnk::name, glnk::next, and pntr_to_god_obj().

Referenced by become_follower(), cast_bless(), cast_consecrate(), cast_curse(), cast_detection(), cast_smite_spell(), command_setgod(), hit_player(), hit_with_one_attacktype(), mood_change(), perceive_self(), pray_at_altar(), summon_golem(), summon_object(), and tailor_god_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2278 of file player.c.

References CONTAINER, DOOR, draw_ext_info_format(), find_key(), FLAG_APPLIED, KEY, key_inventory, keyrings, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, NDI_BROWN, NDI_UNIQUE, QUERY_FLAG, query_name(), and SPECIAL_KEY.

Referenced by apply_container(), find_key(), and player_attack_door().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1339 of file c_object.c.

Referenced by animate_weapon(), apply_map_builder(), armour_improver_type_apply(), cast_item_curse_or_curse(), cfapi_object_get_property(), command_mark(), command_rename_item(), find_throw_ob(), identify_altar_type_move_on(), lighter_type_apply(), recharge(), weapon_improver_type_apply(), and write_on_item().

Here is the caller graph for this function:

object* find_mon_throw_ob ( object *  op)

Definition at line 1978 of file monster.c.

References FLAG_APPLIED, FLAG_IS_THROWN, llevDebug, LOG(), MAX_BUF, 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:

object* find_nearest_living_creature ( object *  npc)

Returns the nearest living creature (monster or generator).

Modified to deal with tiled maps properly. Also fixed logic so that monsters in the lower directions were more likely to be skipped - instead of just skipping the 'start' number of direction, revisit them after looking at all the other spaces.

Note that being this may skip some number of spaces, it will not necessarily find the nearest living creature - it basically chooses one from within a 3 space radius, and since it skips the first few directions, it could very well choose something 3 spaces away even though something directly north is closer.

This function is map tile aware.

Parameters:
npcmonster to consider
Returns:
living creature, or NULL if none found.

Definition at line 162 of file monster.c.

References can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_search_arr(), llevDebug, LOG(), P_IS_ALIVE, P_OUT_OF_MAP, mapdef::path, PLAYER, QUERY_FLAG, and SIZEOFFREE.

Referenced by find_enemy(), and get_pet_enemy().

Here is the call graph for this function:

Here is the caller graph for this function:

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 62 of file player.c.

References first_player, MAX_BUF, pl::next, pl::ob, and query_name().

Referenced by command_reply(), and list_players().

Here is the call graph for this function:

Here is the caller graph for this function:

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 84 of file player.c.

References first_player, pl::next, pl::ob, and strncasecmp().

Referenced by cfapi_player_find(), command_follow(), command_stats(), command_teleport(), do_tell(), and process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

command_array_struct* find_plugin_command ( char *  cmd,
object *  op 
)
Todo:
remove static buffer.

Definition at line 4568 of file plugins.c.

References _crossfire_plugin::next, and _crossfire_plugin::propfunc.

Referenced by execute_newserver_command().

Here is the caller graph for this function:

racelink* find_racelink ( const char *  name)

Find the race information for the specified name.

Parameters:
namerace to search for.
Returns:
race structure, NULL if not found.

Definition at line 1468 of file init.c.

References first_race, ralnk::name, and ralnk::next.

Referenced by add_to_racelist(), and choose_cult_monster().

Here is the caller graph for this function:

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 60 of file spell_util.c.

References SPELL.

Referenced by cast_spell(), and write_scroll().

Here is the caller graph for this function:

object* find_skill_by_name ( object *  who,
const char *  name 
)

This returns the skill pointer of the given name (the one that accumlates 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.

Parameters:
whoPlayer to get skill.
nameskill to find. Needs not to be a shared string.
Returns:
pointer to skill object, or NULL if player doesn't have it.
Todo:
check if name shouldn't be made a shared string.

Definition at line 207 of file skill_util.c.

References adjust_skill_tool(), FLAG_APPLIED, QUERY_FLAG, SKILL, SKILL_TOOL, and strncasecmp().

Referenced by apply_special(), attempt_do_alchemy(), attempt_recipe(), book_type_apply(), cast_destruction(), cast_dust(), cast_spell(), command_addexp(), command_cast_spell(), command_rskill(), command_throw(), do_skill_attack(), dragon_ability_gain(), inscribe_scroll_cmd(), scroll_type_apply(), spellbook_type_apply(), and write_on_item().

Here is the call graph for this function:

Here is the caller graph for this function:

object* find_skill_by_number ( object *  who,
int  skillno 
)

This returns the skill pointer of the given name (the one that accumlates 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 number.

Parameters:
whoplayer applying a skill.
skillnoskill subtype.
Returns:
skill object if player can use it, NULL else.

Definition at line 209 of file standalone.c.

References adjust_skill_tool(), FLAG_APPLIED, NUM_SKILLS, QUERY_FLAG, SKILL, and SKILL_TOOL.

Referenced by can_detect_enemy(), check_move_on(), find_best_player_hth_skill(), god_enchants_weapon(), query_cost(), and query_cost_string().

Here is the call graph for this function:

Here is the caller graph for this function:

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 779 of file spell_util.c.

References FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, and TRANSPORT.

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:

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 1207 of file skills.c.

References calc_skill_exp(), draw_ext_info(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, TRAP, trap_see(), and trap_show().

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2204 of file player.c.

References action_makes_visible(), apply_map_builder(), cast_spell(), control_golem(), do_skill(), draw_ext_info(), fire_misc_object(), make_visible(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, player_fire_bow(), range_bow, range_builder, range_golem, range_magic, range_misc, range_none, and range_skill.

Referenced by command_stay(), and move_player().

Here is the call graph for this function:

Here is the caller graph for this function:

int fire_arch_from_position ( object *  op,
object *  caster,
sint16  x,
sint16  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 653 of file spell_util.c.

References arch_to_object(), AT_GODPOWER, AT_HOLYWORD, caster_level(), copy_owner(), draw_ext_info(), FLAG_IS_TURNABLE, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_owner(), insert_ob_in_map(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, ob_process(), OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, SET_ANIMATION, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), and tailor_god_spell().

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:

int fire_bolt ( object *  op,
object *  caster,
int  dir,
object *  spob,
object *  skill 
)

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.
skillskill to credit kill experience to.
Return values:
0no bolt could be fired.
1bolt was fired (but may have been destroyed already).

Definition at line 78 of file spell_attack.c.

References absdir(), add_refcount(), arch_to_object(), DIRX, DIRY, FLAG_IS_TURNABLE, FLAG_REFLECTING, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), ob_process(), OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, QUERY_FLAG, SET_ANIMATION, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

int fire_bow ( object *  op,
object *  arrow,
int  dir,
int  wc_mod,
sint16  sx,
sint16  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 1922 of file player.c.

References add_refcount(), add_string(), AT_PHYSICAL, BOW, bow_bestarrow, CLEAR_FLAG, dam_bonus, dex_bonus, draw_ext_info(), draw_ext_info_format(), FABS, find_arrow(), fix_object(), FLAG_NO_STRENGTH, FLAG_READY_BOW, free_object(), free_string(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_split_ob(), insert_ob_in_map(), llevError, LOG(), MOVE_FLY_LOW, MOVE_WALK, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, ob_process(), P_OUT_OF_MAP, play_sound_map(), PLAYER, QUERY_FLAG, range_bow, remove_ob(), SET_ANIMATION, set_owner(), SOUND_TYPE_ITEM, strdup_local(), thaco_bonus, and update_ob_speed().

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:

int fire_bullet ( object *  op,
object *  caster,
int  dir,
object *  spob 
)

Casts a bullet-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.
casterwhat object is really casting.
dircasting direction.
spobspell object for the bullet.
Return values:
0no bullet could be fired.
1bullet was fired (but may have been destroyed already).

Definition at line 301 of file spell_attack.c.

References absdir(), add_refcount(), arch_to_object(), check_bullet(), FLAG_IS_TURNABLE, FLAG_REFLECTING, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, QUERY_FLAG, SET_ANIMATION, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Referenced by cast_spell(), and move_swarm_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1185 of file spell_attack.c.

References arch_to_object(), AT_GODPOWER, AT_HOLYWORD, caster_level(), create_archetype(), die_roll(), insert_ob_in_map(), PREFER_HIGH, set_owner(), set_spell_skill(), SP_level_duration_adjust(), SWARM_SPELL, and tailor_god_spell().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

void fix_auto_apply ( 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 auto_apply() if appropriate.

Parameters:
mmap to fix.

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).

Added as part of glue cleaning. Ryo 2005-07-15

Definition at line 130 of file standalone.c.

References ALTAR, auto_apply(), check_trigger(), CLASS, CONTAINER, create_treasure(), mapdef::difficulty, FIREWALL, FLAG_AUTO_APPLY, FLAG_IS_LINKED, GET_MAP_OB, GT_APPLY, HAS_RANDOM_ITEMS, HORN, MAP_HEIGHT, MAP_WIDTH, PLAYER, PLAYER_CHANGER, POTION, QUERY_FLAG, ROD, SCROLL, SPELL, SPELLBOOK, TIMED_GATE, TREASURE, TRIGGER_BUTTON, TRIGGER_PEDESTAL, update_ob_speed(), and WAND.

Referenced by enter_fixed_template_map(), enter_unique_map(), generate_random_map(), load_temporary_map(), ready_map_name(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

void fix_luck ( void  )

Fixes luck of players, slowly move it towards 0.

Definition at line 3661 of file player.c.

References change_luck(), first_player, pl::next, and pl::ob.

Referenced by do_specials().

Here is the call graph for this function:

Here is the caller graph for this function:

object* fix_stopped_arrow ( object *  op)

An ARROW stops moving.

Parameters:
oparrow stopping.
Returns:
arrow, or NULL if it was broken.

Definition at line 483 of file time.c.

References add_string(), FREE_AND_CLEAR_STR, free_no_drop(), free_object(), remove_ob(), rndm(), update_ob_speed(), and update_object().

Referenced by hit_with_arrow(), stop_item(), and stop_projectile().

Here is the call graph for this function:

Here is the caller graph for this function:

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 466 of file time.c.

References ARROW, FLAG_REMOVED, insert_ob_in_map(), merge_ob(), and QUERY_FLAG.

Referenced by save_throw_object().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3645 of file player.c.

References first_player, fix_object(), llevDebug, LOG(), pl::next, pl::ob, and sum_weight().

Referenced by do_specials().

Here is the call graph for this function:

Here is the caller graph for this function:

void flush_old_maps ( void  )

Removes tmp-files of maps which are going to be reset next time they are visited.

This is very useful if the tmp-disk is very full.

Definition at line 305 of file swap.c.

References clean_tmp_map(), delete_map(), EVENT_MAPRESET, execute_global_event(), first_map, mapdef::in_memory, mapdef::is_template, llevDebug, LOG(), MAP_IN_MEMORY, MAP_SWAPPED, mapdef::next, mapdef::path, players_on_map(), seconds(), set_map_timeout(), mapdef::timeout, mapdef::tmpname, TRUE, and mapdef::unique.

Referenced by block_until_new_connection(), command_reset(), and do_specials().

Here is the call graph for this function:

Here is the caller graph for this function:

void follow_owner ( object *  ob,
object *  owner 
)

A pet is trying to follow its owner.

Parameters:
obpet trying to follow. Will be remove_ob()'d if can't follow.
ownerowner of ob.

Definition at line 306 of file pets.c.

References draw_ext_info(), find_free_spot(), FLAG_REMOVED, freearr_x, freearr_y, get_map_from_coord(), insert_ob_in_map(), llevError, llevMonster, LOG(), MAP_IN_MEMORY, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, NDI_UNIQUE, OUT_OF_REAL_MAP, PLAYER, QUERY_FLAG, remove_ob(), and SIZEOFFREE.

Referenced by move_monster(), pet_move(), and remove_all_pets().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1296 of file server.c.

References close_and_delete(), Settings::confdir, days, llevDebug, LOG(), logfile, MAX_BUF, open_and_uncompress(), PERM_FILE, settings, and snprintf().

Referenced by init_startup().

Here is the call graph for this function:

Here is the caller graph for this function:

partylist* form_party ( object *  op,
const char *  params 
)

Forms the party struct for a party called 'params'.

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.
paramsparty name.
Returns:
new party.

Definition at line 65 of file c_party.c.

References draw_ext_info_format(), firstparty, party_struct::kills, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, party_struct::next, party_struct::partyleader, party_struct::partyname, party_struct::passwd, replace_unprintable_chars(), send_party_message(), snprintf(), strdup_local(), and party_struct::total_exp.

Referenced by check_login(), command_party(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

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 536 of file time.c.

References FLAG_NO_DROP, FLAG_REMOVED, free_object2(), QUERY_FLAG, and remove_ob().

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:

void free_server ( void  )

Frees all memory allocated around here:

  • materials
  • races

Definition at line 955 of file init.c.

References free_materials(), and free_races().

Referenced by cleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1818 of file attack.c.

References DISEASE, get_owner(), PLAYER, POISONING, RUNE, and SPELL.

Referenced by hit_player().

Here is the call graph for this function:

Here is the caller graph for this function:

object* get_dm_object ( player pl,
char **  params,
int *  from 
)

Checks 'params' for object code.

Can be:

  • empty => get current object stack top for player
  • number => get item with that tag, stack it for future use
  • $number => get specified stack item
  • "me" => player himself

At function exit, params points to first non-object char

'from', if not NULL, contains at exit:

Ryo, august 2004

Parameters:
plwizard.
paramsobject specified.
from
Returns:
pointed object, or NULL if nothing suitable was found.

Definition at line 2450 of file c_wiz.c.

References dm_stack_peek(), dm_stack_push(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, STACK_FROM_NONE, STACK_FROM_NUMBER, STACK_FROM_STACK, STACK_FROM_TOP, pl::stack_items, and pl::stack_position.

Referenced by command_diff(), command_dump(), command_free(), command_insert_into(), command_patch(), command_remove(), and command_stack_push().

Here is the call graph for this function:

Here is the caller graph for this function:

Simple wrapper to get firstparty.

Returns:
firstparty.

Definition at line 48 of file c_party.c.

References firstparty.

Referenced by cfapi_party_get_property(), check_login(), and START_TEST().

Here is the caller graph for this function:

void get_name ( object *  op)

Waiting for the player's name.

Parameters:
opplayer.

Definition at line 786 of file player.c.

References send_query(), 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:

object* get_nearest_player ( object *  mon)

Finds the nearest visible player for some object.

Parameters:
monwhat object is searching a player.
Returns:
player, or NULL if nothing suitable.

Definition at line 447 of file player.c.

References can_detect_enemy(), rv_vector::distance, first_friendly_object, first_player, FLAG_FREED, FLAG_FRIENDLY, llevDebug, LOG(), pl::next, pl::ob, QUERY_FLAG, and remove_friendly_object().

Referenced by find_enemy(), and move_monster().

Here is the call graph for this function:

Here is the caller graph for this function:

void 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.

Definition at line 891 of file player.c.

References CS_QUERY_HIDEINPUT, llevError, LOG(), send_query(), 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:

void get_password ( object *  op)

Waiting for the player's password.

Parameters:
opplayer.

Definition at line 798 of file player.c.

References CS_QUERY_HIDEINPUT, send_query(), 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:

int get_payment ( object *  pl,
object *  op 
)

Descends containers looking for unpaid items, and pays for them.

Parameters:
plplayer buying the stuff.
opobject we are examining. If op has and inventory, we examine that. IF there are objects below op, we descend down.
Return values:
0player still has unpaid items.
1player has paid for everything.

Definition at line 992 of file shop.c.

References CLEAR_FLAG, cost_string_from_value(), draw_ext_info_format(), esrv_update_item(), F_BUY, F_SHOP, FLAG_PLAYER_SOLD, FLAG_UNPAID, get_payment(), MAX_BUF, merge_ob(), MSG_TYPE_SHOP, MSG_TYPE_SHOP_PAYMENT, NDI_UNIQUE, pay_for_item(), PLAYER, query_cost(), query_cost_string(), QUERY_FLAG, query_money(), query_name(), SET_FLAG, stringbuffer_finish(), UPD_FLAGS, and UPD_NAME.

Referenced by get_payment(), and shop_mat_type_move_on().

Here is the call graph for this function:

Here is the caller graph for this function:

object* get_pet_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 67 of file pets.c.

References can_detect_enemy(), can_see_enemy(), check_enemy(), CLEAR_FLAG, find_nearest_living_creature(), FLAG_ALIVE, FLAG_CONFUSED, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), get_rangevector(), get_search_arr(), on_same_map(), P_IS_ALIVE, P_OUT_OF_MAP, pet_defend, pet_normal, pet_sad, PETMOVE, PLAYER, QUERY_FLAG, remove_friendly_object(), should_arena_attack(), and SIZEOFFREE.

Referenced by find_enemy().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_who_escape_code_value ( char *  return_val,
int  size,
const char  letter,
player pl 
)

Returns the value of the escape code used in the who format specifier.

Specifier values are:

  • N Name of character
  • t title of character
  • T the optional "the " sequence value (depend if player has own_title or not)
  • c count
  • n newline
  • h <Hostile> if character is hostile, nothing otherwise
  • d <WIZ> if character is a dm, nothing otherwise
  • a <AFK> if character is afk, nothing otherwise
  • b <BOT> if character is a bot, nothing otherwise
  • l the level of the character
  • m the map path the character is currently on
  • M the map name of the map the character is currently on
  • r the region name (eg scorn, wolfsburg)
  • R the regional title (eg The Kingdom of Scorn, The Port of Wolfsburg)
  • i player's ip address
  • % a literal %
  • _ a literal underscore
Parameters:
[out]return_valbuffer that will contain the information.
sizelength of return_val.
letterformat specifier.
plplayer to get information for.

Definition at line 709 of file c_misc.c.

References FLAG_AFK, FLAG_WIZ, get_name_of_region_for_map(), get_region_by_map(), get_region_longname(), socket_struct::host, socket_struct::is_bot, pl::ob, pl::own_title, pl::peaceful, QUERY_FLAG, snprintf(), pl::socket, and pl::title.

Referenced by display_who_entry().

Here is the call graph for this function:

Here is the caller graph for this function:

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 688 of file player.c.

References AP_NOPRINT, 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, FORCE, free_object(), GT_ONLY_GOOD, GT_STARTEQUIP, IS_ARMOR, IS_SHIELD, IS_WEAPON, link_player_skills(), llevError, LOG(), manual_apply(), need_identify(), PLAYER, QUERY_FLAG, remove_ob(), SET_FLAG, SKILL, SPELL, and SPELLBOOK.

Referenced by apply_changes_to_player(), and key_change_class().

Here is the call graph for this function:

Here is the caller graph for this function:

void handle_apply_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 131 of file apply.c.

References create_archetype(), drop(), get_ob_key_value(), insert_ob_in_map(), and insert_ob_in_ob().

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:

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 2826 of file player.c.

References draw_ext_info(), FLAG_MAKE_INVIS, FLAG_REMOVED, FLAG_SCARED, flee_player(), handle_client(), make_visible(), move_player(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_END, NDI_UNIQUE, pticks, QUERY_FLAG, and range_golem.

Referenced by process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

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 498 of file skills.c.

References attempt_hide(), calc_skill_exp(), draw_ext_info(), FLAG_MAKE_INVIS, 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, PLAYER, QUERY_FLAG, and update_object().

Referenced by do_hidden_move(), and do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3755 of file player.c.

References freearr_x, freearr_y, get_map_flags(), has_carried_lights(), P_BLOCKSVIEW, and P_OUT_OF_MAP.

Referenced by attempt_hide(), and do_hidden_move().

Here is the call graph for this function:

Here is the caller graph for this function:

int hit_map ( object *  op,
int  dir,
uint32  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 292 of file attack.c.

References AT_CHAOS, AT_COUNTERSPELL, AT_MAGIC, counterspell(), FLAG_ALIVE, FLAG_FREED, FLAG_REMOVED, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, hit_player(), llevError, LOG(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, save_throw_object(), shuffle_attack(), TRANSPORT, and update_object().

Referenced by explode_bullet(), explosion(), move_aura(), move_ball_spell(), move_bolt(), move_cone(), move_missile(), and rune_attack().

Here is the call graph for this function:

Here is the caller graph for this function:

int hit_player ( object *  op,
int  dam,
object *  hitter,
uint32  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 1868 of file attack.c.

References abort_attack(), add_friendly_object(), arch_to_object(), AT_CHAOS, AT_DEATH, AT_DRAIN, AT_HOLYWORD, AT_MAGIC, AT_PARALYZE, AT_PHYSICAL, AT_SLOW, ATNR_MAGIC, attack_message(), ATTACKS, Chaos_Attacks::attacktype, CLEAR_FLAG, determine_god(), did_make_save(), DOOR, find_first_free_spot(), find_god(), FLAG_ALIVE, FLAG_FREED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_NO_DAMAGE, FLAG_ONE_HIT, FLAG_RUN_AWAY, FLAG_SPLITTING, FLAG_TEAR_DOWN, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, FLAG_WIZ, free_object(), freearr_x, freearr_y, friendly_fire(), get_attack_mode(), get_owner(), GRIMREAPER, hit_with_one_attacktype(), insert_ob_in_map(), kill_object(), llevDebug, llevError, LOG(), npc_call_help(), NROFATTACKS, NROFNEWOBJS, PETMOVE, PLAYER, QUERY_FLAG, remove_friendly_object(), remove_ob(), rndm(), RUNE, scare_creature(), SET_FLAG, Settings::set_friendly_fire, set_owner(), settings, spring_trap(), tear_down_wall(), TRAP, and undead_name.

Referenced by attack_ob_simple(), cast_destruction(), cast_earth_to_dust(), cast_light(), check_bullet(), check_doors(), check_earthwalls(), eat_special_food(), enter_exit(), gate_type_process(), hit_map(), legacy_ob_process(), move_symptom(), player_attack_door(), poison_type_apply(), poisoning_type_process(), rune_attack(), spell_effect_type_move_on(), spell_failure(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

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 975 of file attack.c.

References add_refcount(), attack_ob_simple(), EVENT_ATTACK, EVENT_CONNECTOR, execute_event(), fix_stopped_arrow(), free_no_drop(), free_object(), free_string(), insert_ob_in_map(), insert_ob_in_ob(), merge_ob(), remove_ob(), SCRIPT_FIX_ALL, and stick_arrow().

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:

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 336 of file disease.c.

References add_refcount(), copy_object(), DISEASE, draw_ext_info(), FLAG_MONSTER, free_string(), get_object(), get_owner(), insert_ob_in_ob(), is_susceptible_to_disease(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_RED, NDI_UNIQUE, op_on_battleground(), PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), set_owner(), SIGN, and snprintf().

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:

void init ( int  argc,
char **  argv 
)

This is the main server initialisation function.

Called only once, when starting the program.

Definition at line 905 of file init.c.

References become_daemon(), cftimer_init(), Settings::daemonmode, Settings::dm_mail, FULL_VERSION, init_beforeplay(), init_commands(), init_done, init_library(), init_ob_methods(), init_server(), init_signals(), init_skills(), init_startup(), load_materials(), load_settings(), logfile, metaserver2_init(), metaserver_init(), parse_args(), read_map_log(), reset_sleep(), and settings.

Referenced by main(), and server_main().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_commands ( void  )

Sorts the command arrays for easy search through bsearch().

Definition at line 293 of file commands.c.

References CommandsSize, and compare_A().

Referenced by init().

Here is the call graph for this function:

Here is the caller graph for this function:

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 49 of file ob_methods.c.

References ob_methods::apply, ob_methods::describe, init_ob_method_struct(), init_ob_types(), legacy_ob_apply(), legacy_ob_describe(), legacy_ob_process(), 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:

void init_skills ( void  )

This just sets up the skill_names table above.

The index into the array is set up by the subtypes.

Definition at line 71 of file skill_util.c.

References add_refcount(), add_string(), first_archetype, llevError, LOG(), NUM_SKILLS, SKILL, and skill_names.

Referenced by init().

Here is the call graph for this function:

Here is the caller graph for this function:

int initPlugins ( void  )

Definition at line 4588 of file plugins.c.

References closedir(), dirent::d_name, LIBDIR, llevInfo, LOG(), MAX_BUF, opendir(), PLUGIN_SUFFIX, plugins_init_plugin(), readdir(), and snprintf().

Referenced by server_main().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1653 of file c_object.c.

References CONTAINER, draw_ext_info(), draw_ext_info_format(), FLAG_APPLIED, FLAG_WIZ, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_INVENTORY, NDI_UNIQUE, QUERY_FLAG, query_name(), and query_weight().

Referenced by command_inventory(), and look_at().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_in_shop ( object *  ob)

Check if an object is in a shop.

Parameters:
obobject to check for.
Returns:
1 if in a shop so, 0 otherwise.

Definition at line 1414 of file shop.c.

References coords_in_shop().

Referenced by convert_item(), drop_object(), examine(), kill_player(), shop_mat_type_move_on(), and transport_type_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3731 of file player.c.

References EXPERIENCE, FLAG_UNDEAD, PLAYER, and QUERY_FLAG.

Referenced by can_see_enemy(), and makes_invisible_to().

Here is the caller graph for this function:

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:
experience gained for jumping.

Definition at line 651 of file skills.c.

References attempt_jump(), draw_ext_info(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, and NDI_UNIQUE.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1156 of file player.c.

References add_statbonus(), add_string(), allowed_class(), CLEAR_FLAG, copy_object(), create_treasure(), CS_QUERY_SINGLECHAR, draw_ext_info(), enter_exit(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, execute_global_event(), EXIT_PATH, EXIT_X, EXIT_Y, find_treasurelist(), first_map_ext_path, fix_object(), FLAG_WIZ, free_object(), free_string(), get_object(), get_player_archetype(), give_initial_items(), insert_ob_in_map(), link_player_skills(), llevDebug, Settings::localdir, LOG(), make_path_to_file(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_BLUE, play_again(), Settings::playerdir, pticks, remove_ob(), remove_statbonus(), send_query(), SET_ANIMATION, settings, snprintf(), ST_PLAYING, start_info(), UPD_FACE, and update_object().

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void key_confirm_quit ( object *  op,
char  key 
)

We receive the reply to the 'quit confirmation' message.

Parameters:
opplayer.
keyreply.

Definition at line 1278 of file player.c.

References check_score(), delete_character(), delete_map(), draw_ext_info(), draw_ext_info_format(), EVENT_REMOVE, execute_global_event(), first_map, FLAG_WAS_WIZ, Settings::localdir, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, mapdef::next, mapdef::path, play_again(), Settings::playerdir, QUERY_FLAG, remove_ob(), Settings::set_title, settings, snprintf(), ST_PLAYING, terminate_all_pets(), and TRUE.

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1079 of file player.c.

References add_statbonus(), CHA, CON, CS_QUERY_SINGLECHAR, DEX, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, INT, llevError, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_BLUE, NDI_UNIQUE, play_again(), POW, roll_stats(), send_query(), SET_ANIMATION, SET_FLAG, short_stat_name, ST_CHANGE_CLASS, STR, swap_stat(), and WIS.

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void kill_player ( object *  op)

When a player should die (lack of hp, food, etc), we call this.

If the player can not be saved (permadeath, no lifesave), this will take care of removing the player file.

Will remove diseases, apply death penalties, and so on.

Takes battleground into account.

Parameters:
opplayer in jeopardy.
Todo:
describe battleground.

Definition at line 3238 of file player.c.

References add_string(), apply_death_exp_penalty(), arch_to_object(), Settings::balanced_stat_loss, BALSL_LOSS_CHANCE_RATIO, BALSL_MAX_LOSS_RATIO, BALSL_NUMBER_LOSSES_RATIO, change_attr_value(), check_score(), check_stat_bounds(), create_archetype(), cure_disease(), dead_player(), delete_character(), determine_god(), draw_ext_info(), draw_ext_info_format(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_player_savebed(), EVENT_DEATH, EVENT_PLAYER_DEATH, execute_event(), execute_global_event(), find_archetype(), fix_object(), FLAG_APPLIED, FLAG_UNIQUE, FLAG_WAS_WIZ, FLESH, FORCE_NAME, FREE_AND_COPY, free_object(), free_string(), get_attr_value(), GET_MAP_OB, gravestone_text(), insert_ob_in_map(), insert_ob_in_ob(), is_in_shop(), loot_object(), lose_msg, MAX, MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_ATTRIBUTE_GOD, MSG_TYPE_ATTRIBUTE_STAT_LOSS, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_DIED, NDI_ALL, NDI_NAVY, NDI_UNIQUE, Settings::not_permadeth, NROFATTACKS, op_on_battleground(), play_again(), play_sound_player_only(), PREFER_LOW, present_arch_in_ob(), QUERY_FLAG, random_roll(), range_golem, remove_friendly_object(), remove_ob(), remove_unpaid_objects(), Settings::resurrection, save_life(), save_player(), SCRIPT_FIX_ALL, SET_FLAG, Settings::set_title, settings, snprintf(), SOUND_TYPE_LIVING, SPELL_EFFECT, Settings::stat_loss_on_death, transfer_ob(), and TRUE.

Referenced by check_login(), deep_swamp_type_process(), and kill_object().

Here is the call graph for this function:

Here is the caller graph for this function:

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 690 of file skill_util.c.

References FLAG_CAN_USE_SKILL, give_skill_by_name(), learn_spell, link_player_skills(), llevError, LOG(), PREFER_LOW, QUERY_FLAG, random_roll(), SET_FLAG, SKILL, and strncasecmp().

Referenced by skillscroll_type_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

void leave ( player pl,
int  draw_exit 
)

Player logs out, or was disconnected.

Parameters:
plplayer.
draw_exitif set, display leaving message to other players.
Todo:
check for pl != NULL should include the 'left the game', just in case (or remove it?)

Definition at line 1234 of file server.c.

References check_score(), DEAD_OBJECT, draw_ext_info_format(), FLAG_WIZ, pl::hidden, socket_struct::host, llevInfo, LOG(), MAP_IN_MEMORY, MAP_TIMEOUT, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_PLAYER, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, Ns_Dead, pl::ob, QUERY_FLAG, query_name(), pl::socket, ST_CONFIRM_PASSWORD, ST_GET_NAME, ST_GET_PASSWORD, pl::state, socket_struct::status, and pl::transport.

Referenced by attack_ob_simple(), check_login(), do_server(), receive_play_again(), and shop_mat_type_move_on().

Here is the call graph for this function:

Here is the caller graph for this function:

void legacy_animate_trigger ( object *  op)

Definition at line 772 of file time.c.

References animate_trigger().

Referenced by legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

void legacy_apply_container ( object *  op,
object *  sack 
)

Definition at line 1872 of file apply.c.

References apply_container().

Referenced by container_type_move_on(), and legacy_ob_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

void legacy_move_hole ( object *  op)

Definition at line 776 of file time.c.

References move_hole().

Referenced by legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

void legacy_remove_force ( object *  op)

Definition at line 768 of file time.c.

References remove_force().

Referenced by legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

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 282 of file c_range.c.

References range_bow, range_golem, range_magic, range_misc, range_none, and range_skill.

Referenced by change_spell(), and check_login().

Here is the caller graph for this function:

void link_player_skills ( object *  op)

This function goes through the player inventory and sets up the last_skills[] array in the player object.

The last_skills[] is used to more quickly lookup skills - mostly used for sending exp.

Parameters:
opplayer to link skills for. Must be a player.

Definition at line 112 of file skill_util.c.

References llevError, LOG(), NUM_SKILLS, and SKILL.

Referenced by adjust_skill_tool(), become_follower(), check_login(), food_type_apply(), give_initial_items(), key_change_class(), and learn_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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.c.

References display_who_entry(), draw_ext_info(), draw_ext_info_format(), find_player(), first_player, FLAG_AFK, FLAG_WIZ, get_language(), get_region_by_map(), pl::hidden, I18N_MSG_CMISC_052, I18N_MSG_CMISC_053, I18N_MSG_CMISC_054, I18N_MSG_CMISC_055, i18n_translate(), socket_struct::is_bot, chars_names::login_order, regiondef::longname, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, regiondef::name, name_cmp(), NDI_UNIQUE, pl::next, pl::ob, pl::party, party_struct::partyname, QUERY_FLAG, region_is_child_of_region(), settings, pl::socket, ST_GET_PARTY_PASSWORD, ST_PLAYING, pl::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:

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 430 of file spell_util.c.

References 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:

int magic_wall ( object *  op,
object *  caster,
int  dir,
object *  spell_ob 
)

This creates magic walls.

Really, it can create most any object, within some reason.

Parameters:
opwho is casting.
casterwhat is casting.
dircasting direction.
spell_obactual spell object.
Return values:
0spell failed.
1spell was successful.

Definition at line 1391 of file spell_effect.c.

References arch_to_object(), caster_level(), copy_object(), draw_ext_info(), draw_ext_info_format(), find_archetype(), FLAG_ALIVE, FLAG_BLOCKSVIEW, FLAG_IS_USED_UP, FLAG_TEAR_DOWN, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_object(), insert_ob_in_map(), insert_ob_in_ob(), llevError, LOG(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, SET_FLAG, set_owner(), set_spell_skill(), snprintf(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SPELL, SPELL_EFFECT, and update_all_los().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

void make_visible ( object *  op)

Makes an object visible again.

Parameters:
opwhat to make visible.

Definition at line 3712 of file player.c.

References FREE_AND_CLEAR_STR, PLAYER, and update_object().

Referenced by attack_ob_simple(), attempt_steal(), can_detect_enemy(), can_see_enemy(), do_hidden_move(), fire(), handle_newcs_player(), hide(), move_player_attack(), and player_attack_door().

Here is the call graph for this function:

Here is the caller graph for this function:

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 774 of file spell_effect.c.

References FLAG_UNDEAD, is_true_undead(), PLAYER, and QUERY_FLAG.

Referenced by can_see_enemy(), and cast_invisible().

Here is the call graph for this function:

Here is the caller graph for this function:

void malloc_info ( object *  op)
int manual_apply ( object *  op,
object *  tmp,
int  aflag 
)

Main apply handler.

Checks for unpaid items before applying.

Parameters:
op::object causing tmp to be applied.
tmp::object 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 512 of file apply.c.

References check_race_restrictions(), draw_ext_info(), EVENT_APPLY, execute_event(), FLAG_APPLIED, FLAG_UNPAID, METHOD_OK, METHOD_SILENT_ERROR, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, ob_apply(), play_sound_player_only(), PLAYER, QUERY_FLAG, SCRIPT_FIX_ALL, and SOUND_TYPE_ITEM.

Referenced by cfapi_object_apply(), give_initial_items(), monster_apply_below(), monster_check_apply(), player_apply(), 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:

void map_info ( object *  op,
char *  search 
)

This is the 'maps' command.

Parameters:
opplayer requesting the information.
searchoptional substring to search for.

Definition at line 55 of file c_misc.c.

References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FALSE, first_map, get_language(), I18N_MSG_CMISC_000, I18N_MSG_CMISC_001, I18N_MSG_CMISC_002, I18N_MSG_CMISC_003, I18N_MSG_CMISC_004, i18n_translate(), mapdef::in_memory, MAP_WHEN_RESET, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapdef::next, mapdef::path, mapdef::players, players_on_map(), seconds(), and mapdef::timeout.

Referenced by command_maps().

Here is the call graph for this function:

Here is the caller graph for this function:

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. thomas@astro.psu.edu
Parameters:
pllivng meditating, should be a player.
skillmeditation skill.

Definition at line 1390 of file skills.c.

References ARMOUR, BOOTS, draw_ext_info(), FLAG_APPLIED, FLAG_READY_WEAPON, GLOVES, HELMET, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, NDI_UNIQUE, PLAYER, QUERY_FLAG, and SHIELD.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 207 of file spell_util.c.

References MAX.

Referenced by cast_spell(), SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Here is the caller graph for this function:

void monster_check_apply ( object *  mon,
object *  item 
)
int mood_change ( object *  op,
object *  caster,
object *  spell 
)

This covers the various spells that change the moods of monsters - makes them angry, peacful, friendly, etc.

Parameters:
opwho is casting.
casterwhat object is casting.
spellspell object to cast.
Returns:
1.

Definition at line 1014 of file spell_attack.c.

References add_friendly_object(), arch_to_object(), caster_level(), CLEAR_FLAG, determine_god(), did_make_save(), find_god(), FLAG_BERSERK, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_ATTACK, FLAG_SLEEP, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, get_map_flags(), GET_MAP_OB, insert_ob_in_map(), MIN, NROFATTACKS, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, PREFER_LOW, QUERY_FLAG, random_roll(), remove_friendly_object(), SET_FLAG, set_owner(), set_spell_skill(), share_exp(), SK_EXP_ADD_SKILL, and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 192 of file disease.c.

References check_infection(), do_symptoms(), FLAG_WIZ, free_object(), grant_immunity(), is_susceptible_to_disease(), QUERY_FLAG, remove_ob(), and remove_symptoms().

Referenced by legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

void move_firewall ( object *  op)

Move for FIREWALL.

firewalls fire other spells. The direction of the wall is stored in op->stats.sp. walls can have hp, so they can be torn down.

Parameters:
opfirewall.

Definition at line 188 of file standalone.c.

References cast_spell(), llevError, LOG(), and rndm().

Referenced by legacy_ob_process(), and trigger_connected().

Here is the call graph for this function:

Here is the caller graph for this function:

void move_golem ( object *  op)

Handles a golem's movement.

Updated this to allow more than the golem 'head' to attack.

Parameters:
opgolem to be moved.

Definition at line 541 of file pets.c.

References attack_ob(), draw_ext_info(), draw_ext_info_format(), FLAG_ALIVE, FLAG_MONSTER, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), llevDebug, LOG(), move_ob(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, NDI_UNIQUE, P_OUT_OF_MAP, QUERY_FLAG, range_golem, remove_friendly_object(), remove_ob(), and update_object().

Referenced by legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

int move_monster ( object *  op)
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 72 of file move.c.

References blocked_link(), check_doors(), check_earthwalls(), pl::do_los, esrv_map_scroll(), FLAG_REMOVED, FLAG_WIZPASS, freearr_x, freearr_y, get_map_flags(), get_map_from_coord(), insert_ob_in_map(), llevDebug, llevError, LOG(), move_ob(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, remove_ob(), and TRANSPORT.

Referenced by cfapi_object_move(), flee_player(), move_golem(), move_ob(), move_object(), move_player_attack(), move_to(), pet_move(), and recursive_roll().

Here is the call graph for this function:

Here is the caller graph for this function:

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 53 of file move.c.

References move_ob().

Referenced by check_spell_knockback(), circ1_move(), circ2_move(), move_monster(), move_player_mover(), move_randomly(), pace2_moveh(), pace2_movev(), pace_moveh(), pace_movev(), push_ob(), and rand_move().

Here is the call graph for this function:

Here is the caller graph for this function:

int move_player ( object *  op,
int  dir 
)

Player gave us a direction, check whether to move or fire.

Parameters:
opplayer.
dirdirection to move/fire.
Returns:
0.

Definition at line 2741 of file player.c.

References absdir(), animate_object(), check_pick(), do_hidden_move(), fire(), FLAG_CONFUSED, llevError, LOG(), MAP_IN_MEMORY, move_player_attack(), QUERY_FLAG, and turn_transport().

Referenced by cfapi_object_move(), command_fire(), command_run(), handle_newcs_player(), move_internal(), move_player_mover(), and pray_at_altar().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2419 of file player.c.

References action_makes_visible(), DOOR, draw_ext_info(), FLAG_ALIVE, FLAG_CAN_ROLL, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_map_from_coord(), GET_MAP_OB, get_owner(), LOCKED_DOOR, make_visible(), mon, move_ob(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_NOATTACK, op_on_battleground(), out_of_map(), OUT_OF_REAL_MAP, play_sound_map(), PLAYER, player_attack_door(), push_ob(), QUERY_FLAG, recursive_roll(), skill_attack(), and SOUND_TYPE_LIVING.

Referenced by move_player().

Here is the call graph for this function:

Here is the caller graph for this function:

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 639 of file time.c.

References FABS, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, llevError, LOG(), move_object(), move_player(), P_OUT_OF_MAP, mapdef::path, PLAYER, PLAYERMOVER, QUERY_FLAG, remove_ob(), rndm(), and should_director_abort().

Referenced by legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

void move_symptom ( object *  symptom)

Make the symptom do the nasty things it does.

Parameters:
symptomsymptom to move.

Definition at line 615 of file disease.c.

References arch_to_object(), draw_ext_info(), FLAG_FREED, FREE_AND_COPY, free_object(), hit_player(), insert_ob_in_map(), llevError, LOG(), MAX, MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_RED, NDI_UNIQUE, QUERY_FLAG, remove_ob(), and snprintf().

Referenced by legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

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 626 of file move.c.

References compute_path(), GET_MAP_FLAGS, GET_MAP_OB, move_ob(), and P_OUT_OF_MAP.

Referenced by cfapi_object_transfer().

Here is the call graph for this function:

Here is the caller graph for this function:

void npc_call_help ( object *  op)

Definition at line 1632 of file monster.c.

References FLAG_ALIVE, FLAG_UNAGGRESSIVE, get_map_flags(), GET_MAP_OB, P_IS_ALIVE, P_OUT_OF_MAP, and QUERY_FLAG.

Referenced by alchemy_failure_effect(), attack_ob_simple(), attempt_steal(), and hit_player().

Here is the call graph for this function:

Here is the caller graph for this function:

void 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 1933 of file monster.c.

References ext_info_map(), HUGE_BUF, MAX_BUF, MSG_TYPE_DIALOG, MSG_TYPE_DIALOG_NPC, NDI_NAVY, NDI_UNIQUE, query_name(), and snprintf().

Referenced by cfapi_object_say(), and do_talk_npc().

Here is the call graph for this function:

Here is the caller graph for this function:

void obsolete_parties ( void  )

Remove unused parties (no players), this could be made to scale a lot better.

Definition at line 165 of file c_party.c.

References first_player, party_struct::next, pl::next, pl::party, and remove_party().

Referenced by do_specials(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

int ok_to_put_more ( mapstruct m,
sint16  x,
sint16  y,
object *  op,
uint32  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 555 of file spell_util.c.

References ARROW, AT_COUNTERSPELL, AT_MAGIC, BOW, FLAG_MONSTER, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, GOLEM, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, Statistics::spell_suppressions, statistics, and WEAPON.

Referenced by explosion(), and move_cone().

Here is the call graph for this function:

Here is the caller graph for this function:

int onoff_value ( const char *  line)

Utility function to convert a reply to a yes/no or on/off value.

Parameters:
linestring to check.
Return values:
1line is one of on y k s d.
0other value.

Definition at line 2026 of file c_misc.c.

Referenced by command_brace(), command_wizcast(), and command_wizpass().

Here is the caller graph for this function:

int op_on_battleground ( object *  op,
int *  x,
int *  y,
archetype **  trophy 
)

Checks if the given object op (usually a player) is standing on a valid battleground-tile.

Function returns TRUE/FALSE. If true x, y returns the battleground -exit-coord. (and if x, y not NULL)

19 March 2005 - josh@woosworld.net modifed to check if the battleground also has slaying, maxhp, and maxsp set and if those are all set and the player has a marker that matches the slaying send them to a different x, y Default is to do the same as before, so only people wanting to have different points need worry about this

28 July 2008 - Modified to allow other archetypes than fingers as trophies. If other_arch is specified in the battleground floor, then that archetype will be used instead of the default ("finger"). -R.Q.

Parameters:
opobject to check.
[out]x
[out]yif not null and if on battleground (return 1), will contain the exit coordinates for the battleground.
[out]trophyif not null and if on battleground (return 1), will contain a pointer to the archetype that can be collected by the winner
Returns:
1 if op is on battleground, 0 else.

Definition at line 4002 of file player.c.

References BATTLEGROUND, EXIT_ALT_X, EXIT_ALT_Y, EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FLAG_IS_FLOOR, FLAG_NO_PICK, FORCE, and QUERY_FLAG.

Referenced by hit_with_one_attacktype(), infect_object(), kill_object(), kill_player(), move_player_attack(), should_arena_attack(), and spell_find_dir().

Here is the call graph for this function:

Here is the caller graph for this function:

void paralyze_living ( object *  op,
object *  hitter,
int  dam 
)

Paralyze a living thing.

Parameters:
opvictim.
hitterwho is attacking.
damdamage to deal.

Definition at line 2324 of file attack.c.

References ATNR_PARALYZE, and FABS.

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

Here is the caller graph for this function:

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 corriders.
  • 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 556 of file player.c.

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(), MAX, MAX_SPACES, MOVE_ALL, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, and P_OUT_OF_MAP.

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:

int pay_for_amount ( uint64  to_pay,
object *  pl 
)

Takes the amount of money from the the player inventory and from it's various pouches using the pay_from_container() function.

Parameters:
to_payamount to pay.
plplayer paying.
Returns:
0 if not enough money, in which case nothing is removed, 1 if money was removed.
Todo:
check if pl is a player, as query_money() expects that. Check if fix_object() call is required.

Definition at line 613 of file shop.c.

References CONTAINER, fix_object(), FLAG_APPLIED, llevError, LOG(), pay_from_container(), QUERY_FLAG, and query_money().

Referenced by cfapi_object_pay_amount().

Here is the call graph for this function:

Here is the caller graph for this function:

int pay_for_item ( object *  op,
object *  pl 
)

DAMN: This is now a wrapper for pay_from_container, which is called for the player, then for each active container that can hold money until op is paid for.

Change will be left wherever the last of the price was paid from.

Parameters:
opobject to buy.
plplayer buying.
Returns:
1 if object was bought, 0 else.
Todo:
check if pl is a player, as query_money() expects a player.

Definition at line 652 of file shop.c.

References change_exp(), CONTAINER, F_BUY, F_NO_BARGAIN, F_SHOP, FALSE, fix_object(), FLAG_APPLIED, FLAG_WAS_WIZ, llevError, LOG(), pay_from_container(), query_cost(), QUERY_FLAG, query_money(), Settings::real_wiz, SET_FLAG, settings, and SK_EXP_NONE.

Referenced by cfapi_object_pay_item(), and get_payment().

Here is the call graph for this function:

Here is the caller graph for this function:

int perceive_self ( object *  op)

Living thing wants to know information.

Parameters:
opwho wants information.
Returns:
1.

Definition at line 1031 of file spell_effect.c.

References change_resist_msg, describe_item(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_archetype(), find_god(), FORCE, get_attr_value(), is_dragon_pl(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PERCEIVE_SELF, NDI_UNIQUE, NUM_STATS, present_arch_in_ob(), snprintf(), statname, and VERY_BIG_BUF.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

void pet_move ( object *  ob)
int pick_lock ( object *  pl,
int  dir,
object *  skill 
)

Lock pick handling.

Implementation by bt. (thomas@astro.psu.edu) 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 400 of file skills.c.

References attempt_pick_lock(), calc_skill_exp(), DOOR, draw_ext_info(), freearr_x, freearr_y, GET_MAP_OB, LOCKED_DOOR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, and out_of_map().

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 462 of file c_object.c.

References can_pick(), CONTAINER, draw_ext_info(), draw_ext_info_format(), FLAG_APPLIED, FLAG_STARTEQUIP, insert_ob_in_map(), llevDebug, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pick_up_object(), PLAYER, QUERY_FLAG, sack_can_hold(), and stop_item().

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:

void play_again ( object *  op)

Ask the player whether to play again or disconnect.

Parameters:
opplayer.

Definition at line 810 of file player.c.

References CS_QUERY_SINGLECHAR, FLAG_REMOVED, QUERY_FLAG, remove_ob(), send_query(), and ST_PLAY_AGAIN.

Referenced by apply_savebed(), command_shutdown(), key_change_class(), key_confirm_quit(), key_roll_stat(), kill_player(), and receive_play_again().

Here is the call graph for this function:

Here is the caller graph for this function:

int player_apply ( object *  pl,
object *  op,
int  aflag,
int  quiet 
)

Living thing is applying an object.

Parameters:
pl::object causing op to be applied.
op::object 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 player_apply_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 557 of file apply.c.

References apply_anim_suffix(), draw_ext_info(), draw_ext_info_format(), FLAG_WAS_WIZ, FLAG_WIZ, free_object(), manual_apply(), MAX_BUF, METHOD_ERROR, METHOD_OK, METHOD_SILENT_ERROR, METHOD_UNHANDLED, MOVE_FLYING, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, play_sound_map(), PLAYER, QUERY_FLAG, query_name(), remove_ob(), and SOUND_TYPE_ITEM.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void player_apply_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 619 of file apply.c.

References FLAG_IS_FLOOR, METHOD_OK, ob_apply(), player_apply(), QUERY_FLAG, and TRANSPORT.

Referenced by cfapi_object_apply_below(), and command_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3906 of file player.c.

References rv_vector::distance_x, rv_vector::distance_y, FABS, get_rangevector(), llevError, LOG(), and PLAYER.

Referenced by can_see_enemy().

Here is the call graph for this function:

Here is the caller graph for this function:

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 4221 of file player.c.

References range_none, range_size, pl::ranges, and pl::shoottype.

Referenced by become_follower(), check_special_prayers(), and do_forget_spell().

Here is the caller graph for this function:

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 230 of file player.c.

Referenced by check_name().

Here is the caller graph for this function:

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 287 of file swap.c.

References first_player, FLAG_REMOVED, pl::hidden, pl::next, pl::ob, and QUERY_FLAG.

Referenced by flush_old_maps(), and map_info().

Here is the caller graph for this function:

void plugins_display_list ( object *  op)

Definition at line 622 of file plugins.c.

References draw_ext_info(), draw_ext_info_format(), _crossfire_plugin::fullname, _crossfire_plugin::id, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, and _crossfire_plugin::next.

Referenced by command_listplugins().

Here is the call graph for this function:

Here is the caller graph for this function:

crossfire_plugin* plugins_find_plugin ( const char *  id)

Definition at line 604 of file plugins.c.

References _crossfire_plugin::id, and _crossfire_plugin::next.

Referenced by cfapi_system_register_global_event(), cfapi_system_unregister_global_event(), and execute_event().

Here is the caller graph for this function:

int plugins_init_plugin ( const char *  libfile)
int plugins_remove_plugin ( const char *  id)
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 399 of file spell_effect.c.

References FABS, FLAG_ALIVE, FLAG_ANIMATE, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_PICK, PLAYER, polymorph_item(), polymorph_living(), polymorph_melt(), QUERY_FLAG, rndm(), and TREASURE.

Referenced by cast_polymorph().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1341 of file skills.c.

References draw_ext_info(), HOLY_ALTAR, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, PLAYER, pray_at_altar(), and snprintf().

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 325 of file gods.c.

References absdir(), become_follower(), cast_magic_storm(), change_exp(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), EVENT_APPLY, execute_event(), find_god(), god_intervention(), LOOSE_MANA, MAX, move_player(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, NDI_NAVY, NDI_UNIQUE, PREFER_LOW, random_roll(), random_roll64(), SCRIPT_FIX_ALL, and SK_SUBTRACT_SKILL_EXP.

Referenced by pray().

Here is the call graph for this function:

Here is the caller graph for this function:

int probe ( object *  op,
object *  caster,
object *  spell_ob,
int  dir 
)

Try to get information about a living thing.

Parameters:
opwho is casting.
casterwhat is casting.
spell_obspell object being cast.
dircast direction.
Return values:
0nothing probed.
1something was probed.

Definition at line 715 of file spell_effect.c.

References draw_ext_info(), examine_monster(), FLAG_ALIVE, FLAG_MONSTER, FLAG_WIZCAST, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

void process_events ( void  )

Process all active objects.

Definition at line 1026 of file server.c.

References active_objects, animate_object(), Settings::casting_time, dump_object(), FABS, FLAG_FREED, FLAG_REMOVED, free_object(), llevError, LOG(), MAP, MAP_IN_MEMORY, MONSTER, PLAYER, process_object(), process_players1(), process_players2(), QUERY_FLAG, settings, stringbuffer_finish(), stringbuffer_new(), TRUE, and update_ob_speed().

Referenced by server_main(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

int process_object ( object *  op)

Main object move function.

Parameters:
opobject to move.
Returns:
0 if object didn't move, 1 else?
Todo:
remove unused return value?

Definition at line 724 of file time.c.

References animate_object(), change_object(), EVENT_TIME, execute_event(), FLAG_ANIMATE, FLAG_APPLIED, FLAG_CHANGING, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_IS_A_TEMPLATE, FLAG_IS_USED_UP, FLAG_MONSTER, FLAG_SEE_ANYWHERE, free_object(), generate_monster(), make_sure_not_seen(), make_sure_seen(), METHOD_OK, move_monster(), ob_process(), PLAYER, QUERY_FLAG, remove_force(), remove_ob(), and SCRIPT_FIX_NOTHING.

Referenced by attack_ob_simple(), and process_events().

Here is the call graph for this function:

Here is the caller graph for this function:

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 492 of file move.c.

References CLEAR_FLAG, draw_ext_info_format(), esrv_map_scroll(), FLAG_FRIENDLY, FLAG_NEUTRAL, FLAG_SLEEP, FLAG_STAND_STILL, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_owner(), insert_ob_in_map(), move_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_PUSHED, NDI_UNIQUE, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), and remove_ob().

Referenced by move_player_attack().

Here is the call graph for this function:

Here is the caller graph for this function:

void put_object_in_sack ( object *  op,
object *  sack,
object *  tmp,
uint32  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 700 of file c_object.c.

References AP_NO_MERGE, AP_UNAPPLY, apply_special(), CLEAR_FLAG, CONTAINER, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_STARTEQUIP, get_split_ob(), insert_ob_in_map_at(), insert_ob_in_ob(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, PLAYER, put_object_in_sack(), QUERY_FLAG, query_name(), remove_ob(), sack_can_hold(), set_object_face_main(), TRANSPORT, transport_can_hold(), and UPD_WEIGHT.

Referenced by drop(), esrv_move_object(), put_object_in_sack(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64 query_cost ( const object *  tmp,
object *  who,
int  flag 
)

Return the price of an item for a character.

Price will vary based on the shop's specialization ration, the player's approval rate, ...

Added F_TRUE flag to define.h to mean that the price should not be adjusted by players charisma. With F_TRUE, it returns the amount that the item is worth, if it was sold, but unadjusted by charisma. This is needed for alchemy, to to determine what value of gold nuggets should be given (the gold nuggets, when sold, will have the adjustment by charisma done at that time). NULL could have been passed as the who parameter, but then the adjustment for expensive items (>10000) would not be done.

Added F_APPROX flag, which means that the price returned should be wrong by an amount related to the player's bargaining skill.

Added F_SHOP flag to mean that the specialisation of the shop on the player's current map should be taken into account when determining the price. Shops that specialise in what is being traded will give better prices than those that do not.

CF 0.91.4 - This function got changed around a bit. Now the number of object is multiplied by the value early on. This fixes problems with items worth very little. What happened before is that various divisions took place, the value got rounded to 0 (Being an int), and thus remained 0.

Mark Wedel (mwedel@pyramid.com)

Parameters:
tmpobject we're querying the price of.
whowho is inquiring. Can be NULL, only meaningful if player.
flagcombination of F_xxx flags.
Returns:

Definition at line 121 of file shop.c.

References cha_bonus, F_APPROX, F_BUY, F_IDENTIFIED, F_NO_BARGAIN, F_NOT_CURSED, F_SELL, F_SHOP, F_TRUE, find_skill_by_number(), FLAG_BEEN_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_PLAYER_SOLD, GEM, get_ob_key_value(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, llevDebug, llevError, LOG(), Settings::max_level, MIN, MONEY, need_identify(), PLAYER, POTION, QUERY_FLAG, settings, shop_greed(), shop_specialisation_ratio(), shopkeeper_approval(), SK_BARGAINING, value_limit(), and WAND.

Referenced by alchemy(), alchemy_object(), attempt_do_alchemy(), cfapi_object_query_cost(), check_pick(), count_unpaid(), get_payment(), pay_for_item(), query_cost_string(), and sell_item().

Here is the call graph for this function:

Here is the caller graph for this function:

StringBuffer* query_cost_string ( const object *  tmp,
object *  who,
int  flag,
StringBuffer buf 
)

Finds the price of an item.

Price will be either an approximate value or the real value.

Parameters:
tmpobject to get the price of.
whowho is getting the price.
flagcombination of F_xxx values.
bufbuffer to append to. If NULL, a newly allocated one will be used and returned.
Returns:
buffer containing the price, new if buf was NULL.

Definition at line 511 of file shop.c.

References cost_string_from_value(), F_APPROX, find_next_coin(), find_skill_by_number(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, LARGEST_COIN_GIVEN, MONEY, query_cost(), real_money_value(), SK_BARGAINING, stringbuffer_append_printf(), stringbuffer_append_string(), and stringbuffer_new().

Referenced by examine(), get_payment(), pick_up_object(), and sell_item().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64 query_money ( const object *  op)

Finds out how much money the player is carrying, including what is in containers.

Parameters:
opitem to get money for. Must be a player or a container.
Returns:
total money the player is carrying.

Definition at line 581 of file shop.c.

References CONTAINER, FLAG_APPLIED, llevError, LOG(), MONEY, PLAYER, QUERY_FLAG, and query_money().

Referenced by can_pay(), cfapi_object_query_money(), get_payment(), pay_for_amount(), pay_for_item(), and query_money().

Here is the call graph for this function:

Here is the caller graph for this function:

void read_map_log ( void  )

Reads temporary maps information from disk.

Will LOG() in case of error.

Definition at line 83 of file swap.c.

References mapdef::darkness, mapdef::difficulty, get_linked_map(), mapdef::in_memory, llevDebug, Settings::localdir, LOG(), MAP_MAXRESET, MAP_SWAPPED, MAX_BUF, mapdef::path, mapdef::reset_time, seconds(), settings, snprintf(), strdup_local(), mapdef::timeout, and mapdef::tmpname.

Referenced by init().

Here is the call graph for this function:

Here is the caller graph for this function:

void receive_party_password ( object *  op)

Player entered a party password.

Parameters:
opplayer.

Definition at line 248 of file c_party.c.

References confirm_party_password(), draw_ext_info(), draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, party_struct::partyname, send_party_message(), snprintf(), and ST_PLAYING.

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void receive_play_again ( object *  op,
char  key 
)

Player replied to play again / disconnect.

Parameters:
opplayer.
keyreceived choice.

Definition at line 839 of file player.c.

References add_friendly_object(), add_refcount(), add_string(), draw_ext_info(), FREE_AND_CLEAR_STR, free_object(), get_name(), get_player(), leave(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, NDI_UNIQUE, pl::ob, play_again(), remove_friendly_object(), and set_first_map().

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void receive_player_name ( object *  op)

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.

Definition at line 2142 of file c_misc.c.

References check_name(), draw_ext_info(), FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void receive_player_password ( object *  op)
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 90 of file spell_effect.c.

References create_archetype(), draw_ext_info(), draw_ext_info_format(), find_marked_object(), FLAG_ANIMATE, free_object(), insert_ob_in_map(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, play_sound_map(), PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), remove_ob(), SET_FLAG, SOUND_TYPE_ITEM, SP_level_dam_adjust(), update_ob_speed(), and WAND.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 340 of file move.c.

References draw_ext_info_format(), MAX_BUF, move_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, 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:

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 490 of file spell_util.c.

References FLAG_ALIVE, FLAG_REFL_SPELL, GET_MAP_OB, 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:

void regenerate_rod ( object *  rod)

Regenerates a rod's charges.

Parameters:
rodrod to regenerate.

Definition at line 728 of file spell_util.c.

Referenced by legacy_ob_process().

Here is the caller graph for this function:

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 45 of file ob_types.c.

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_duplicator(), init_type_exit(), init_type_food(), init_type_gate(), init_type_hole(), init_type_identify_altar(), init_type_lamp(), init_type_lighter(), init_type_marker(), 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:

void remove_all_pets ( void  )

This function checks all pets so they try to follow their master around the world.

Unfortunately, sometimes, the owner of a pet is in the process of entering a new map when this is called. Thus the map isn't loaded yet, and we have to remove the pet...

Definition at line 273 of file pets.c.

References FABS, first_friendly_object, FLAG_FRIENDLY, FLAG_REMOVED, follow_owner(), free_object(), get_owner(), llevMonster, LOG(), MIN_ACTIVE_SPEED, on_same_map(), PLAYER, QUERY_FLAG, and remove_friendly_object().

Referenced by enter_map(), and swap_map().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2317 of file spell_effect.c.

References caster_level(), CLEAR_FLAG, draw_ext_info(), esrv_update_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, and UPD_FLAGS.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 51 of file time.c.

References arch_to_object(), DOOR, free_object(), freearr_x, freearr_y, insert_ob_in_map(), present(), remove_ob(), and update_ob_speed().

Referenced by attempt_pick_lock(), and legacy_ob_process().

Here is the call graph for this function:

Here is the caller graph for this function:

void remove_locked_door ( object *  op)

Same as remove_door() but for locked doors.

Parameters:
opdoor to remove.

Definition at line 80 of file time.c.

References arch_to_object(), free_object(), freearr_x, freearr_y, insert_ob_in_map(), LOCKED_DOOR, present(), remove_ob(), and update_ob_speed().

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:

void remove_party ( partylist target_party)

Remove and free party.

Parameters:
target_partyparty to remove.
Todo:
clean/simplify the mess.

Definition at line 106 of file c_party.c.

References first_player, llevError, LOG(), party_struct::next, pl::next, pl::party, party_struct::partyleader, and party_struct::partyname.

Referenced by command_party(), obsolete_parties(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1272 of file skills.c.

References calc_skill_exp(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, TRAP, trap_disarm(), and trap_show().

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2943 of file player.c.

References FLAG_UNPAID, free_object(), insert_ob_in_map(), QUERY_FLAG, remove_ob(), and remove_unpaid_objects().

Referenced by check_login(), kill_player(), and remove_unpaid_objects().

Here is the call graph for this function:

Here is the caller graph for this function:

void roll_again ( object *  op)

Ask the player what to do with the statistics.

Parameters:
opplayer.

Definition at line 1006 of file player.c.

References CS_QUERY_SINGLECHAR, esrv_new_player(), and send_query().

Referenced by receive_player_password().

Here is the call graph for this function:

Here is the caller graph for this function:

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 908 of file player.c.

Referenced by roll_stats().

Here is the caller graph for this function:

void roll_stats ( object *  op)

Roll the initial player's statistics.

Parameters:
opplayer to roll for.

Definition at line 932 of file player.c.

References fix_object(), and roll_stat().

Referenced by get_player(), and key_roll_stat().

Here is the call graph for this function:

Here is the caller graph for this function:

int sack_can_hold ( const object *  pl,
const object *  sack,
const object *  op,
uint32  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 282 of file c_object.c.

References CONTAINER, draw_ext_info_format(), FLAG_APPLIED, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, query_name(), and SPECIAL_KEY.

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:

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 223 of file login.c.

References pl::bed_x, pl::bed_y, pl::bowtype, liv::Cha, CLEAR_FLAG, liv::Con, copy_file(), destroy_object(), liv::Dex, pl::digestion, draw_ext_info(), draw_ext_info_format(), Settings::emergency_mapname, esrv_send_inventory(), pl::explore, FLAG_NO_FIX_PLAYER, FLAG_WIZ, pl::gen_grace, pl::gen_hp, pl::gen_sp, liv::Int, key_inventory, keyrings, pl::language, pl::last_level, pl::levgrace, pl::levhp, pl::levsp, pl::listening, llevDebug, Settings::localdir, LOG(), make_path_to_file(), MAX_BUF, MIN, pl::mode, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, pl::name_changed, NDI_ALL_DMS, NDI_RED, NDI_UNIQUE, pl::no_shout, pl::orig_stats, pl::outputs_count, pl::outputs_sync, pl::own_title, pl::party, party_struct::partyname, party_struct::passwd, pl::password, pl::peaceful, pl::petmode, PLAYER, Settings::playerdir, liv::Pow, QUERY_FLAG, range_none, pl::rejoin_party, SAVE_ERROR_OK, SAVE_FLAG_NO_REMOVE, SAVE_FLAG_SAVE_UNPAID, SAVE_MODE, save_object(), pl::savebed_map, SET_FLAG, Settings::set_title, settings, pl::shoottype, snprintf(), ST_GET_PARTY_PASSWORD, ST_PLAYING, pl::state, liv::Str, tempnam_secure(), terminate_all_pets(), Settings::tmpdir, TRUE, pl::unapply, unapply_never, unapply_nochoice, unlink, pl::usekeys, pl::weapon_sp, and liv::Wis.

Referenced by apply_savebed(), check_login(), command_kick(), command_save(), command_shutdown(), do_server(), drop_object(), emergency_save(), enter_exit(), kill_player(), player_changer_type_process(), and process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

void save_throw_object ( object *  op,
uint32  type,
object *  originator 
)

Object is attacked with some attacktype (fire, ice, ...).

Calls did_make_save_item(). It then performs the appropriate actions to the item (such as burning the item up, calling cancellation(), etc.)

Parameters:
opvictim of the attack.
typeattacktype.
originatorwhat is attacking.

Definition at line 171 of file attack.c.

References arch_to_object(), AT_CANCELLATION, AT_COLD, AT_ELECTRICITY, AT_FIRE, ATNR_COLD, cancellation(), create_archetype(), decrease_ob_nr(), did_make_save_item(), find_archetype(), fix_stopped_item(), FLAG_IS_LIGHTABLE, FLAG_NO_PICK, FLAG_REMOVED, free_object(), insert_ob_in_map(), insert_ob_in_ob(), present_arch(), QUERY_FLAG, remove_ob(), replace_insert_ob_in_map(), rndm(), RUNE, spring_trap(), and stop_item().

Referenced by hit_map(), lighter_type_apply(), and spell_effect_type_move_on().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1708 of file apply.c.

References blind_living(), cast_magic_storm(), cast_wonder(), confuse_living(), create_archetype(), draw_ext_info(), free_object(), LOOSE_MANA, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, NDI_UNIQUE, paralyze_living(), PREFER_LOW, random_roll(), settings, Settings::spell_failure_effects, SPELL_WONDER, 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:

void sell_item ( object *  op,
object *  pl 
)

Player is selling an item.

Give money, print appropriate messages.

This function uses the coins[] array to know what coins are available.

Modified to fill available race: gold containers before dumping remaining coins in character's inventory.

Parameters:
opobject to sell.
plplayer. Shouldn't be NULL or non player.

Definition at line 1059 of file shop.c.

References change_exp(), coins, CONTAINER, copy_object(), draw_ext_info_format(), esrv_update_item(), F_NO_BARGAIN, F_SELL, F_SHOP, find_archetype(), FLAG_APPLIED, FLAG_PLAYER_SOLD, FLAG_UNPAID, FREE_AND_CLEAR_STR, get_object(), identify(), insert_ob_in_ob(), LARGEST_COIN_GIVEN, llevDebug, llevError, LOG(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_SELL, NDI_UNIQUE, PLAYER, query_cost(), query_cost_string(), QUERY_FLAG, query_name(), SET_FLAG, SK_EXP_NONE, stringbuffer_finish(), UPD_WEIGHT, and weight_limit.

Referenced by drop_object().

Here is the call graph for this function:

Here is the caller graph for this function:

void send_news ( const object *  op)

Send the news to a player.

Parameters:
opplayer to send to.

Definition at line 176 of file player.c.

References close_and_delete(), Settings::confdir, draw_ext_info_format(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, NDI_GREEN, NDI_UNIQUE, Settings::news, open_and_uncompress(), settings, snprintf(), 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:

void send_party_message ( object *  op,
char *  msg 
)

Send a message to all party members except the speaker.

Parameters:
opplayer talking.
msgmessage to send.

Definition at line 285 of file c_party.c.

References draw_ext_info(), first_player, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_WHITE, pl::next, and pl::ob.

Referenced by check_login(), command_party(), form_party(), and receive_party_password().

Here is the call graph for this function:

Here is the caller graph for this function:

void send_rules ( const object *  op)

Send the rules to a player.

Parameters:
opplayer to send rules to.

Definition at line 142 of file player.c.

References close_and_delete(), Settings::confdir, draw_ext_info(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_RULES, NDI_GREEN, NDI_UNIQUE, open_and_uncompress(), Settings::rules, settings, and snprintf().

Referenced by add_player(), and command_rules().

Here is the call graph for this function:

Here is the caller graph for this function:

int server_main ( int  argc,
char **  argv 
)

Server main function.

Parameters:
argclength of argv.
argvcommand-line options.
Returns:
0.

Definition at line 1399 of file server.c.

References Settings::argc, Settings::argv, bRunning, cftimer_process_timers(), check_active_maps(), cleanup(), do_server(), do_specials(), emergency_save(), EVENT_CLOCK, execute_global_event(), init(), initPlugins(), nroferrors, process_events(), settings, and sleep_delta().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

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 206 of file standalone.c.

References change_map_light(), mapdef::darkness, get_tod(), _timeofday::hour, HOURS_PER_DAY, mapdef::outdoor, _timeofday::season, and season_timechange.

Referenced by ready_map_name().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_map_timeout ( mapstruct oldmap)

Applies the map timeout.

Parameters:
oldmapmap to process.

Definition at line 77 of file standalone.c.

References MAP_MAXTIMEOUT, MAP_MINTIMEOUT, MAP_TIMEOUT, swap_map(), and mapdef::timeout.

Referenced by enter_map(), flush_old_maps(), and place_exits().

Here is the call graph for this function:

Here is the caller graph for this function:

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 160 of file apply.c.

References FALSE, find_face(), get_ob_key_value(), new_faces, and TRUE.

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:

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 105 of file spell_util.c.

References add_refcount(), and FREE_AND_CLEAR_STR.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_smite_spell(), create_aura(), create_bomb(), fire_arch_from_position(), fire_bolt(), fire_bullet(), fire_swarm(), magic_wall(), mood_change(), summon_golem(), summon_object(), and write_rune().

Here is the call graph for this function:

Here is the caller graph for this function:

double shopkeeper_approval ( const mapstruct map,
const object *  player 
)

Returns a double based on how much the shopkeeper approves of the player.

this is based on the race of the shopkeeper and that of the player.

Parameters:
mapshop to get ratio for.
playerplayer to get ratio of.
Returns:
approval ratio.

Definition at line 1243 of file shop.c.

References NEUTRAL_RATIO, and mapdef::shoprace.

Referenced by describe_shop(), query_cost(), and shop_mat_type_move_on().

Here is the caller graph for this function:

int 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 1146 of file pets.c.

References get_real_owner(), llevError, LOG(), op_on_battleground(), pet_arena, and PLAYER.

Referenced by check_enemy(), and get_pet_enemy().

Here is the call graph for this function:

Here is the caller graph for this function:

int should_director_abort ( object *  op,
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 81 of file apply.c.

Referenced by director_type_move_on(), move_player_mover(), and player_mover_type_move_on().

Here is the caller graph for this function:

void show_skills ( object *  op,
const char *  search 
)

Displays a player's skill list, and some other non skill related info (god, max weapon improvments, 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.
searchoptional string to restrict skills to show.

Definition at line 773 of file skill_util.c.

References clipped_percent(), determine_god(), draw_ext_info(), draw_ext_info_format(), level_exp(), MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_LIST, NDI_RED, NDI_UNIQUE, NUM_SKILLS, Settings::permanent_exp_ratio, settings, SKILL, and snprintf().

Referenced by command_skills().

Here is the call graph for this function:

Here is the caller graph for this function:

void shuffle_attack ( object *  op,
int  change_face 
)

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.

right now it's being used by color spray and create pool of chaos.

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.

I also fixed a bug here in that attacktype was |= - to me, that would be that it would quickly get all attacktypes, which probably wasn't the intent. MSW 2003-06-03

Parameters:
opobject to change.
change_faceif set, also changes the face, else only changes the attacktype.

Definition at line 1004 of file spell_util.c.

References AT_MAGIC, ATTACKS, Chaos_Attacks::attacktype, rndm(), and SET_ANIMATION.

Referenced by hit_map().

Here is the call graph for this function:

Here is the caller graph for this function:

int similar_direction ( int  a,
int  b 
)

Is direction a similar to direction b? Find out in this exciting function below.

Parameters:
a
bdirections to compare.
Returns:
1 if similar, 0 if not.

Definition at line 132 of file weather.c.

Referenced by player_fire_bow().

Here is the caller graph for this function:

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 1123 of file skills.c.

References calc_skill_exp(), draw_ext_info_format(), FLAG_FRIENDLY, FLAG_HITBACK, FLAG_MONSTER, FLAG_NO_STEAL, FLAG_SPLITTING, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, MAX_BUF, MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, and SIZEOFFREE.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

int 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 thomas@astro.psu.edu

Parameters:
tmpvictim. Can be NULL.
plwho is attacking.
dirdirection to attack.
stringdescribes the damage ("claw", "punch", ...).
skillattack skill.
Returns:
0 if no attack, non zero if an attack was done.

Definition at line 1126 of file skill_util.c.

References do_skill_attack(), draw_ext_info(), FLAG_ALIVE, FLAG_CAN_ROLL, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, LOCKED_DOOR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, and QUERY_FLAG.

Referenced by attack_hth(), attack_melee_weapon(), attempt_jump(), move_monster(), and move_player_attack().

Here is the call graph for this function:

Here is the caller graph for this function:

int skill_ident ( object *  pl,
object *  skill 
)

Main identification skill handling.

Parameters:
plplayer identifying.
skillidentification skill.
Returns:
experience gained for identification.

Definition at line 872 of file skills.c.

References AMULET, ARMOUR, ARROW, BOOK, BOOTS, BOW, BRACERS, CLOAK, CONTAINER, do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), draw_ext_info(), DRINK, FLESH, FOOD, GEM, GIRDLE, GLOVES, HELMET, HORN, INORGANIC, llevError, LOG(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, PLAYER, POISON, POTION, RING, ROD, SCROLL, SHIELD, SK_ALCHEMY, SK_BOWYER, SK_DET_CURSE, SK_DET_MAGIC, SK_JEWELER, SK_LITERACY, SK_SMITHERY, SK_THAUMATURGY, SK_WOODSMAN, SPELLBOOK, WAND, and WEAPON.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

int skill_throw ( object *  op,
object *  part,
int  dir,
const char *  params,
object *  skill 
)

Throwing skill handling.

Parameters:
opobject throwing.
partactual part of op throwing.
dirdirection to throw into.
paramsoptional message, used to find object to throw.
skillthrowing skill.
Return values:
0skill use failed.
1skill was successfully used.

Definition at line 2181 of file skills.c.

References do_throw(), find_mon_throw_ob(), find_throw_ob(), and PLAYER.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 332 of file spell_util.c.

References caster_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(), fire_bullet(), magic_wall(), recharge(), summon_golem(), and summon_object().

Here is the call graph for this function:

Here is the caller graph for this function:

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 level_modifier value.

Parameters:
casterwho is casting.
spobspell we are adjusting.
Returns:
adjusted duration.

Definition at line 357 of file spell_util.c.

References caster_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_bullet(), fire_swarm(), magic_wall(), and summon_golem().

Here is the call graph for this function:

Here is the caller graph for this function:

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 level_modifier value.

Parameters:
casterwho is casting.
spobspell we are adjusting.
Returns:
adjusted range.

Definition at line 383 of file spell_util.c.

References caster_level(), and min_casting_level().

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_bomb(), dimension_door(), fire_arch_from_position(), fire_bolt(), fire_bullet(), magic_wall(), mood_change(), probe(), and summon_golem().

Here is the call graph for this function:

Here is the caller graph for this function:

sint16 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 281 of file spell_util.c.

References caster_level(), llevError, LOG(), MAX, PATH_SP_MULT, settings, SPELL_GRACE, SPELL_HIGHEST, SPELL_MANA, Settings::spellpoint_level_depend, and TRUE.

Referenced by append_spell(), cast_spell(), drain_rod_charge(), esrv_update_spells(), fire_misc_object(), monster_cast_spell(), show_matching_spells(), write_rune(), and write_scroll().

Here is the call graph for this function:

Here is the caller graph for this function:

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 182 of file spell_util.c.

References arch_to_object(), and insert_ob_in_map().

Referenced by cast_identify(), and cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1078 of file spell_util.c.

References AT_INTERNAL, cast_cone(), confuse_living(), create_archetype(), draw_ext_info(), FALSE, free_object(), get_map_flags(), hit_player(), insert_ob_in_map(), isqrt(), LOOSE_MANA, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, P_NO_MAGIC, paralyze_living(), settings, Settings::spell_failure_effects, and SPELL_WONDER.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 852 of file spell_util.c.

References can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, freedir, get_map_flags(), GET_MAP_OB, op_on_battleground(), P_BLOCKSVIEW, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, rndm(), and SIZEOFFREE.

Referenced by move_ball_spell(), and move_missile().

Here is the call graph for this function:

Here is the caller graph for this function:

void spring_trap ( object *  trap,
object *  victim 
)

This function generalizes attacks by runes/traps.

This ought to make it possible for runes to attack from the inventory, it'll spring the trap on the victim.

Parameters:
traptrap that activates.
victimvictim of the trap.

Definition at line 227 of file rune.c.

References arch_to_object(), cast_spell(), rv_vector::distance, draw_ext_info(), FLAG_ALIVE, FLAG_IS_LINKED, FLAG_IS_USED_UP, free_object(), get_rangevector(), insert_ob_in_map(), MAX, MSG_TYPE_APPLY, MSG_TYPE_APPLY_TRAP, NDI_UNIQUE, object_get_env_recursive(), PLAYER, QUERY_FLAG, remove_ob(), rune_attack(), SET_FLAG, SIGN, SPELL, trap_show(), and use_trigger().

Referenced by attempt_pick_lock(), cfapi_object_spring_trap(), common_trap_type_move_on(), hit_player(), player_attack_door(), save_throw_object(), trap_disarm(), and treasure_type_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

int stand_in_light ( object *  op)

Definition at line 2159 of file monster.c.

References get_map_flags(), GET_MAP_LIGHT, isqrt(), MAX_LIGHT_RADII, and P_OUT_OF_MAP.

Referenced by adj_attackroll(), can_see_enemy(), and check_wakeup().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3837 of file player.c.

References FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, and QUERY_FLAG.

Referenced by attempt_hide().

Here is the call graph for this function:

Here is the caller graph for this function:

void start_info ( object *  op)

Gives basic start information to player.

Parameters:
opplayer.

Definition at line 97 of file server.c.

References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, and VERSION.

Referenced by key_change_class().

Here is the call graph for this function:

Here is the caller graph for this function:

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 290 of file skills.c.

References attempt_steal(), calc_skill_exp(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, get_owner(), OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, and QUERY_FLAG.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 426 of file time.c.

References ARROW, fix_stopped_arrow(), free_no_drop(), free_object(), MIN_ACTIVE_SPEED, remove_ob(), and THROWN_OBJ.

Referenced by pick_up(), and save_throw_object().

Here is the call graph for this function:

Here is the caller graph for this function:

void store_spell_expiry ( object *  spell)

Stores in the spell when to warn player of expiration.

Parameters:
spellspell we're considering.

Definition at line 1829 of file spell_util.c.

References set_ob_key_value(), and snprintf().

Referenced by cast_change_ability(), and create_aura().

Here is the call graph for this function:

Here is the caller graph for this function:

int 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 669 of file pets.c.

References add_friendly_object(), add_string(), AT_PHYSICAL, caster_level(), determine_god(), determine_holy_arch(), draw_ext_info(), draw_ext_info_format(), FABS, find_free_spot(), find_god(), fix_summon_pet(), FLAG_FRIENDLY, FLAG_MONSTER, FREE_AND_CLEAR_STR, free_object(), free_string(), freearr_x, freearr_y, get_owner(), GOLEM, insert_ob_in_map(), llevError, LOG(), MAX, MAX_BUF, MIN, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_PET, NDI_UNIQUE, ob_blocked(), PETMOVE, PLAYER, QUERY_FLAG, range_golem, remove_ob(), SET_FLAG, set_owner(), set_spell_skill(), SIZEOFFREE1, snprintf(), SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

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 970 of file spell_util.c.

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:

int 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 929 of file pets.c.

References absdir(), add_friendly_object(), arch_to_object(), caster_level(), choose_cult_monster(), CLEAR_FLAG, create_treasure(), determine_god(), die_roll(), draw_ext_info(), draw_ext_info_format(), find_free_spot(), find_god(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_SLEEP, freearr_x, freearr_y, freedir, get_map_from_coord(), get_owner(), GT_APPLY, GT_STARTEQUIP, insert_ob_in_map(), treasurestruct::item, llevError, LOG(), mark_inventory_as_no_drop(), MIN_ACTIVE_SPEED, mon, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, treasurestruct::next, treasurestruct::nrof, ob_blocked(), PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), SET_FLAG, set_owner(), set_spell_skill(), SIZEOFFREE, and SP_level_dam_adjust().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

void swap_below_max ( const char *  except_level)

Tries to swap out maps which are still in memory, because of MAP_TIMEOUT until used objects is below MAX_OBJECTS or there are no more maps to swap.

Parameters:
except_levelpath of map to ignore for reset. Musn't be NULL.

Definition at line 253 of file swap.c.

References llevDebug, LOG(), map_least_timeout(), MAX_OBJECTS, nrofallocobjects, nroffreeobjects, mapdef::path, swap_map(), and mapdef::timeout.

Referenced by enter_map().

Here is the call graph for this function:

Here is the caller graph for this function:

int swap_map ( mapstruct map)
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 1394 of file gods.c.

References add_string(), AT_GODPOWER, AT_HOLYWORD, determine_god(), draw_ext_info(), find_god(), FREE_AND_COPY, free_object(), free_string(), get_owner(), llevError, LOG(), MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, NDI_UNIQUE, snprintf(), SPELL, and SPELL_EFFECT.

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:

int teleport ( object *  teleporter,
uint8  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 244 of file move.c.

References find_free_spot(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, insert_ob_in_map(), llevError, LOG(), map_newmap_cmd(), OB_TYPE_MOVE_BLOCK, OUT_OF_REAL_MAP, P_OUT_OF_MAP, PLAYER, remove_ob(), and SHOP_MAT.

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:

void terminate_all_pets ( object *  owner)

Removes all pets someone owns.

Parameters:
ownerplayer we wish to remove all pets of.

Definition at line 250 of file pets.c.

References first_friendly_object, FLAG_REMOVED, free_object(), get_owner(), QUERY_FLAG, remove_friendly_object(), and remove_ob().

Referenced by apply_savebed(), check_login(), command_kill_pets(), do_server(), key_confirm_quit(), and save_player().

Here is the call graph for this function:

Here is the caller graph for this function:

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 111 of file weather.c.

References dawn_to_dusk(), get_tod(), todtick, and write_todclock().

Referenced by block_until_new_connection(), and do_specials().

Here is the call graph for this function:

Here is the caller graph for this function:

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 find_free_spot() to find the destination, otherwise use find_first_free_spot().
originatorwhat is causing op to move.
Return values:
1op was destroyed.
0op was moved.

Definition at line 197 of file move.c.

References find_first_free_spot(), find_free_spot(), freearr_x, freearr_y, insert_ob_in_map(), map_newmap_cmd(), PLAYER, remove_ob(), and SIZEOFFREE.

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:

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 64 of file apply.c.

Referenced by esrv_move_object(), put_object_in_sack(), and transport_type_apply().

Here is the caller graph for this function:

void trap_adjust ( object *  trap,
int  difficulty 
)

Adjust trap difficulty to the map.

The default traps are too strong for wimpy level 1 players, and unthreatening to anyone of high level

Parameters:
traptrap to adjust.
difficultymap difficulty.

Definition at line 222 of file standalone.c.

References AT_DEATH, AT_POISON, and rndm().

Referenced by fix_generated_item().

Here is the call graph for this function:

Here is the caller graph for this function:

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 459 of file rune.c.

References destroy_object(), draw_ext_info(), draw_ext_info_format(), MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, PLAYER, PREFER_LOW, random_roll(), spring_trap(), and sqr.

Referenced by dispel_rune(), and remove_trap().

Here is the call graph for this function:

Here is the caller graph for this function:

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 403 of file rune.c.

References draw_ext_info_format(), MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, PREFER_HIGH, and random_roll().

Referenced by find_traps().

Here is the call graph for this function:

Here is the caller graph for this function:

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 431 of file rune.c.

References create_archetype(), GET_ANIMATION, insert_ob_in_map(), and new_faces.

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:

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 1006 of file alchemy.c.

References attempt_do_alchemy(), draw_ext_info_format(), esrv_send_inventory(), FLAG_APPLIED, FLAG_IS_CAULDRON, FLAG_UNPAID, GET_MAP_OB, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, NDI_UNIQUE, query_base_name(), and QUERY_FLAG.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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. (thomas@astro.psu.edu)

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 976 of file skills.c.

References add_friendly_object(), calc_skill_exp(), CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FREE_AND_COPY, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), remove_friendly_object(), SET_FLAG, and set_owner().

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

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 863 of file skill_util.c.

References do_skill(), draw_ext_info_format(), FLAG_CAN_USE_SKILL, llevDebug, LOG(), MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, QUERY_FLAG, SKILL, SKILL_TOOL, and strncasecmp().

Referenced by command_disarm(), command_search(), and command_uskill().

Here is the call graph for this function:

Here is the caller graph for this function:

int user_event ( object *  op,
object *  activator,
object *  third,
const char *  message,
int  fix 
)

Definition at line 209 of file plugins.c.

References EVENT_USER, and execute_event().

Referenced by cfapi_object_user_event().

Here is the call graph for this function:

Here is the caller graph for this function:

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 120 of file login.c.

References check_password(), close_and_delete(), llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, open_and_uncompress(), Settings::playerdir, settings, and snprintf().

Here is the call graph for this function:

void version ( object *  op)

Displays basic game version information.

Parameters:
opwho is requesting the verison information.

Definition at line 81 of file server.c.

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

Referenced by call_version(), and command_version().

Here is the call graph for this function:

Here is the caller graph for this function:

int write_mark ( object *  op,
object *  spell,
const char *  msg 
)

This writes a rune that contains the appropriate message.

There really isn't any adjustments we make.

Parameters:
opwho is casting.
spellactual spell cast.
msgmessage to write.
Return values:
0failure.
1success.

Definition at line 3257 of file spell_effect.c.

References add_string(), arch_to_object(), draw_ext_info(), HUGE_BUF, insert_ob_in_map(), llevInfo, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, and strcasestr_local().

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function:

int write_on_item ( object *  pl,
const char *  params,
object *  skill 
)

Writing skill handling.

Wrapper for write_note() and write_scroll().

Parameters:
plplayer writing.
paramsmessage to inscribe.
skillwriting skill.
Returns:
experience gained for using the skill.

Definition at line 1695 of file skills.c.

References BOOK, 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, PLAYER, QUERY_FLAG, SCROLL, SK_LITERACY, SKILL, 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:

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 66 of file rune.c.

References add_string(), arch_to_object(), blank_face, caster_level(), copy_object(), create_archetype(), draw_ext_info(), draw_ext_info_format(), freearr_x, freearr_y, GENERIC_RUNE, get_map_flags(), GET_MAP_OB, get_object(), insert_ob_in_map(), insert_ob_in_ob(), item_matched_string(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, RUNE, set_owner(), set_spell_skill(), snprintf(), SP_level_spellpoint_cost(), SPELL, SPELL_GRACE, and SPELL_MANA.

Referenced by cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function: