Crossfire Server, Branches 1.12  R18729
sproto.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void add_player (socket_struct *ns)
 
int alchemy (object *op, object *caster, object *spell_ob)
 
int animate_weapon (object *op, object *caster, object *spell, int dir)
 
void apply_builder_remove (object *pl, int dir)
 
void apply_changes_to_player (object *pl, object *change)
 
int apply_container (object *op, object *sack)
 
void apply_map_builder (object *pl, int dir)
 
int apply_special (object *who, object *op, int aflags)
 
int attack_ob (object *op, object *hitter)
 
int auto_apply (object *op)
 
void become_daemon (void)
 
void become_follower (object *op, const object *new_god)
 
void blind_living (object *op, object *hitter, int dam)
 
sint64 calc_skill_exp (object *who, object *op, object *skill)
 
int can_apply_object (object *who, object *op)
 
int can_detect_enemy (object *op, object *enemy, rv_vector *rv)
 
int can_pay (object *pl)
 
int can_see_enemy (object *op, object *enemy)
 
int cast_bless (object *op, object *caster, object *spell_ob, int dir)
 
int cast_cause_disease (object *op, object *caster, object *spell, int dir)
 
int cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent)
 
int cast_change_map_lightlevel (object *op, object *caster, object *spell)
 
int cast_cone (object *op, object *caster, int dir, object *spell)
 
int cast_consecrate (object *op, object *caster, object *spell)
 
int cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 
int cast_create_missile (object *op, object *caster, object *spell, int dir, const char *stringarg)
 
int cast_create_obj (object *op, object *new_op, int dir)
 
int cast_create_town_portal (object *op, object *caster, object *spell, int dir)
 
int cast_curse (object *op, object *caster, object *spell_ob, int dir)
 
int cast_destruction (object *op, object *caster, object *spell_ob)
 
int cast_detection (object *op, object *caster, object *spell)
 
void cast_dust (object *op, object *throw_ob, int dir)
 
int cast_earth_to_dust (object *op, object *caster, object *spell_ob)
 
int cast_heal (object *op, object *caster, object *spell, int dir)
 
int cast_identify (object *op, object *caster, object *spell)
 
int cast_invisible (object *op, object *caster, object *spell_ob)
 
int cast_item_curse_or_curse (object *op, object *caster, object *spell_ob)
 
int cast_light (object *op, object *caster, object *spell, int dir)
 
void cast_magic_storm (object *op, object *tmp, int lvl)
 
int cast_polymorph (object *op, object *caster, object *spell_ob, int dir)
 
int cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg)
 
int cast_smite_spell (object *op, object *caster, int dir, object *spell)
 
int cast_spell (object *op, object *caster, int dir, object *spell_ob, char *stringarg)
 
int cast_transfer (object *op, object *caster, object *spell, int dir)
 
int cast_wonder (object *op, object *caster, int dir, object *spell_ob)
 
int cast_word_of_recall (object *op, object *caster, object *spell_ob)
 
int caster_level (const object *caster, const object *spell)
 
void * cfapi_archetype_get_property (int *type,...)
 
void * cfapi_friendlylist_get_next (int *type,...)
 
void * cfapi_generate_random_map (int *type,...)
 
void * cfapi_get_hooks (int *type,...)
 
void * cfapi_get_month_name (int *type,...)
 
void * cfapi_get_periodofday_name (int *type,...)
 
void * cfapi_get_season_name (int *type,...)
 
void * cfapi_get_time (int *type,...)
 
void * cfapi_get_weekday_name (int *type,...)
 
void * cfapi_log (int *type,...)
 
void * cfapi_map_change_light (int *type,...)
 
void * cfapi_map_create_path (int *type,...)
 
void * cfapi_map_delete_map (int *type,...)
 
void * cfapi_map_get_map (int *type,...)
 
void * cfapi_map_get_map_property (int *type,...)
 
void * cfapi_map_get_object_at (int *type,...)
 
void * cfapi_map_has_been_loaded (int *type,...)
 
void * cfapi_map_message (int *type,...)
 
void * cfapi_map_out_of_map (int *type,...)
 
void * cfapi_map_present_arch_by_name (int *type,...)
 
void * cfapi_map_set_map_property (int *type,...)
 
void * cfapi_map_trigger_connected (int *type,...)
 
void * cfapi_map_update_position (int *type,...)
 
void * cfapi_object_apply (int *type,...)
 
void * cfapi_object_apply_below (int *type,...)
 
void * cfapi_object_cast (int *type,...)
 
void * cfapi_object_change_abil (int *type,...)
 
void * cfapi_object_change_exp (int *type,...)
 
void * cfapi_object_check_inventory (int *type,...)
 
void * cfapi_object_check_spell (int *type,...)
 
void * cfapi_object_check_trigger (int *type,...)
 
void * cfapi_object_clean_object (int *type,...)
 
void * cfapi_object_clear (int *type,...)
 
void * cfapi_object_clone (int *type,...)
 
void * cfapi_object_create (int *type,...)
 
void * cfapi_object_delete (int *type,...)
 
void * cfapi_object_describe (int *type,...)
 
void * cfapi_object_distance (int *type,...)
 
void * cfapi_object_drain (int *type,...)
 
void * cfapi_object_drop (int *type,...)
 
void * cfapi_object_find (int *type,...)
 
void * cfapi_object_find_archetype_inside (int *type,...)
 
void * cfapi_object_fix (int *type,...)
 
void * cfapi_object_forget_spell (int *type,...)
 
void * cfapi_object_get_key (int *type,...)
 
void * cfapi_object_get_property (int *type,...)
 
void * cfapi_object_give_skill (int *type,...)
 
void * cfapi_object_identify (int *type,...)
 
void * cfapi_object_insert (int *type,...)
 
void * cfapi_object_learn_spell (int *type,...)
 
void * cfapi_object_merge (int *type,...)
 
void * cfapi_object_move (int *type,...)
 
void * cfapi_object_on_same_map (int *type,...)
 
void * cfapi_object_pay_amount (int *type,...)
 
void * cfapi_object_pay_item (int *type,...)
 
void * cfapi_object_pickup (int *type,...)
 
void * cfapi_object_query_cost (int *type,...)
 
void * cfapi_object_query_money (int *type,...)
 
void * cfapi_object_remove (int *type,...)
 
void * cfapi_object_reset (int *type,...)
 
void * cfapi_object_say (int *type,...)
 
void * cfapi_object_set_key (int *type,...)
 
void * cfapi_object_set_property (int *type,...)
 
void * cfapi_object_split (int *type,...)
 
void * cfapi_object_spring_trap (int *type,...)
 
void * cfapi_object_teleport (int *type,...)
 
void * cfapi_object_transfer (int *type,...)
 
void * cfapi_object_transmute (int *type,...)
 
void * cfapi_object_update (int *type,...)
 
void * cfapi_object_user_event (int *type,...)
 
void * cfapi_party_get_property (int *type,...)
 
void * cfapi_player_can_pay (int *type,...)
 
void * cfapi_player_find (int *type,...)
 
void * cfapi_player_message (int *type,...)
 
void * cfapi_region_get_property (int *type,...)
 
void * cfapi_set_random_map_variable (int *type,...)
 
void * cfapi_system_add_string (int *type,...)
 
void * cfapi_system_check_path (int *type,...)
 
void * cfapi_system_directory (int *type,...)
 
void * cfapi_system_find_animation (int *type,...)
 
void * cfapi_system_find_face (int *type,...)
 
void * cfapi_system_find_string (int *type,...)
 
void * cfapi_system_re_cmp (int *type,...)
 
void * cfapi_system_register_global_event (int *type,...)
 
void * cfapi_system_remove_string (int *type,...)
 
void * cfapi_system_strdup_local (int *type,...)
 
void * cfapi_system_unregister_global_event (int *type,...)
 
void * cfapi_timer_create (int *type,...)
 
void * cfapi_timer_destroy (int *type,...)
 
int cftimer_create (int id, long delay, object *ob, int mode)
 
int cftimer_destroy (int id)
 
int cftimer_find_free_id (void)
 
void cftimer_init (void)
 
void cftimer_process_timers (void)
 
int change_skill (object *who, object *new_skill, int flag)
 
void change_spell (object *op, char k)
 
void check_active_maps (void)
 
void check_bullet (object *op)
 
void check_doors (object *op, mapstruct *m, int x, int y)
 
void check_earthwalls (object *op, mapstruct *m, int x, int y)
 
objectcheck_enemy (object *npc, rv_vector *rv)
 
void check_login (object *op)
 
int check_name (player *me, const char *name)
 
int check_password (char *typed, char *crypted)
 
void check_physically_infect (object *victim, object *hitter)
 
int check_pick (object *op)
 
void check_score (object *op, int quiet)
 
void check_spell_expiry (object *spell)
 
objectcheck_spell_known (object *op, const char *name)
 
void check_spells (void)
 
int check_weapon_power (const object *who, int improvs)
 
int checkbanned (const char *login, const char *host)
 
void clean_tmp_files (void)
 
void cleanup (void)
 
void cleanupPlugins (void)
 
void clear_skill (object *who)
 
int command_abil (object *op, char *params)
 
int command_accuse (object *op, char *params)
 
int command_addexp (object *op, char *params)
 
int command_afk (object *op, char *params)
 
int command_apply (object *op, char *params)
 
int command_applymode (object *op, char *params)
 
int command_archs (object *op, char *params)
 
int command_arrest (object *op, char *params)
 
int command_banish (object *op, char *params)
 
int command_beg (object *op, char *params)
 
int command_bleed (object *op, char *params)
 
int command_blush (object *op, char *params)
 
int command_body (object *op, char *params)
 
int command_bounce (object *op, char *params)
 
int command_bow (object *op, char *params)
 
int command_bowmode (object *op, char *params)
 
int command_brace (object *op, char *params)
 
int command_burp (object *op, char *params)
 
int command_cackle (object *op, char *params)
 
int command_cast (object *op, char *params)
 
int command_cast_spell (object *op, char *params, char command)
 
int command_chat (object *op, char *params)
 
int command_chuckle (object *op, char *params)
 
int command_clap (object *op, char *params)
 
int command_cointoss (object *op, char *params)
 
int command_cough (object *op, char *params)
 
int command_create (object *op, char *params)
 
int command_cringe (object *op, char *params)
 
int command_cry (object *op, char *params)
 
int command_dance (object *op, char *params)
 
int command_debug (object *op, char *params)
 
int command_diff (object *op, char *params)
 
int command_disarm (object *op, char *params)
 
int command_dm (object *op, char *params)
 
int command_dmhide (object *op, char *params)
 
int command_dmtell (object *op, char *params)
 
int command_drop (object *op, char *params)
 
int command_dropall (object *op, char *params)
 
int command_dump (object *op, char *params)
 
int command_dumpallarchetypes (object *op, char *params)
 
int command_dumpallmaps (object *op, char *params)
 
int command_dumpallobjects (object *op, char *params)
 
int command_dumpbelow (object *op, char *params)
 
int command_dumpfriendlyobjects (object *op, char *params)
 
int command_dumpmap (object *op, char *params)
 
int command_east (object *op, char *params)
 
int command_empty (object *op, char *params)
 
int command_examine (object *op, char *params)
 
int command_explore (object *op, char *params)
 
int command_fire (object *op, char *params)
 
int command_fire_stop (object *op, char *params)
 
int command_fix_me (object *op, char *params)
 
int command_flip (object *op, char *params)
 
int command_follow (object *op, char *params)
 
int command_forget_spell (object *op, char *params)
 
int command_free (object *op, char *params)
 
int command_freeze (object *op, char *params)
 
int command_frown (object *op, char *params)
 
int command_gasp (object *op, char *params)
 
int command_giggle (object *op, char *params)
 
int command_glare (object *op, char *params)
 
int command_goto (object *op, char *params)
 
int command_grin (object *op, char *params)
 
int command_groan (object *op, char *params)
 
int command_growl (object *op, char *params)
 
int command_gsay (object *op, char *params)
 
int command_help (object *op, char *params)
 
int command_hiccup (object *op, char *params)
 
int command_hide (object *op, char *params)
 
int command_hiscore (object *op, char *params)
 
int command_hug (object *op, char *params)
 
int command_insert_into (object *op, char *params)
 
int command_inventory (object *op, char *params)
 
int command_invisible (object *op, char *params)
 
int command_invoke (object *op, char *params)
 
int command_kick (object *op, const char *params)
 
int command_kill_pets (object *op, char *params)
 
int command_kiss (object *op, char *params)
 
int command_language (object *op, char *params)
 
int command_laugh (object *op, char *params)
 
int command_learn_special_prayer (object *op, char *params)
 
int command_learn_spell (object *op, char *params)
 
int command_lick (object *op, char *params)
 
int command_listen (object *op, char *params)
 
int command_listplugins (object *op, char *params)
 
int command_loadplugin (object *op, char *params)
 
int command_loadtest (object *op, char *params)
 
int command_lock_item (object *op, char *params)
 
int command_malloc (object *op, char *params)
 
int command_mapinfo (object *op, char *params)
 
int command_maps (object *op, char *params)
 
int command_mark (object *op, char *params)
 
int command_me (object *op, char *params)
 
int command_mon_aggr (object *op, char *params)
 
int command_motd (object *op, char *params)
 
int command_news (object *op, char *params)
 
int command_nod (object *op, char *params)
 
int command_north (object *op, char *params)
 
int command_northeast (object *op, char *params)
 
int command_northwest (object *op, char *params)
 
int command_nowiz (object *op, char *params)
 
int command_orcknuckle (object *op, char *params)
 
int command_output_count (object *op, char *params)
 
int command_output_sync (object *op, char *params)
 
int command_overlay_reset (object *op, char *params)
 
int command_overlay_save (object *op, char *params)
 
int command_party (object *op, char *params)
 
int command_party_rejoin (object *op, char *params)
 
int command_passwd (object *pl, char *params)
 
int command_patch (object *op, char *params)
 
int command_peaceful (object *op, char *params)
 
int command_petmode (object *op, char *params)
 
int command_pickup (object *op, char *params)
 
int command_players (object *op, char *params)
 
int command_poke (object *op, char *params)
 
int command_possess (object *op, char *params)
 
int command_pout (object *op, char *params)
 
int command_prepare (object *op, char *params)
 
int command_printlos (object *op, char *params)
 
int command_puke (object *op, char *params)
 
int command_quit (object *op, char *params)
 
int command_remove (object *op, char *params)
 
int command_rename_item (object *op, char *params)
 
int command_reply (object *op, char *params)
 
int command_reset (object *op, char *params)
 
int command_resistances (object *op, char *params)
 
int command_rotateshoottype (object *op, char *params)
 
int command_rskill (object *pl, char *params)
 
int command_rules (object *op, char *params)
 
int command_run (object *op, char *params)
 
int command_run_stop (object *op, char *params)
 
int command_save (object *op, char *params)
 
int command_say (object *op, char *params)
 
int command_scream (object *op, char *params)
 
int command_search (object *op, char *params)
 
int command_search_items (object *op, char *params)
 
int command_setgod (object *op, char *params)
 
int command_shake (object *op, char *params)
 
int command_shiver (object *op, char *params)
 
int command_shout (object *op, char *params)
 
int command_showpets (object *op, char *params)
 
int command_shrug (object *op, char *params)
 
int command_shutdown (object *op, char *params)
 
int command_sigh (object *op, char *params)
 
int command_skills (object *op, char *params)
 
int command_slap (object *op, char *params)
 
int command_smile (object *op, char *params)
 
int command_smirk (object *op, char *params)
 
int command_snap (object *op, char *params)
 
int command_sneeze (object *op, char *params)
 
int command_snicker (object *op, char *params)
 
int command_sniff (object *op, char *params)
 
int command_snore (object *op, char *params)
 
int command_sound (object *op, char *params)
 
int command_south (object *op, char *params)
 
int command_southeast (object *op, char *params)
 
int command_southwest (object *op, char *params)
 
int command_speed (object *op, char *params)
 
int command_spit (object *op, char *params)
 
int command_ssdumptable (object *op, char *params)
 
int command_stack_clear (object *op, char *params)
 
int command_stack_list (object *op, char *params)
 
int command_stack_pop (object *op, char *params)
 
int command_stack_push (object *op, char *params)
 
int command_statistics (object *pl, char *params)
 
int command_stats (object *op, char *params)
 
int command_stay (object *op, char *params)
 
int command_strings (object *op, char *params)
 
int command_strut (object *op, char *params)
 
int command_style_map_info (object *op, char *params)
 
int command_sulk (object *op, char *params)
 
int command_summon (object *op, char *params)
 
int command_take (object *op, char *params)
 
int command_teleport (object *op, char *params)
 
int command_tell (object *op, char *params)
 
int command_thank (object *op, char *params)
 
int command_think (object *op, char *params)
 
int command_throw (object *op, char *params)
 
int command_time (object *op, char *params)
 
int command_title (object *op, char *params)
 
int command_toggle_shout (object *op, char *params)
 
int command_twiddle (object *op, char *params)
 
int command_unloadplugin (object *op, char *params)
 
int command_use (object *op, char *params)
 
int command_usekeys (object *op, char *params)
 
int command_uskill (object *pl, char *params)
 
int command_version (object *op, char *params)
 
int command_wave (object *op, char *params)
 
int command_west (object *op, char *params)
 
int command_whereabouts (object *op, char *params)
 
int command_whereami (object *op, char *params)
 
int command_whistle (object *op, char *params)
 
int command_who (object *op, char *params)
 
int command_wimpy (object *op, char *params)
 
int command_wink (object *op, char *params)
 
int command_wizcast (object *op, char *params)
 
int command_wizpass (object *op, char *params)
 
int command_yawn (object *op, char *params)
 
void communicate (object *op, const char *txt)
 
int compute_path (object *source, object *target, int default_dir)
 
void cone_drop (object *op)
 
int confirm_party_password (object *op)
 
void confirm_password (object *op)
 
void confuse_living (object *op, object *hitter, int dam)
 
void control_golem (object *op, int dir)
 
int coords_in_shop (mapstruct *map, int x, int y)
 
void counterspell (object *op, int dir)
 
int create_aura (object *op, object *caster, object *spell)
 
int create_bomb (object *op, object *caster, int dir, object *spell)
 
char * crypt_string (char *str, char *salt)
 
int cure_disease (object *sufferer, object *caster)
 
void current_map_info (object *op)
 
void current_region_info (object *op)
 
void dead_player (object *op)
 
void delete_character (const char *name)
 
int describe_shop (const object *op)
 
void destroy_object (object *op)
 
const char * determine_god (object *op)
 
archetypedetermine_holy_arch (const object *god, const char *type)
 
int dimension_door (object *op, object *caster, object *spob, int dir)
 
int dispel_rune (object *op, object *caster, object *spell, object *skill, int dir)
 
void display_high_score (object *op, int max, const char *match)
 
void display_motd (const object *op)
 
void display_who_entry (object *op, player *pl, const char *format)
 
objectdm_stack_peek (player *pl)
 
void dm_stack_pop (player *pl)
 
void dm_stack_push (player *pl, tag_t item)
 
void do_forget_spell (object *op, const char *spell)
 
int do_harvest (object *pl, int dir, object *skill)
 
void do_hidden_move (object *op)
 
void do_learn_spell (object *op, object *spell, int special_prayer)
 
int do_skill (object *op, object *part, object *skill, int dir, const char *string)
 
void do_some_living (object *op)
 
int do_wizard_dm (object *op, char *params, int silent)
 
void do_wizard_hide (object *op, int silent_dm)
 
void dragon_ability_gain (object *who, int atnr, int level)
 
void drain_rod_charge (object *rod)
 
void drain_wand_charge (object *wand)
 
void drop (object *op, object *tmp)
 
objectdrop_object (object *op, object *tmp, uint32 nrof)
 
void dump_spells (void)
 
void emergency_save (int flag)
 
void enter_exit (object *op, object *exit_ob)
 
void enter_player_savebed (object *op)
 
void examine (object *op, object *tmp)
 
void examine_monster (object *op, object *tmp)
 
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)
 
void explode_bullet (object *op)
 
const objectfind_god (const char *name)
 
objectfind_key (object *pl, object *container, object *door)
 
objectfind_marked_object (object *op)
 
objectfind_mon_throw_ob (object *op)
 
objectfind_nearest_living_creature (object *npc)
 
playerfind_player (const char *plname)
 
playerfind_player_partial_name (const char *plname)
 
command_array_structfind_plugin_command (char *cmd, object *op)
 
racelinkfind_racelink (const char *name)
 
objectfind_random_spell_in_ob (object *ob, const char *skill)
 
objectfind_skill_by_name (object *who, const char *name)
 
objectfind_skill_by_number (object *who, int skillno)
 
objectfind_target_for_friendly_spell (object *op, int dir)
 
int find_traps (object *pl, object *skill)
 
void fire (object *op, int dir)
 
int fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell)
 
int fire_bolt (object *op, object *caster, int dir, object *spob, object *skill)
 
int fire_bow (object *op, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy)
 
int fire_bullet (object *op, object *caster, int dir, object *spob)
 
int fire_swarm (object *op, object *caster, object *spell, int dir)
 
void fix_auto_apply (mapstruct *m)
 
void fix_luck (void)
 
objectfix_stopped_arrow (object *op)
 
void fix_stopped_item (object *op, mapstruct *map, object *originator)
 
void fix_weight (void)
 
void flush_old_maps (void)
 
void follow_owner (object *ob, object *owner)
 
int forbid_play (void)
 
partylistform_party (object *op, const char *params)
 
int free_no_drop (object *op)
 
void free_server (void)
 
int friendly_fire (object *op, object *hitter)
 
objectget_dm_object (player *pl, char **params, int *from)
 
partylistget_firstparty (void)
 
void get_name (object *op)
 
objectget_nearest_player (object *mon)
 
void get_party_password (object *op, partylist *party)
 
void get_password (object *op)
 
int get_payment (object *pl, object *op)
 
objectget_pet_enemy (object *pet, rv_vector *rv)
 
void get_who_escape_code_value (char *return_val, int size, const char letter, player *pl)
 
void give_initial_items (object *pl, treasurelist *items)
 
void handle_apply_yield (object *tmp)
 
int handle_newcs_player (object *op)
 
int hide (object *op, object *skill)
 
int hideability (object *ob)
 
int hit_map (object *op, int dir, uint32 type, int full_hit)
 
int hit_player (object *op, int dam, object *hitter, uint32 type, int full_hit)
 
objecthit_with_arrow (object *op, object *victim)
 
int infect_object (object *victim, object *disease, int force)
 
void init (int argc, char **argv)
 
void init_commands (void)
 
void init_ob_methods (void)
 
void init_skills (void)
 
int initPlugins (void)
 
void inventory (object *op, object *inv)
 
int is_in_shop (object *ob)
 
int is_true_undead (object *op)
 
int jump (object *pl, int dir, object *skill)
 
void key_change_class (object *op, char key)
 
void key_confirm_quit (object *op, char key)
 
void key_roll_stat (object *op, char key)
 
void kill_player (object *op)
 
int learn_skill (object *pl, object *scroll)
 
void leave (player *pl, int draw_exit)
 
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)
 
void link_player_skills (object *op)
 
void list_players (object *op, region *reg, partylist *party)
 
objectlookup_spell_by_name (object *op, const char *spname)
 
int magic_wall (object *op, object *caster, int dir, object *spell_ob)
 
void make_visible (object *op)
 
int makes_invisible_to (object *pl, object *mon)
 
void malloc_info (object *op)
 
int manual_apply (object *op, object *tmp, int aflag)
 
void map_info (object *op, char *search)
 
void meditate (object *pl, object *skill)
 
int min_casting_level (const object *caster, const object *spell)
 
void monster_check_apply (object *mon, object *item)
 
int mood_change (object *op, object *caster, object *spell)
 
int move_disease (object *disease)
 
void move_firewall (object *op)
 
void move_golem (object *op)
 
int move_monster (object *op)
 
int move_ob (object *op, int dir, object *originator)
 
int move_object (object *op, int dir)
 
int move_player (object *op, int dir)
 
void move_player_attack (object *op, int dir)
 
void move_player_mover (object *op)
 
void move_symptom (object *symptom)
 
int move_to (object *op, int x, int y)
 
void npc_call_help (object *op)
 
void npc_say (object *npc, const char *cp)
 
void obsolete_parties (void)
 
int ok_to_put_more (mapstruct *m, sint16 x, sint16 y, object *op, uint32 immune_stop)
 
int onoff_value (const char *line)
 
int op_on_battleground (object *op, int *x, int *y, archetype **trophy)
 
void paralyze_living (object *op, object *hitter, int dam)
 
int path_to_player (object *mon, object *pl, unsigned mindiff)
 
int pay_for_amount (uint64 to_pay, object *pl)
 
int pay_for_item (object *op, object *pl)
 
int perceive_self (object *op)
 
void pet_move (object *ob)
 
int pick_lock (object *pl, int dir, object *skill)
 
void pick_up (object *op, object *alt)
 
void play_again (object *op)
 
int player_apply (object *pl, object *op, int aflag, int quiet)
 
void player_apply_below (object *pl)
 
int player_can_view (object *pl, object *op)
 
void player_unready_range_ob (player *pl, object *ob)
 
int playername_ok (const char *cp)
 
int players_on_map (mapstruct *m, int show_all)
 
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)
 
int pray (object *pl, object *skill)
 
void pray_at_altar (object *pl, object *altar, object *skill)
 
int probe (object *op, object *caster, object *spell_ob, int dir)
 
void process_events (void)
 
int process_object (object *op)
 
int push_ob (object *who, int dir, object *pusher)
 
void put_object_in_sack (object *op, object *sack, object *tmp, uint32 nrof)
 
uint64 query_cost (const object *tmp, object *who, int flag)
 
StringBufferquery_cost_string (const object *tmp, object *who, int flag, StringBuffer *buf)
 
uint64 query_money (const object *op)
 
void read_map_log (void)
 
void receive_party_password (object *op)
 
void receive_play_again (object *op, char key)
 
void receive_player_name (object *op)
 
void receive_player_password (object *op)
 
int recharge (object *op, object *caster, object *spell_ob)
 
void recursive_roll (object *op, int dir, object *pusher)
 
int reflwall (mapstruct *m, int x, int y, object *sp_op)
 
void regenerate_rod (object *rod)
 
void register_all_ob_types (void)
 
void remove_all_pets (void)
 
int remove_curse (object *op, object *caster, object *spell)
 
void remove_door (object *op)
 
void remove_locked_door (object *op)
 
void remove_party (partylist *target_party)
 
int remove_trap (object *op, object *skill)
 
void remove_unpaid_objects (object *op, object *env, int free_items)
 
void roll_again (object *op)
 
int roll_stat (void)
 
void roll_stats (object *op)
 
int sack_can_hold (const object *pl, const object *sack, const object *op, uint32 nrof)
 
int save_player (object *op, int flag)
 
void save_throw_object (object *op, uint32 type, object *originator)
 
void scroll_failure (object *op, int failure, int power)
 
void sell_item (object *op, object *pl)
 
void send_news (const object *op)
 
void send_party_message (object *op, char *msg)
 
void send_rules (const object *op)
 
int server_main (int argc, char **argv)
 
void set_darkness_map (mapstruct *m)
 
void set_map_timeout (mapstruct *oldmap)
 
int set_object_face_main (object *op)
 
void set_spell_skill (object *op, object *caster, object *spob, object *dest)
 
double shopkeeper_approval (const mapstruct *map, const object *player)
 
int should_arena_attack (object *pet, object *owner, object *target)
 
int should_director_abort (object *op, object *victim)
 
void show_skills (object *op, const char *search)
 
void shuffle_attack (object *op, int change_face)
 
int similar_direction (int a, int b)
 
int singing (object *pl, int dir, object *skill)
 
int skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill)
 
int skill_ident (object *pl, object *skill)
 
int skill_throw (object *op, object *part, int dir, const char *params, object *skill)
 
int SP_level_dam_adjust (const object *caster, const object *spob)
 
int SP_level_duration_adjust (const object *caster, const object *spob)
 
int SP_level_range_adjust (const object *caster, const object *spob)
 
sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags)
 
void spell_effect (object *spob, int x, int y, mapstruct *map, object *originator)
 
void spell_failure (object *op, int failure, int power, object *skill)
 
int spell_find_dir (mapstruct *m, int x, int y, object *exclude)
 
void spring_trap (object *trap, object *victim)
 
int stand_in_light (object *op)
 
int stand_near_hostile (object *who)
 
void start_info (object *op)
 
int steal (object *op, int dir, object *skill)
 
objectstop_item (object *op)
 
void store_spell_expiry (object *spell)
 
int summon_golem (object *op, object *caster, int dir, object *spob)
 
int summon_hostile_monsters (object *op, int n, const char *monstername)
 
int summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 
void swap_below_max (const char *except_level)
 
int swap_map (mapstruct *map)
 
int tailor_god_spell (object *spellop, object *caster)
 
int teleport (object *teleporter, uint8 tele_type, object *user)
 
void terminate_all_pets (object *owner)
 
void tick_the_clock (void)
 
int transfer_ob (object *op, int x, int y, int randomly, object *originator)
 
int transport_can_hold (const object *transport, const object *op, int nrof)
 
void trap_adjust (object *trap, int difficulty)
 
int trap_disarm (object *disarmer, object *trap, int risk, object *skill)
 
int trap_see (object *op, object *trap)
 
int trap_show (object *trap, object *where)
 
int use_alchemy (object *op)
 
int use_oratory (object *pl, int dir, object *skill)
 
int use_skill (object *op, const char *string)
 
int user_event (object *op, object *activator, object *third, const char *message, int fix)
 
int verify_player (const char *name, char *password)
 
void version (object *op)
 
int write_mark (object *op, object *spell, const char *msg)
 
int write_on_item (object *pl, const char *params, object *skill)
 
int write_rune (object *op, object *caster, object *spell, int dir, const char *runename)
 

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 obj::above, alchemy_object(), obj::below, obj::contr, create_archetype(), obj::duration, F_TRUE, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::inv, large_value, socket_struct::look_position, obj::map, MOVE_WALK, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, query_cost(), QUERY_FLAG, small_value, pl::socket, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::type, obj::weight, obj::x, and obj::y.

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(), obj::anim_speed, obj::animation_id, obj::arch, arch_to_object(), AT_PHYSICAL, ATNR_BLIND, ATNR_CONFUSION, ATNR_DEATH, ATNR_DEPLETE, ATNR_FEAR, ATNR_PARALYZE, ATNR_PHYSICAL, ATNR_POISON, ATNR_SLOW, ATNR_TURN_UNDEAD, obj::attacktype, caster_level(), CLEAR_FLAG, archt::clone, liv::Con, obj::contr, control_golem(), obj::count, liv::dam, liv::Dex, obj::direction, draw_ext_info(), draw_ext_info_format(), obj::duration, esrv_update_item(), liv::exp, obj::face, 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, pl::golem_count, liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::last_anim, llevError, LOG(), obj::magic, obj::map, obj::materialname, MAX, MAX_BUF, liv::maxgrace, liv::maxhp, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, archt::name, name_to_material(), NDI_BLACK, NDI_UNIQUE, obj::nrof, NROFATTACKS, obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, query_name(), obj::race, range_golem, pl::ranges, remove_ob(), obj::resist, _materialtype::save, SET_FLAG, set_owner(), set_spell_skill(), pl::shoottype, snprintf(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::speed, obj::speed_left, obj::state, obj::stats, liv::Str, obj::type, UPD_NROF, update_ob_speed(), liv::wc, WEAPON, obj::x, and obj::y.

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 obj::above, 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, obj::map, MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, archt::name, NDI_UNIQUE, mapdef::path, PEDESTAL, QUERY_FLAG, query_name(), remove_button_link(), remove_ob(), SIGN, TIMED_GATE, obj::type, WALL, obj::x, and obj::y.

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 obj::anim_speed, obj::anim_suffix, animate_object(), obj::animation_id, animations, obj::arch, obj::below, CHA, change_attr_value(), CLASS, CLEAR_FLAG, archt::clone, obj::contr, obj::face, obj::facing, FLAG_ANIMATE, FLAG_USE_WEAPON, GET_ANIM_ID, get_attr_value(), give_initial_items(), obj::inv, MAX_BUF, animations_struct::name, obj::name, NUM_STATS, pl::orig_stats, QUERY_FLAG, obj::randomitems, rndm(), set_attr_value(), SET_FLAG, snprintf(), obj::stats, try_find_animation(), and obj::type.

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, obj::container, CONTAINER, draw_ext_info_format(), obj::env, esrv_send_inventory(), esrv_send_item(), esrv_update_item(), EVENT_CLOSE, execute_event(), find_key(), FLAG_APPLIED, get_split_ob(), INS_NO_MERGE, insert_ob_in_map_at(), insert_ob_in_ob(), llevError, LOG(), obj::map, MAX_BUF, MOVE_ALL, obj::move_off, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, obj::name, NDI_UNIQUE, obj::nrof, PLAYER, QUERY_FLAG, query_name(), SCRIPT_FIX_ALL, SET_FLAG, set_object_face_main(), set_object_face_other(), obj::slaying, obj::type, UPD_FACE, UPD_FLAGS, obj::x, and obj::y.

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 obj::above, apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), obj::arch, can_build_over(), obj::contr, decrease_ob, draw_ext_info(), find_archetype(), find_marked_object(), FLAG_IS_BUILDABLE, freearr_x, freearr_y, GET_MAP_OB, llevError, LOG(), obj::map, MAP_HEIGHT, MAP_WIDTH, MATERIAL, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, archt::name, NDI_UNIQUE, object_create_arch(), mapdef::path, PLAYER, QUERY_FLAG, range_builder, pl::ranges, SET_FLAG, SIGN, obj::slaying, ST_BD_BUILD, ST_BD_REMOVE, ST_MAT_FLOOR, ST_MAT_ITEM, ST_MAT_WALL, ST_MAT_WINDOW, obj::subtype, obj::type, obj::x, and obj::y.

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(), obj::chosen_skill, CLOAK, obj::contr, draw_ext_info(), draw_ext_info_format(), obj::env, esrv_update_item(), liv::exp, 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, liv::hp, insert_ob_in_ob(), obj::invisible, pl::item_power, obj::item_power, Settings::item_power_factor, obj::last_eat, obj::level, 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, obj::name, NDI_UNIQUE, obj::nrof, Settings::personalized_blessings, PLAYER, QUERY_FLAG, query_name(), obj::race, random_roll(), range_bow, range_builder, range_misc, range_skill, pl::ranges, RING, ROD, SET_FLAG, settings, SHIELD, pl::shoottype, SKILL, obj::skill, SKILL_TOOL, obj::stats, obj::type, pl::unapply, 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(), liv::dam, obj::head, obj::stats, and liv::wc.

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 obj::below, CLEAR_FLAG, create_treasure(), mapdef::difficulty, obj::env, liv::exp, FLAG_AUTO_APPLY, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_A_TEMPLATE, FLAG_UNPAID, free_object(), generate_treasure(), GT_ENVIRONMENT, HAS_RANDOM_ITEMS, liv::hp, identify(), insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::map, MAX, QUERY_FLAG, obj::randomitems, remove_ob(), SET_FLAG, SHOP_FLOOR, obj::stats, TREASURE, obj::type, obj::x, and obj::y.

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, obj::below, BOOK, BOOTS, cast_magic_storm(), change_abil(), check_special_prayers(), CLEAR_FLAG, archt::clone, obj::contr, 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(), liv::food, FORCE, free_object(), free_string(), get_archetype_by_type_subtype(), give_skill_by_name(), GLOVES, god_gives_present(), liv::grace, HELMET, liv::hp, obj::inv, obj::invisible, treasurestruct::item, treasureliststruct::items, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, link_player_skills(), LOOSE_MANA, liv::luck, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, obj::name, NDI_NAVY, NDI_UNIQUE, treasurestruct::next, NROFATTACKS, obj::path_attuned, obj::path_denied, obj::path_repelled, player_unready_range_ob(), PREFER_LOW, present_in_ob_by_name(), QUERY_FLAG, obj::race, random_roll(), obj::randomitems, remove_ob(), obj::resist, SET_FLAG, SHIELD, SK_PRAYING, SKILL, obj::slaying, liv::sp, SPELL, SPELLBOOK, obj::stats, stop_using_item(), obj::subtype, obj::title, obj::type, 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, liv::food, get_owner(), insert_ob_in_ob(), MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, NDI_UNIQUE, obj::owner, present_in_ob(), query_name(), obj::resist, SET_FLAG, obj::speed, and obj::stats.

Referenced by hit_with_one_attacktype(), and scroll_failure().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::arch, liv::Cha, archt::clone, mapdef::difficulty, liv::exp, FLAG_ALIVE, obj::level, llevDebug, LOG(), obj::magic, obj::map, MAX, obj::name, PLAYER, QUERY_FLAG, RUNE, settings, Settings::simple_exp, SKILL, obj::stats, TRAP, and obj::type.

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 obj::below, obj::body_info, obj::body_used, 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, obj::inv, IS_ARMOR, IS_SHIELD, IS_WEAPON, NUM_BODY_LOCATIONS, PLAYER, QUERY_FLAG, RING, ROD, SHIELD, obj::type, 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 
)
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(), obj::inv, llevError, LOG(), make_list_like(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_PAYMENT, NDI_UNIQUE, NUM_COINS, PLAYER, query_money(), snprintf(), stringbuffer_finish(), and obj::type.

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 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 liv::ac, add_refcount(), add_string(), AT_PHYSICAL, ATNR_GODPOWER, obj::attacktype, obj::below, change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), obj::duration, find_god(), find_target_for_friendly_spell(), fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), insert_ob_in_ob(), obj::inv, MIN, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_SPELL_TARGET, obj::name, obj::name_pl, NDI_UNIQUE, NROFATTACKS, obj::path_attuned, obj::race, obj::resist, SET_FLAG, obj::slaying, SP_level_duration_adjust(), obj::speed, obj::speed_left, obj::stats, obj::subtype, obj::type, and liv::wc.

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 obj::above, liv::ac, ARCH_DETECT_MAGIC, arch_to_object(), caster_level(), create_archetype(), liv::dam, draw_ext_info(), draw_ext_info_format(), liv::exp, obj::facing, FLAG_MONSTER, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::head, liv::hp, infect_object(), insert_ob_in_map(), obj::last_eat, obj::last_sp, obj::level, obj::magic, obj::map, liv::maxgrace, liv::maxhp, liv::maxsp, MOVE_FLY_LOW, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, NDI_UNIQUE, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, set_owner(), set_spell_skill(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::type, liv::wc, obj::x, and obj::y.

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 liv::ac, add_refcount(), obj::attacktype, obj::below, change_abil(), CLEAR_FLAG, create_archetype(), draw_ext_info(), draw_ext_info_format(), obj::duration, liv::exp, 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(), liv::hp, insert_ob_in_ob(), obj::inv, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, obj::name_pl, NDI_UNIQUE, no_gain_msgs, NROFATTACKS, NUM_STATS, PLAYER, QUERY_FLAG, obj::race, obj::resist, rndm(), set_attr_value(), SET_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::speed, obj::speed_left, obj::stats, store_spell_expiry(), obj::subtype, obj::type, and liv::wc.

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(), liv::dam, draw_ext_info(), obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, and obj::stats.

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, obj::attacktype, caster_level(), liv::Cha, archt::clone, cone_drop(), obj::count, liv::dam, draw_ext_info(), obj::duration, fear_bonus, FLAG_UNDEAD, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::level, llevDebug, LOG(), obj::map, liv::maxhp, MOVE_FLY_LOW, obj::move_on, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, archt::name, NDI_UNIQUE, obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, RUNE, set_owner(), set_spell_skill(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, tailor_god_spell(), turn_bonus, obj::type, liv::Wis, obj::x, and obj::y.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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(), obj::below, caster_level(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_archetype(), find_god(), FLAG_IS_FLOOR, HOLY_ALTAR, INS_BELOW_ORIGINATOR, insert_ob_in_map(), obj::level, llevError, LOG(), obj::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, NDI_UNIQUE, QUERY_FLAG, remove_ob(), snprintf(), tolower, obj::type, obj::x, and obj::y.

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(), archt::clone, copy_object(), draw_ext_info(), DRINK, find_archetype_by_object_type_name(), first_archetype, liv::food, FOOD, get_object(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, archt::next, obj::nrof, SP_level_duration_adjust(), obj::stats, obj::type, and obj::value.

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 obj::below, BOW, cast_create_obj(), obj::count, create_archetype(), liv::dam, draw_ext_info_format(), obj::duration, find_archetype(), find_artifactlist(), FLAG_APPLIED, FLAG_IDENTIFIED, free_object(), give_artifact_abilities(), obj::inv, artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), obj::magic, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, artifactstruct::next, obj::nrof, pick_up(), PLAYER, QUERY_FLAG, obj::race, SET_FLAG, obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::stats, strcasecmp(), obj::type, obj::value, and was_destroyed.

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, INS_BELOW_ORIGINATOR, insert_ob_in_map(), obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, obj::x, and obj::y.

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.nosp@m..del.nosp@m.becq@.nosp@m.usa..nosp@m.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 obj::above, add_string(), arch_to_object(), cast_create_obj(), caster_level(), check_inv_recursive(), obj::contr, 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(), obj::map, MAP_PLAYER_UNIQUE, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, obj::name_pl, NDI_NAVY, NDI_UNIQUE, obj::other_arch, mapdef::path, present_arch(), obj::race, ready_map_name(), remove_ob(), settings, obj::slaying, snprintf(), pl::transport, obj::weapontype, obj::x, and obj::y.

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 liv::ac, add_refcount(), obj::below, change_abil(), create_archetype(), determine_god(), obj::direction, draw_ext_info(), draw_ext_info_format(), obj::duration, find_god(), fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_pointed_target(), insert_ob_in_ob(), obj::inv, obj::last_grace, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_SPELL, obj::name, obj::name_pl, NDI_UNIQUE, obj::path_denied, obj::path_repelled, PLAYER, obj::race, obj::range, SET_FLAG, SP_level_duration_adjust(), obj::speed, obj::speed_left, SPELL_GRACE, obj::stats, obj::subtype, obj::type, and liv::wc.

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 obj::above, arch_to_object(), ATNR_MAGIC, obj::attacktype, change_skill(), liv::dam, obj::duration, find_skill_by_name(), FLAG_ALIVE, FLAG_FRIENDLY, get_map_flags(), GET_MAP_OB, obj::head, hit_player(), insert_ob_in_map(), make_object_glow(), obj::map, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, obj::resist, obj::skill, SP_DESTRUCTION, SP_FAERY_FIRE, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::subtype, obj::type, obj::x, and obj::y.

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(), obj::inv, llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, obj::name, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, remove_ob(), obj::skill, and obj::type.

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 obj::above, AT_PHYSICAL, FLAG_TEAR_DOWN, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), obj::map, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::type, obj::x, and obj::y.

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, obj::attacktype, cure_disease(), liv::dam, draw_ext_info(), obj::duration, find_archetype(), find_target_for_friendly_spell(), liv::food, FORCE, liv::grace, liv::hp, obj::last_grace, obj::last_sp, liv::maxgrace, liv::maxhp, liv::maxsp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, PREFER_HIGH, present_arch_in_ob(), present_in_ob_by_name(), random_roll(), liv::sp, and obj::stats.

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 obj::above, obj::below, liv::dam, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), FLAG_IDENTIFIED, GET_MAP_OB, identify(), obj::inv, obj::invisible, obj::map, MAX_BUF, obj::msg, 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(), obj::stats, obj::type, UPD_FLAGS, UPD_NAME, obj::x, and obj::y.

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 obj::active_next, active_objects, add_refcount(), obj::contr, draw_ext_info(), obj::duration, obj::enemy, FLAG_MAKE_INVIS, FREE_AND_CLEAR_STR, pl::hidden, pl::invis_race, obj::invisible, makes_invisible_to(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, obj::race, SP_level_duration_adjust(), pl::tmp_invis, obj::type, UP_OBJ_FACE, 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 obj::above, arch_to_object(), obj::attacktype, liv::dam, draw_ext_info(), obj::duration, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::head, hit_player(), insert_ob_in_map(), llevError, LOG(), obj::map, MAX_LIGHT_RADII, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::range, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.

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 obj::count, liv::dam, obj::duration, insert_ob_in_map(), obj::level, obj::map, liv::maxhp, obj::range, obj::stats, obj::x, and obj::y.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, arch_to_object(), obj::below, caster_level(), FLAG_IS_FLOOR, liv::food, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, insert_ob_in_map(), obj::map, MOVE_FLY_LOW, obj::other_arch, P_NO_MAGIC, P_OUT_OF_MAP, polymorph(), QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::speed_left, obj::stats, obj::x, and obj::y.

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

Definition at line 186 of file resurrection.c.

References obj::above, 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, treasureliststruct::items, obj::last_heal, obj::level, obj::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, obj::name, archt::name, NDI_UNIQUE, treasurestruct::next, treasurestruct::nrof, P_OUT_OF_MAP, obj::randomitems, remove_ob(), resurrect_player(), resurrection_fails(), summon_hostile_monsters(), obj::type, obj::x, and obj::y.

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, obj::attacktype, caster_level(), obj::count, liv::dam, determine_god(), draw_ext_info(), draw_ext_info_format(), obj::duration, find_god(), FLAG_REFL_SPELL, FLAG_UNDEAD, free_object(), get_pointed_target(), liv::grace, liv::hp, HUGE_BUF, insert_ob_in_map(), obj::level, obj::map, liv::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, NDI_UNIQUE, obj::other_arch, PREFER_LOW, QUERY_FLAG, query_name(), obj::race, random_roll(), obj::range, set_owner(), set_spell_skill(), SP_EXPLOSION, SP_level_dam_adjust(), SP_level_range_adjust(), SPELL_EFFECT, SPELL_GRACE, SPELL_MANA, obj::stats, obj::subtype, tailor_god_spell(), obj::title, obj::type, obj::x, and obj::y.

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(), obj::anim_suffix, 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(), obj::casting_time, Settings::casting_time, change_skill(), cleric_chance, obj::contr, create_aura(), create_bomb(), determine_god(), dimension_door(), dispel_rune(), draw_ext_info(), draw_ext_info_format(), draw_magic_map(), pl::encumbrance, 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(), liv::grace, handle_spell_confusion(), HORN, obj::level, llevError, LOG(), magic_wall(), obj::map, MAX, MAX_BUF, liv::maxgrace, min_casting_level(), mood_change(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_MISSING, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_INFO, obj::name, NDI_UNIQUE, P_NO_CLERIC, P_NO_MAGIC, obj::path_attuned, obj::path_denied, obj::path_repelled, 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, pl::shoottype, obj::skill, SOUND_TYPE_SPELL, liv::sp, SP_ALCHEMY, SP_ANIMATE_WEAPON, SP_AURA, SP_BLESS, SP_BOLT, SP_BOMB, SP_BULLET, SP_CAUSE_DISEASE, SP_CHANGE_ABILITY, SP_CHANGE_MANA, SP_CHANGE_MAP_LIGHT, SP_CHARGING, SP_CONE, SP_CONSECRATE, SP_CREATE_FOOD, SP_CREATE_MISSILE, SP_CURSE, SP_DESTRUCTION, SP_DETECTION, SP_DIMENSION_DOOR, SP_DISPEL_RUNE, SP_EARTH_TO_DUST, SP_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, obj::speed, obj::speed_left, SPELL, obj::spell, spell_effect(), spell_failure(), Settings::spell_failure_effects, SPELL_GRACE, SPELL_MANA, obj::spellarg, obj::stats, strdup_local(), obj::subtype, summon_golem(), summon_object(), TRUE, obj::type, WAND, liv::Wis, write_mark(), write_rune(), obj::x, and obj::y.

Referenced by altar_type_move_on(), cast_dust(), cast_wonder(), cfapi_object_cast(), command_cast_spell(), fire(), fire_misc_object(), monster_cast_spell(), monster_use_range(), move_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 obj::above, caster_level(), charge_mana_effect(), liv::dam, draw_ext_info(), FLAG_ALIVE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_BLACK, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, liv::sp, SP_level_dam_adjust(), obj::stats, obj::x, and obj::y.

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(), obj::level, llevError, LOG(), obj::name, obj::randomitems, rndm(), SP_WONDER, SPELL, obj::subtype, and obj::type.

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(), pl::bed_x, pl::bed_y, obj::contr, create_archetype(), draw_ext_info(), obj::duration, 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, pl::savebed_map, SP_level_duration_adjust(), SP_WORD_OF_RECALL, obj::speed, obj::speed_left, SPELL_EFFECT, obj::subtype, obj::type, 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 obj::contr, pl::last_skill_ob, obj::level, NUM_SKILLS, obj::path_attuned, obj::path_repelled, PLAYER, obj::skill, and obj::type.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_consecrate(), cast_create_town_portal(), cast_detection(), cast_polymorph(), cast_raise_dead_spell(), cast_smite_spell(), cast_spell(), cast_transfer(), 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_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, first_friendly_object, oblnk::next, and oblnk::ob.

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_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(), CFAPI_INT, and obj::map.

+ 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(), obj::name, 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, obj::contr, pl::count, drop(), FLAG_NO_DROP, PLAYER, QUERY_FLAG, pl::socket, obj::type, and socket_struct::update_look.

+ 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 obj::below, CFAPI_POBJECT, obj::inv, MAX_BUF, obj::name, 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 obj::above, liv::ac, obj::active_next, obj::active_prev, obj::anim_speed, obj::animation_id, obj::arch, obj::attack_movement, obj::attacked_by, obj::attacktype, pl::bed_x, pl::bed_y, obj::below, can_merge(), can_pick(), obj::carrying, 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, liv::Cha, obj::chosen_skill, obj::client_type, liv::Con, obj::container, obj::contr, obj::count, obj::current_weapon, obj::custom_name, liv::dam, determine_god(), liv::Dex, obj::direction, obj::duration, obj::enemy, obj::env, liv::exp, obj::expmul, obj::face, obj::facing, find_marked_object(), first_player, FLAG_WAS_WIZ, liv::food, obj::gen_sp_armour, get_owner(), obj::glow_radius, liv::grace, obj::head, obj::hide, socket_struct::host, liv::hp, liv::Int, obj::inv, obj::invisible, is_friendly(), is_magical(), obj::item_power, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, obj::lore, liv::luck, obj::magic, obj::map, obj::material, obj::materialname, liv::maxgrace, liv::maxhp, liv::maxsp, obj::move_allow, obj::move_block, obj::move_off, obj::move_on, obj::move_slow_penalty, obj::move_status, obj::move_type, obj::msg, archt::name, obj::name_pl, pl::next, obj::no_save, obj::nrof, new_face_struct::number, pl::ob, obj::other_arch, pl::party, obj::path_attuned, obj::path_denied, obj::path_repelled, obj::perm_exp, obj::pick_up, liv::Pow, present_arch_in_ob(), present_in_ob(), present_in_ob_by_name(), query_base_name(), QUERY_FLAG, query_name(), query_short_name(), obj::race, obj::resist, obj::run_away, pl::savebed_map, obj::skill, obj::slaying, snprintf(), pl::socket, liv::sp, obj::speed, obj::speed_left, obj::spellitem, obj::stats, liv::Str, obj::subtype, obj::title, pl::title, obj::type, obj::value, liv::wc, obj::weight, obj::weight_limit, liv::Wis, obj::x, and obj::y.

+ 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(), obj::name, 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(), obj::name, 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(), PLAYER, and obj::type.

+ 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 obj::above, liv::ac, add_friendly_object(), obj::anim_speed, obj::animation_id, obj::arch, obj::attack_movement, obj::attacktype, pl::bed_x, pl::bed_y, 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, liv::Cha, obj::chosen_skill, CLEAR_FLAG, archt::clone, liv::Con, obj::container, obj::contr, copy_message(), obj::count, obj::custom_name, liv::dam, decrease_ob_nr(), liv::Dex, obj::direction, obj::duration, obj::enemy, obj::env, esrv_update_item(), liv::exp, obj::expmul, obj::face, obj::facing, first_player, fix_object(), liv::food, FREE_AND_COPY, obj::gen_sp_armour, get_player_container(), obj::glow_radius, liv::grace, obj::hide, liv::hp, liv::Int, obj::invisible, is_friendly(), obj::item_power, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, obj::lore, liv::luck, obj::magic, obj::map, pl::mark, pl::mark_count, obj::material, MAX_BUF, liv::maxgrace, liv::maxhp, liv::maxsp, obj::move_status, obj::name, obj::name_pl, new_faces, pl::next, obj::no_save, obj::nrof, pl::ob, object_get_env_recursive(), P_NEED_UPDATE, pl::party, obj::path_attuned, obj::path_denied, obj::path_repelled, obj::perm_exp, obj::pick_up, PLAYER, liv::Pow, obj::race, remove_friendly_object(), obj::resist, obj::run_away, pl::savebed_map, send_changed_object(), SET_ANIMATION, set_cheat(), SET_FLAG, SET_MAP_FLAGS, set_owner(), obj::skill, obj::slaying, pl::socket, liv::sp, obj::speed, obj::speed_left, obj::spellitem, obj::state, obj::stats, liv::Str, sum_weight(), obj::title, pl::title, obj::type, UP_OBJ_FACE, UPD_NROF, UPD_WEIGHT, update_all_los(), socket_struct::update_look, update_ob_speed(), update_object(), update_position(), obj::value, liv::wc, obj::weight, obj::weight_limit, liv::Wis, obj::x, and obj::y.

+ 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, obj::contr, find_first_free_spot(), FLAG_REMOVED, insert_ob_in_map_at(), map_newmap_cmd(), out_of_map(), PLAYER, QUERY_FLAG, remove_ob(), pl::socket, and obj::type.

+ 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, obj::contr, 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:

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 obj::count, _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(), obj::chosen_skill, obj::contr, PLAYER, range_skill, pl::shoottype, and obj::type.

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 obj::chosen_skill, obj::contr, draw_ext_info(), draw_ext_info_format(), legal_range(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, query_base_name(), query_name(), obj::race, range_bottom, range_bow, range_golem, range_magic, range_misc, range_none, range_size, range_skill, pl::ranges, and pl::shoottype.

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 obj::above, obj::attacktype, obj::count, liv::dam, explode_bullet(), FLAG_ALIVE, FLAG_REMOVED, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), obj::map, OB_TYPE_MOVE_BLOCK, obj::other_arch, P_IS_ALIVE, QUERY_FLAG, remove_ob(), obj::stats, was_destroyed, obj::x, and obj::y.

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 obj::above, AT_PHYSICAL, DOOR, GET_MAP_OB, hit_player(), and obj::type.

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 obj::above, AT_PHYSICAL, liv::dam, EARTHWALL, GET_MAP_OB, hit_player(), obj::stats, and obj::type.

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 obj::attack_movement, can_detect_enemy(), obj::enemy, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NEUTRAL, FLAG_REMOVED, GOLEM, HI4, on_same_map(), obj::owner, PETMOVE, PLAYER, QUERY_FLAG, should_arena_attack(), and obj::type.

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 obj::arch, pl::bed_x, pl::bed_y, obj::below, pl::bowtype, obj::carrying, liv::Cha, check_password(), check_path(), CLEAR_FLAG, archt::clone, close_and_delete(), liv::Con, confirm_password(), containers, obj::contr, 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::hp, liv::Int, obj::inv, 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, obj::name, archt::name, 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, obj::speed, pl::spellparam, ST_PLAYING, pl::state, obj::stats, liv::Str, strdup_local(), strtol(), sum_weight(), terminate_all_pets(), pl::title, TRUE, obj::type, pl::unapply, unapply_always, unapply_never, unapply_nochoice, socket_struct::update_look, update_ob_speed(), pl::usekeys, pl::weapon_sp, obj::weight, liv::Wis, pl::write_buf, wrong_password(), obj::x, and obj::y.

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 obj::below, DISEASE, infect_object(), obj::inv, and obj::type.

Referenced by hit_with_one_attacktype().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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, obj::contr, draw_ext_info(), draw_ext_info_format(), draw_one_high_score(), scr::exp, liv::exp, pl::explore, FLAG_WAS_WIZ, HIGHSCORE_LENGTH, scr::killer, pl::killer, obj::map, scr::maplevel, MAX_BUF, scr::maxgrace, liv::maxgrace, scr::maxhp, liv::maxhp, scr::maxsp, liv::maxsp, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, scr::name, obj::name, mapdef::name, pl::name_changed, NDI_UNIQUE, pl::own_title, mapdef::path, scr::position, QUERY_FLAG, obj::stats, scr::title, and pl::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(), obj::duration, obj::env, get_ob_key_value(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, obj::name, NDI_NAVY, NDI_UNIQUE, PLAYER, and obj::type.

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 obj::below, obj::inv, obj::name, SPELL, and obj::type.

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 archt::clone, find_archetype(), first_archetype, llevDebug, llevError, LOG(), archt::name, archt::next, NUM_SKILLS, obj::skill, skill_names, SPELL, spell_mapping, and obj::type.

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 obj::below, obj::inv, IS_COMBAT_SKILL, obj::level, llevError, LOG(), obj::name, PLAYER, SKILL, obj::subtype, and obj::type.

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 obj::chosen_skill, CLEAR_FLAG, obj::contr, FLAG_READY_SKILL, PLAYER, range_none, range_skill, pl::ranges, pl::shoottype, and obj::type.

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, obj::name, NDI_UNIQUE, pl::next, pl::ob, pl::orig_stats, liv::Pow, Settings::real_wiz, SET_FLAG, settings, obj::stats, liv::Str, and liv::Wis.

+ 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(), liv::exp, FALSE, find_skill_by_name(), first_player, FLAG_WAS_WIZ, MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::next, pl::ob, player_lvl_adj(), Settings::real_wiz, SET_FLAG, settings, and obj::stats.

+ 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 obj::above, AP_APPLY, AP_UNAPPLY, obj::container, draw_ext_info_format(), find_best_apply_object_match(), obj::inv, 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 obj::contr, 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, pl::unapply, 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, obj::name, 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, obj::name, 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 obj::body_info, body_locations, obj::body_used, 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, NUM_BODY_LOCATIONS, 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, pl::bowtype, obj::contr, 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 pl::braced, obj::contr, 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 obj::below, cast_spell(), obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), obj::facing, find_skill_by_name(), free_object(), pl::golem_count, obj::inv, lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, obj::name, NDI_UNIQUE, range_golem, range_magic, pl::ranges, remove_friendly_object(), remove_ob(), pl::shoottype, show_matching_spells(), obj::skill, SPELL, pl::spellparam, and obj::type.

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(), obj::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, obj::name, 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 obj::arch, arch_to_object(), CLEAR_FLAG, archt::clone, obj::contr, copy_object(), obj::count, pl::count, create_treasure(), mapdef::difficulty, dm_stack_pop(), dm_stack_push(), draw_ext_info(), draw_ext_info_format(), FALSE, find_archetype(), find_archetype_by_object_name(), find_artifactlist(), FLAG_ALIVE, FLAG_IDENTIFIED, FLAG_KNOWN_MAGICAL, FLAG_WAS_WIZ, free_object(), give_artifact_abilities(), GT_APPLY, HORN, insert_ob_in_map(), insert_ob_in_map_at(), insert_ob_in_ob(), artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), obj::map, MAX, MAX_BUF, obj::more, archt::more, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, need_identify(), artifactstruct::next, obj::nrof, object_create_arch(), out_of_map(), QUERY_FLAG, obj::randomitems, Settings::real_wiz, ROD, SCROLL, set_abs_magic(), SET_FLAG, set_magic(), set_variable(), settings, SPELL, SPELLBOOK, obj::type, WAND, obj::x, and obj::y.

+ 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 obj::contr, dm_stack_pop(), draw_ext_info(), find_object(), get_dm_object(), get_ob_diff(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, STACK_FROM_NUMBER, STACK_FROM_TOP, pl::stack_items, pl::stack_position, stringbuffer_finish(), and stringbuffer_new().

+ 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 obj::below, obj::contr, pl::count, draw_ext_info(), draw_ext_info_format(), drop(), FLAG_INV_LOCKED, FLAG_NO_DROP, obj::inv, obj::invisible, item_matched_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, pl::socket, obj::type, and socket_struct::update_look.

+ 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, obj::below, BOOK, BOOTS, BOW, BRACERS, CLEAR_FLAG, CLOAK, obj::container, CONTAINER, obj::contr, pl::count, 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, obj::inv, obj::invisible, KEY, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, RING, ROD, SCROLL, SET_FLAG, SHIELD, pl::socket, SPECIAL_KEY, SPELLBOOK, obj::type, UPD_WEIGHT, socket_struct::update_look, 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 obj::contr, draw_ext_info(), dump_object(), FLAG_OBJ_ORIGINAL, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, QUERY_FLAG, stringbuffer_finish(), and stringbuffer_new().

+ 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 obj::below, obj::contr, obj::count, 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(), and obj::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 obj::below, CONTAINER, draw_ext_info(), empty_container(), find_best_object_match(), obj::inv, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and obj::type.

+ 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 obj::below, draw_ext_info_format(), examine(), find_best_object_match(), LOOK_OBJ, 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 obj::contr, draw_ext_info(), pl::explore, 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 obj::contr, draw_ext_info(), pl::fire_on, 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.

References obj::contr, and pl::fire_on.

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(), obj::contr, draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), pl::followed_player, FREE_AND_CLEAR_STR, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, obj::name, NDI_UNIQUE, and pl::ob.

+ 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 obj::contr, do_forget_spell(), draw_ext_info(), draw_ext_info_format(), lookup_spell_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, and NDI_UNIQUE.

+ 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 obj::contr, dm_stack_pop(), draw_ext_info(), FLAG_REMOVED, free_object(), get_dm_object(), obj::head, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, remove_ob(), and STACK_FROM_STACK.

+ 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, obj::name, NDI_RED, NDI_UNIQUE, pl::ob, obj::speed, and obj::speed_left.

+ 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(), mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, free_object(), get_object(), obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, and NDI_UNIQUE.

Referenced by command_loadtest().

+ 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 
)
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(), obj::invisible, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, UP_OBJ_FACE, 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(), obj::contr, obj::direction, draw_ext_info_format(), EVENT_KICK, execute_global_event(), first_player, FLAG_FREED, FLAG_REMOVED, pl::killer, obj::map, MAP_TIMEOUT, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, obj::name, NDI_ALL, NDI_RED, NDI_UNIQUE, pl::next, Ns_Dead, pl::ob, mapdef::players, QUERY_FLAG, remove_ob(), save_player(), pl::socket, socket_struct::status, and mapdef::timeout.

Referenced by command_banish(), and command_shutdown().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int command_kill_pets ( object op,
char *  params 
)
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 obj::contr, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_005, I18N_MSG_CMISC_006, I18N_MSG_CMISC_051, i18n_translate(), pl::language, 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 obj::contr, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_105, I18N_MSG_CMISC_106, I18N_MSG_CMISC_107, i18n_translate(), pl::listening, 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, obj::name, 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, obj::count, 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 obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), find_best_object_match(), find_marked_object(), pl::mark, pl::mark_count, 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(), obj::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_ME, obj::name, 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(), obj::enemy, 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 
)
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 obj::contr, 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, NDI_UNIQUE, and pl::outputs_count.

+ 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 obj::contr, 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, NDI_UNIQUE, and pl::outputs_sync.

+ 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(), obj::map, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, mapdef::path, 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(), obj::map, 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 obj::contr, 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, obj::name, 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 obj::contr, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, and pl::rejoin_party.

+ 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 obj::contr, CS_QUERY_HIDEINPUT, get_language(), I18N_MSG_CMISC_217, i18n_translate(), send_query(), pl::socket, ST_CHANGE_PASSWORD_OLD, and pl::state.

+ 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 obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), FALSE, FLAG_WAS_WIZ, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, Settings::real_wiz, SET_FLAG, set_variable(), and settings.

+ 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 obj::contr, draw_ext_info(), get_language(), I18N_MSG_CMISC_208, I18N_MSG_CMISC_209, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and pl::peaceful.

+ 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 obj::contr, 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, pl::petmode, 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 obj::contr, display_new_pickup(), draw_ext_info(), draw_ext_info_format(), llevDebug, LOG(), pl::mode, 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 obj::body_info, obj::contr, do_some_living(), draw_ext_info(), esrv_new_player(), esrv_send_inventory(), find_object(), find_object_name(), fix_object(), FLAG_WIZ, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, NUM_BODY_LOCATIONS, pl::ob, PLAYER, SET_FLAG, and obj::type.

+ 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 obj::contr, CS_QUERY_SINGLECHAR, get_language(), I18N_MSG_CMISC_181, i18n_translate(), send_query(), pl::socket, ST_CONFIRM_QUIT, and pl::state.

+ 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 obj::contr, dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), FLAG_REMOVED, get_dm_object(), obj::head, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), obj::speed, STACK_FROM_STACK, obj::type, and update_ob_speed().

+ 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 obj::below, obj::count, obj::custom_name, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_best_object_match(), find_marked_object(), FREE_AND_CLEAR_STR, FREE_AND_COPY, obj::inv, obj::invisible, MAX_BUF, merge_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, obj::nrof, 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 obj::contr, 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, obj::name, NDI_ORANGE, NDI_UNIQUE, pl::ob, and QUERY_FLAG.

+ Here is the call graph for this function:

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 obj::arch, ATNR_INTERNAL, atnr_is_dragon_enabled(), attacktype_desc, obj::below, 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(), obj::inv, is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, archt::name, NDI_UNIQUE, NROFATTACKS, obj::resist, and obj::type.

+ 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 obj::contr, draw_ext_info(), move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and pl::run_on.

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

References obj::contr, and pl::run_on.

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(), liv::exp, get_language(), get_map_flags(), I18N_MSG_CMISC_204, I18N_MSG_CMISC_205, I18N_MSG_CMISC_206, I18N_MSG_CMISC_207, i18n_translate(), obj::map, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, P_NO_CLERIC, save_player(), obj::stats, obj::x, and obj::y.

+ 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 obj::contr, draw_ext_info(), draw_ext_info_format(), FALSE, fix_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, Settings::search_items, pl::search_str, 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, obj::name, NDI_UNIQUE, PLAYER, and obj::type.

+ 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_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 obj::contr, draw_ext_info(), get_language(), I18N_MSG_CMISC_186, I18N_MSG_CMISC_187, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, SND_MUTE, pl::socket, and socket_struct::sound.

+ 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 obj::contr, draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, and pl::stack_position.

+ 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 obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, obj::name, NDI_UNIQUE, pl::stack_items, and pl::stack_position.

+ 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 obj::contr, and 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 obj::contr, obj::count, 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 obj::arch, liv::Cha, archt::clone, liv::Con, obj::contr, liv::Dex, draw_ext_info(), draw_ext_info_format(), liv::exp, obj::expmul, 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(), liv::Int, obj::level, level_exp(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, NDI_UNIQUE, pl::orig_stats, pl::peaceful, liv::Pow, obj::stats, liv::Str, and liv::Wis.

+ 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 liv::ac, liv::Cha, liv::Con, liv::dam, liv::Dex, draw_ext_info(), draw_ext_info_format(), liv::exp, find_player_partial_name(), liv::food, liv::grace, liv::hp, liv::Int, liv::maxhp, liv::maxsp, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, liv::Pow, liv::sp, obj::stats, liv::Str, liv::wc, and liv::Wis.

+ 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 obj::contr, fire(), and pl::fire_on.

+ 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 obj::above, draw_ext_info(), draw_ext_info_format(), GET_MAP_OB, MAP_HEIGHT, MAP_WIDTH, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapdef::next, and styles.

+ 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(), obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, mapdef::path, obj::x, and obj::y.

+ 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 obj::above, obj::below, can_pick(), obj::container, draw_ext_info(), draw_ext_info_format(), FLAG_IS_FLOOR, obj::inv, obj::invisible, item_matched_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, obj::name, NDI_UNIQUE, obj::next, 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(), obj::contr, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_free_spot(), find_player_partial_name(), free_object(), freearr_x, freearr_y, get_object(), pl::hidden, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, mapdef::path, obj::x, and obj::y.

+ 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(), obj::facing, 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 
)
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 obj::contr, draw_ext_info(), draw_ext_info_format(), EVENT_MUZZLE, execute_global_event(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ORANGE, NDI_RED, NDI_UNIQUE, pl::no_shout, and pl::ob.

+ 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, obj::name, 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 obj::arch, 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, obj::name, archt::name, NDI_UNIQUE, obj::nrof, object_create_arch(), PLAYER, snprintf(), obj::subtype, and obj::type.

+ 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, obj::contr, 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, types, and pl::usekeys.

+ 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, obj::map, 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, NDI_UNIQUE, and obj::run_away.

+ 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 obj::above, ext_info_map(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, llevDebug, LOG(), obj::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_SAY, obj::name, NDI_WHITE, P_OUT_OF_MAP, PLAYER, SIZEOFFREE2, snprintf(), talk_to_npc(), obj::type, obj::x, and obj::y.

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, mapdef::height, obj::map, MAX_EXPLORE, ob_blocked(), OUT_OF_MEMORY, OUT_OF_REAL_MAP, mapdef::width, obj::x, and obj::y.

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(), obj::level, obj::map, obj::other_arch, obj::owner, set_owner(), obj::skill, obj::x, and obj::y.

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 obj::contr, party_struct::next, pl::party_to_join, party_struct::partyname, party_struct::passwd, and pl::write_buf.

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 obj::contr, CS_QUERY_HIDEINPUT, send_query(), pl::socket, ST_CONFIRM_PASSWORD, pl::state, and pl::write_buf.

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(), obj::duration, FLAG_CONFUSED, FORCE, FORCE_CONFUSION, FORCE_NAME, free_string(), insert_ob_in_ob(), MAX, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, NDI_UNIQUE, PLAYER, present_in_ob_by_name(), QUERY_FLAG, obj::resist, SET_FLAG, obj::speed, obj::subtype, and obj::type.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

References obj::direction.

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 obj::above, GET_MAP_OB, SHOP_FLOOR, and obj::type.

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 obj::above, AT_COUNTERSPELL, AT_MAGIC, obj::attacktype, FLAG_MONSTER, liv::food, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, liv::hp, obj::level, obj::map, obj::owner, P_OUT_OF_MAP, QUERY_FLAG, remove_ob(), rndm(), RUNE, obj::speed_left, SPELL_EFFECT, obj::stats, obj::type, obj::x, and obj::y.

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(), obj::attacktype, caster_level(), liv::dam, draw_ext_info(), obj::duration, insert_ob_in_ob(), obj::level, MSG_TYPE_SPELL, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, obj::other_arch, PLAYER, present_arch_in_ob(), set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), obj::stats, store_spell_expiry(), and obj::type.

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(), obj::attacktype, liv::dam, draw_ext_info(), obj::duration, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::map, MOVE_WALK, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, obj::other_arch, P_OUT_OF_MAP, obj::range, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.

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 obj::below, change_exp(), obj::chosen_skill, DISEASE, draw_ext_info(), draw_ext_info_format(), liv::exp, FLAG_STARTEQUIP, free_object(), obj::inv, obj::level, 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(), remove_symptoms(), obj::skill, obj::stats, and obj::type.

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(), obj::map, 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(), obj::map, 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, obj::name, 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(), obj::map, 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, stringbuffer_finish(), and obj::type.

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 FLAG_REMOVED, free_object(), obj::inv, QUERY_FLAG, and remove_ob().

Referenced by 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(), obj::below, first_god, FLAG_ALIVE, get_god_for_race(), glnk::id, obj::inv, lookup_god_by_name(), glnk::name, glnk::next, PLAYER, QUERY_FLAG, obj::race, rndm(), SK_PRAYING, SKILL, SPELL, SPELL_EFFECT, obj::subtype, obj::title, and obj::type.

Referenced by become_follower(), cast_bless(), cast_consecrate(), cast_curse(), cast_detection(), cast_smite_spell(), cast_spell(), cfapi_object_get_property(), hit_player(), hit_with_one_attacktype(), kill_player(), 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, archt::clone, obj::invisible, treasurestruct::item, treasureliststruct::items, llevError, LOG(), obj::name, treasurestruct::next, obj::other_arch, obj::randomitems, rndm(), and obj::type.

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 obj::contr, pl::count, draw_ext_info(), FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::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, obj::range, remove_ob(), pl::socket, SP_level_range_adjust(), obj::speed, obj::speed_left, obj::type, obj::x, and obj::y.

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 obj::above, obj::arch, obj::below, draw_ext_info(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::inv, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, archt::name, NDI_UNIQUE, P_OUT_OF_MAP, remove_ob(), RUNE, SIGN, TRAP, trap_disarm(), obj::type, obj::x, and obj::y.

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(), obj::contr, 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(), remove_ob(), and obj::type.

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 obj::above, obj::below, change_exp(), obj::chosen_skill, 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(), obj::inv, obj::level, llevError, LOG(), obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, obj::name, NDI_WHITE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, random_roll(), remove_ob(), rndm(), set_ob_key_value(), SIZEOFFREE, SK_EXP_ADD_SKILL, obj::skill, obj::slaying, obj::speed, obj::speed_left, obj::type, obj::x, and obj::y.

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(), obj::contr, mapdef::difficulty, draw_ext_info(), find_obj_by_type_subtype(), hide(), hideability(), obj::invisible, obj::level, make_visible(), obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, PREFER_LOW, random_roll(), pl::run_on, SK_HIDING, SKILL, obj::skill, and obj::type.

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(), obj::contr, 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, obj::name, NDI_UNIQUE, play_sound_player_only(), PLAYER, QUERY_FLAG, SET_FLAG, SOUND_TYPE_SPELL, and obj::type.

Referenced by cfapi_object_learn_spell(), command_learn_spell_or_prayer(), dragon_ability_gain(), god_intervention(), and spellbook_type_apply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::anim_suffix, apply_anim_suffix(), attack_hth(), attack_melee_weapon(), obj::below, change_exp(), obj::chosen_skill, CLEAR_FLAG, describe_shop(), do_harvest(), draw_ext_info(), find_traps(), fix_object(), FLAG_APPLIED, give_skill_by_name(), hide(), obj::inv, 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, obj::skill, skill_ident(), skill_throw(), liv::sp, obj::speed_left, obj::stats, steal(), obj::subtype, obj::type, 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 Output_Buf::buf, obj::contr, Output_Buf::first_update, flush_output_element(), liv::food, pl::gen_hp, pl::gen_sp, liv::maxhp, liv::maxsp, NUM_OUTPUT_BUFS, pl::outputs, pl::outputs_sync, pticks, ST_PLAYING, pl::state, and obj::stats.

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(), obj::contr, draw_ext_info(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, socket_struct::host, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ALL, NDI_LT_GREEN, NDI_UNIQUE, QUERY_FLAG, SET_FLAG, pl::socket, and pl::write_buf.

Referenced by command_dm(), and command_dmhide().

+ 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 obj::contr, draw_ext_info(), draw_ext_info_format(), pl::hidden, obj::invisible, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_LT_GREEN, NDI_UNIQUE, and mapdef::players.

Referenced by command_dmhide(), and command_hide().

+ 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 liv::hp, obj::inv, SP_level_spellpoint_cost(), SPELL_HIGHEST, and obj::stats.

Referenced by fire_misc_object(), and monster_use_range().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::arch, CLEAR_FLAG, archt::clone, esrv_update_item(), obj::face, FLAG_ANIMATE, liv::food, get_player_container(), obj::speed, obj::stats, obj::type, 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 obj::above, obj::below, obj::container, obj::contr, obj::count, pl::count, draw_ext_info(), drop_object(), obj::env, FLAG_INV_LOCKED, FLAG_NO_DROP, free_object(), obj::invisible, pl::last_used, pl::last_used_id, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, put_object_in_sack(), QUERY_FLAG, remove_ob(), and obj::type.

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(), obj::contr, obj::count, 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(), obj::map, MAX_BUF, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, obj::nrof, PLAYER, QUERY_FLAG, query_name(), remove_ob(), save_player(), SCRIPT_FIX_ALL, sell_item(), obj::type, UPD_WEIGHT, obj::value, was_destroyed, obj::x, and obj::y.

Referenced by drop(), esrv_move_object(), and transport_type_apply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 archt::clone, first_archetype, obj::level, obj::name, archt::name, archt::next, obj::other_arch, obj::skill, SPELL, and obj::type.

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(), obj::map, pl::maplevel, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, obj::name, NDI_UNIQUE, pl::next, pl::ob, save_player(), trying_emergency_save, obj::x, and obj::y.

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, obj::attacktype, pl::bed_x, pl::bed_y, obj::below, obj::contr, liv::dam, 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, obj::inv, llevDebug, llevError, Settings::localdir, LOG(), obj::map, MAP_ENTER_X, MAP_ENTER_Y, MAP_PLAYER_UNIQUE, pl::maplevel, obj::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, obj::name, NDI_UNIQUE, ob_apply(), mapdef::path, path_combine_and_normalize(), PLAYER, PORTAL_DESTINATION_NAME, QUERY_FLAG, ready_map_name(), remove_ob(), save_player(), pl::savebed_map, settings, obj::slaying, obj::stats, pl::transport, obj::type, obj::x, and obj::y.

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(), pl::bed_x, pl::bed_y, obj::contr, 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(), obj::map, obj::name, mapdef::path, pl::savebed_map, 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_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, obj::attacktype, draw_ext_info(), FLAG_UNDEAD, obj::head, liv::hp, obj::level, liv::maxhp, mon, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, NDI_UNIQUE, POISONING, present_in_ob(), QUERY_FLAG, and obj::stats.

Referenced by examine(), and probe().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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, obj::contr, draw_ext_info_format(), find_command_element(), find_plugin_command(), FLAG_WIZ, command_array_struct::func, pl::has_hit, llevDebug, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, obj::speed_left, 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)
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 obj::below, CONTAINER, obj::contr, DOOR, draw_ext_info_format(), FLAG_APPLIED, obj::inv, KEY, key_inventory, keyrings, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, NDI_BROWN, NDI_UNIQUE, QUERY_FLAG, query_name(), obj::race, obj::slaying, SPECIAL_KEY, obj::type, and pl::usekeys.

Referenced by apply_container(), and player_attack_door().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

References obj::below, obj::contr, obj::count, obj::inv, obj::invisible, pl::mark, and pl::mark_count.

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 obj::below, obj::count, FLAG_APPLIED, FLAG_IS_THROWN, obj::head, obj::inv, obj::invisible, llevDebug, LOG(), MAX_BUF, obj::name, QUERY_FLAG, and query_name().

Referenced by skill_throw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_search_arr(), llevDebug, LOG(), obj::map, P_IS_ALIVE, P_OUT_OF_MAP, mapdef::path, PLAYER, QUERY_FLAG, SIZEOFFREE, obj::type, obj::x, and obj::y.

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, obj::name, 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 obj::below, obj::inv, obj::skill, SPELL, and obj::type.

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(), obj::below, FLAG_APPLIED, obj::inv, 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(), obj::below, FLAG_APPLIED, obj::inv, 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 obj::above, obj::below, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), obj::inv, obj::map, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, TRANSPORT, obj::type, obj::x, and obj::y.

Referenced by cast_bless(), cast_change_ability(), and cast_heal().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, obj::below, calc_skill_exp(), liv::Cha, draw_ext_info(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::inv, obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, obj::owner, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, obj::stats, TRAP, trap_see(), trap_show(), obj::type, obj::x, and obj::y.

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(), obj::chosen_skill, obj::contr, control_golem(), obj::count, do_skill(), draw_ext_info(), fire_misc_object(), pl::golem_count, 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, range_skill, pl::ranges, pl::shoottype, pl::spellparam, and obj::type.

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, obj::attacktype, caster_level(), copy_owner(), liv::dam, obj::direction, draw_ext_info(), obj::duration, FLAG_IS_TURNABLE, liv::food, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_owner(), insert_ob_in_map(), obj::level, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, ob_process(), OB_TYPE_MOVE_BLOCK, obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, SET_ANIMATION, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, tailor_god_spell(), obj::type, obj::x, and obj::y.

Referenced by alchemy_failure_effect(), cast_spell(), and move_swarm_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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(), obj::attacktype, liv::Con, liv::dam, liv::Dex, obj::direction, DIRX, DIRY, obj::duration, FLAG_IS_TURNABLE, FLAG_REFLECTING, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::map, ob_process(), OB_TYPE_MOVE_BLOCK, obj::other_arch, P_OUT_OF_MAP, QUERY_FLAG, obj::range, SET_ANIMATION, set_owner(), set_spell_skill(), obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.

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, obj::attacktype, obj::below, BOW, bow_bestarrow, pl::bowtype, obj::chosen_skill, CLEAR_FLAG, obj::contr, obj::count, liv::dam, dam_bonus, liv::Dex, dex_bonus, obj::direction, 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(), liv::grace, liv::hp, insert_ob_in_map(), obj::inv, obj::level, llevError, LOG(), obj::magic, obj::map, MOVE_FLY_LOW, obj::move_on, obj::move_type, MOVE_WALK, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, obj::nrof, ob_process(), P_OUT_OF_MAP, play_sound_map(), PLAYER, QUERY_FLAG, obj::race, range_bow, pl::ranges, remove_ob(), SET_ANIMATION, set_owner(), obj::skill, obj::slaying, SOUND_TYPE_ITEM, liv::sp, obj::speed, obj::speed_left, obj::spellarg, obj::stats, liv::Str, strdup_local(), thaco_bonus, obj::type, update_ob_speed(), was_destroyed, liv::wc, obj::x, and obj::y.

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(), obj::attacktype, check_bullet(), liv::dam, obj::dam_modifier, obj::direction, obj::duration, FLAG_IS_TURNABLE, FLAG_REFLECTING, liv::food, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, liv::hp, insert_ob_in_map(), obj::map, liv::maxhp, OB_TYPE_MOVE_BLOCK, obj::other_arch, P_OUT_OF_MAP, QUERY_FLAG, obj::range, SET_ANIMATION, set_owner(), set_spell_skill(), obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.

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, obj::attacktype, caster_level(), create_archetype(), die_roll(), obj::direction, obj::duration, insert_ob_in_map(), obj::invisible, obj::level, obj::map, obj::other_arch, PREFER_HIGH, set_owner(), set_spell_skill(), SP_level_duration_adjust(), obj::spell, SWARM_SPELL, tailor_god_spell(), obj::x, and obj::y.

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.

Those are dummy functions defined to resolve all symboles. Added as part of glue cleaning. Ryo 2005-07-15

Definition at line 130 of file standalone.c.

References obj::above, ALTAR, obj::arch, auto_apply(), obj::below, check_trigger(), CLASS, CONTAINER, create_treasure(), mapdef::difficulty, FIREWALL, FLAG_AUTO_APPLY, FLAG_IS_LINKED, GET_MAP_OB, GT_APPLY, HAS_RANDOM_ITEMS, obj::head, HORN, liv::hp, obj::inv, MAP_HEIGHT, MAP_WIDTH, PLAYER, PLAYER_CHANGER, POTION, QUERY_FLAG, obj::randomitems, ROD, SCROLL, obj::speed, SPELL, SPELLBOOK, obj::stats, TIMED_GATE, TREASURE, TRIGGER_BUTTON, TRIGGER_PEDESTAL, obj::type, 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(), obj::contr, first_player, pl::next, pl::ob, and pl::state.

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(), obj::arch, obj::attacktype, archt::clone, liv::dam, obj::direction, obj::face, liv::food, FREE_AND_CLEAR_STR, free_no_drop(), free_object(), liv::grace, liv::hp, obj::level, obj::move_on, obj::move_type, obj::owner, remove_ob(), rndm(), obj::skill, obj::slaying, liv::sp, obj::speed, obj::spellarg, obj::stats, UP_OBJ_FACE, update_ob_speed(), update_object(), and liv::wc.

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(), QUERY_FLAG, and obj::type.

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 obj::carrying, first_player, fix_object(), llevDebug, LOG(), obj::name, 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 obj::arch, archt::clone, draw_ext_info(), find_free_spot(), FLAG_REMOVED, freearr_x, freearr_y, get_map_from_coord(), mapdef::in_memory, insert_ob_in_map(), llevError, llevMonster, LOG(), obj::map, MAP_IN_MEMORY, obj::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, obj::name, NDI_UNIQUE, OUT_OF_REAL_MAP, PLAYER, QUERY_FLAG, remove_ob(), SIZEOFFREE, obj::type, obj::x, and obj::y.

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 obj::contr, draw_ext_info_format(), firstparty, party_struct::kills, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, party_struct::next, pl::party, 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 obj::contr, DISEASE, get_owner(), obj::head, pl::peaceful, PLAYER, POISONING, RUNE, SPELL, and obj::type.

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 obj::count, dm_stack_peek(), dm_stack_push(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, STACK_FROM_NONE, STACK_FROM_NUMBER, STACK_FROM_STACK, STACK_FROM_TOP, pl::stack_items, and pl::stack_position.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

partylist* get_firstparty ( void  )

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 obj::contr, send_query(), pl::socket, ST_GET_NAME, pl::state, and pl::write_buf.

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, oblnk::next, pl::ob, oblnk::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 obj::contr, CS_QUERY_HIDEINPUT, llevError, LOG(), obj::name, pl::party_to_join, send_query(), pl::socket, ST_GET_PARTY_PASSWORD, pl::state, and pl::write_buf.

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 obj::contr, CS_QUERY_HIDEINPUT, send_query(), pl::socket, ST_GET_PASSWORD, pl::state, and pl::write_buf.

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 obj::below, CLEAR_FLAG, cost_string_from_value(), draw_ext_info_format(), esrv_update_item(), F_BUY, F_SHOP, FLAG_PLAYER_SOLD, FLAG_UNPAID, obj::inv, 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(), obj::type, UPD_FLAGS, and UPD_NAME.

Referenced by 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 obj::above, obj::attack_movement, obj::attacked_by, obj::attacked_by_count, can_detect_enemy(), can_see_enemy(), check_enemy(), CLEAR_FLAG, obj::contr, obj::count, obj::enemy, 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(), obj::head, obj::map, on_same_map(), P_IS_ALIVE, P_OUT_OF_MAP, pet_defend, pet_normal, pet_sad, pl::petmode, PETMOVE, PLAYER, QUERY_FLAG, remove_friendly_object(), should_arena_attack(), SIZEOFFREE, obj::type, obj::x, and obj::y.

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 obj::count, FLAG_AFK, FLAG_WIZ, get_name_of_region_for_map(), get_region_by_map(), get_region_longname(), socket_struct::host, socket_struct::is_bot, obj::level, obj::map, obj::name, mapdef::name, pl::ob, pl::own_title, mapdef::path, 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, obj::below, CLEAR_FLAG, create_treasure(), liv::exp, 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, obj::inv, IS_ARMOR, IS_SHIELD, IS_WEAPON, obj::level, link_player_skills(), llevError, LOG(), manual_apply(), obj::name, need_identify(), obj::nrof, PLAYER, QUERY_FLAG, obj::randomitems, remove_ob(), SET_FLAG, SKILL, SPELL, SPELLBOOK, obj::stats, and obj::type.

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(), obj::env, get_ob_key_value(), INS_BELOW_ORIGINATOR, insert_ob_in_map(), insert_ob_in_ob(), obj::map, obj::x, and obj::y.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::contr, obj::count, obj::direction, draw_ext_info(), pl::fire_on, FLAG_MAKE_INVIS, FLAG_REMOVED, FLAG_SCARED, flee_player(), pl::golem_count, handle_client(), pl::hidden, obj::invisible, make_visible(), move_player(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_END, NDI_UNIQUE, pticks, QUERY_FLAG, range_golem, pl::ranges, pl::run_on, pl::socket, and obj::speed_left.

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, obj::hide, obj::invisible, obj::level, 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, obj::type, UP_OBJ_FACE, 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 mapdef::darkness, freearr_x, freearr_y, get_map_flags(), has_carried_lights(), obj::map, P_BLOCKSVIEW, P_OUT_OF_MAP, obj::x, and obj::y.

Referenced by attempt_hide(), and do_hidden_move().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, obj::arch, AT_CHAOS, AT_COUNTERSPELL, AT_MAGIC, obj::below, obj::count, counterspell(), liv::dam, obj::env, FLAG_ALIVE, FLAG_FREED, FLAG_REMOVED, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, hit_player(), obj::inv, llevError, LOG(), obj::map, obj::material, obj::materialname, obj::move_block, obj::name, archt::name, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, save_throw_object(), shuffle_attack(), obj::stats, TRANSPORT, obj::type, UP_OBJ_FACE, update_object(), was_destroyed, obj::x, and obj::y.

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(), obj::arch, arch_to_object(), AT_CHAOS, AT_DEATH, AT_DRAIN, AT_HOLYWORD, AT_MAGIC, AT_PARALYZE, AT_PHYSICAL, AT_SLOW, ATNR_MAGIC, attack_message(), obj::attack_movement, ATTACKS, Chaos_Attacks::attacktype, obj::below, CLEAR_FLAG, obj::count, determine_god(), did_make_save(), DOOR, obj::enemy, 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, obj::head, hit_with_one_attacktype(), liv::hp, insert_ob_in_map(), obj::inv, kill_object(), obj::level, llevDebug, llevError, LOG(), obj::map, liv::maxhp, archt::more, obj::name, archt::name, npc_call_help(), NROFATTACKS, NROFNEWOBJS, obj::other_arch, obj::owner, PETMOVE, PLAYER, QUERY_FLAG, obj::race, remove_friendly_object(), remove_ob(), obj::resist, rndm(), obj::run_away, RUNE, scare_creature(), SET_FLAG, Settings::set_friendly_fire, set_owner(), settings, obj::slaying, spring_trap(), obj::stats, tear_down_wall(), obj::title, TRAP, obj::type, undead_name, obj::value, was_destroyed, obj::x, and obj::y.

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(), obj::below, obj::count, liv::dam, obj::env, EVENT_ATTACK, EVENT_CONNECTOR, execute_event(), fix_stopped_arrow(), free_no_drop(), free_object(), free_string(), INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::map, merge_ob(), remove_ob(), SCRIPT_FIX_ALL, obj::skill, obj::speed, obj::stats, stick_arrow(), obj::type, was_destroyed, liv::wc, obj::x, and obj::y.

Referenced by common_process_projectile(), and common_projectile_move_on().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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(), obj::below, copy_object(), DISEASE, draw_ext_info(), obj::env, FLAG_MONSTER, liv::food, free_string(), get_object(), get_owner(), obj::head, insert_ob_in_ob(), obj::inv, is_susceptible_to_disease(), obj::last_grace, obj::level, obj::map, liv::maxgrace, liv::maxhp, obj::move_block, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, NDI_RED, NDI_UNIQUE, op_on_battleground(), obj::owner, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), set_owner(), SIGN, obj::skill, snprintf(), obj::stats, obj::title, obj::type, obj::value, and liv::wc.

Referenced by cast_cause_disease(), check_infection(), check_physically_infect(), and rune_attack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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(), archt::clone, first_archetype, llevError, LOG(), archt::next, NUM_SKILLS, SKILL, obj::skill, skill_names, obj::subtype, and obj::type.

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 obj::below, CONTAINER, obj::count, draw_ext_info(), draw_ext_info_format(), FLAG_APPLIED, FLAG_WIZ, obj::inv, obj::invisible, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_INVENTORY, NDI_UNIQUE, QUERY_FLAG, query_name(), query_weight(), and obj::type.

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(), obj::map, obj::x, and obj::y.

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 obj::arch, obj::below, archt::clone, EXPERIENCE, FLAG_UNDEAD, obj::inv, PLAYER, QUERY_FLAG, obj::stats, obj::type, and liv::Wis.

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(), obj::carrying, liv::Dex, draw_ext_info(), obj::level, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, obj::stats, and liv::Str.

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(), obj::arch, pl::bed_x, pl::bed_y, obj::carrying, CLEAR_FLAG, archt::clone, obj::contr, 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(), liv::grace, socket_struct::host, liv::hp, insert_ob_in_map(), link_player_skills(), llevDebug, Settings::localdir, LOG(), make_path_to_file(), obj::map, MAX_BUF, liv::maxhp, liv::maxsp, obj::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, obj::name, archt::name, obj::name_pl, NDI_BLUE, pl::orig_stats, play_again(), Settings::playerdir, pticks, obj::randomitems, remove_ob(), remove_statbonus(), pl::savebed_map, send_query(), SET_ANIMATION, settings, snprintf(), pl::socket, liv::sp, ST_PLAYING, start_info(), pl::state, obj::stats, pl::title, UP_OBJ_FACE, UPD_FACE, update_object(), obj::weight, obj::x, and obj::y.

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 
)
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, obj::contr, CS_QUERY_SINGLECHAR, DEX, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, INT, llevError, LOG(), obj::map, obj::msg, 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, pl::socket, ST_CHANGE_CLASS, pl::state, STR, pl::Swap_First, 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 obj::above, add_string(), apply_death_exp_penalty(), arch_to_object(), obj::attacktype, Settings::balanced_stat_loss, BALSL_LOSS_CHANCE_RATIO, BALSL_MAX_LOSS_RATIO, BALSL_NUMBER_LOSSES_RATIO, pl::braced, change_attr_value(), check_score(), check_stat_bounds(), obj::contr, create_archetype(), cure_disease(), dead_player(), delete_character(), determine_god(), obj::direction, 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(), liv::exp, pl::explore, find_archetype(), fix_object(), FLAG_APPLIED, FLAG_UNIQUE, FLAG_WAS_WIZ, FLESH, liv::food, FORCE_NAME, FREE_AND_COPY, free_object(), free_string(), get_attr_value(), GET_MAP_OB, pl::golem_count, liv::grace, gravestone_text(), liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::inv, is_in_shop(), pl::killer, obj::level, loot_object(), lose_msg, obj::map, pl::maplevel, obj::material, obj::materialname, MAX, MAX_BUF, liv::maxgrace, liv::maxhp, liv::maxsp, obj::msg, 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, obj::name, obj::name_pl, NDI_ALL, NDI_NAVY, NDI_UNIQUE, Settings::not_permadeth, NROFATTACKS, op_on_battleground(), pl::orig_stats, pl::own_title, pl::party, play_again(), play_sound_player_only(), PREFER_LOW, present_arch_in_ob(), QUERY_FLAG, random_roll(), range_golem, pl::ranges, remove_friendly_object(), remove_ob(), remove_unpaid_objects(), obj::resist, Settings::resurrection, save_life(), save_player(), SCRIPT_FIX_ALL, SET_FLAG, Settings::set_title, settings, snprintf(), SOUND_TYPE_LIVING, liv::sp, obj::speed, obj::speed_left, SPELL_EFFECT, Settings::stat_loss_on_death, obj::stats, pl::title, transfer_ob(), TRUE, obj::type, obj::value, obj::x, and obj::y.

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 obj::below, FLAG_CAN_USE_SKILL, give_skill_by_name(), liv::Int, obj::inv, learn_spell, obj::level, link_player_skills(), llevError, LOG(), obj::name, PREFER_LOW, QUERY_FLAG, random_roll(), SET_FLAG, SKILL, obj::skill, obj::stats, strncasecmp(), and obj::type.

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(), obj::contr, DEAD_OBJECT, draw_ext_info_format(), FLAG_WIZ, pl::hidden, socket_struct::host, mapdef::in_memory, obj::inv, llevInfo, LOG(), obj::map, MAP_IN_MEMORY, MAP_TIMEOUT, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_PLAYER, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, Ns_Dead, pl::ob, mapdef::players, QUERY_FLAG, query_name(), pl::socket, ST_CONFIRM_PASSWORD, ST_GET_NAME, ST_GET_PASSWORD, pl::state, socket_struct::status, mapdef::timeout, pl::transport, and obj::type.

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 obj::chosen_skill, obj::contr, obj::count, pl::golem_count, range_bow, range_golem, range_magic, range_misc, range_none, range_skill, and pl::ranges.

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 obj::below, obj::contr, obj::inv, pl::last_skill_exp, pl::last_skill_ob, llevError, LOG(), NUM_SKILLS, SKILL, obj::skill, obj::subtype, and obj::type.

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, obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, obj::name, 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 obj::below, obj::inv, 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(), obj::attacktype, caster_level(), archt::clone, copy_object(), liv::dam, draw_ext_info(), draw_ext_info_format(), obj::duration, obj::facing, find_archetype(), FLAG_ALIVE, FLAG_BLOCKSVIEW, FLAG_IS_USED_UP, FLAG_TEAR_DOWN, liv::food, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_object(), liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::level, llevError, LOG(), obj::map, MAX_BUF, liv::maxhp, obj::move_block, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, obj::name, NDI_UNIQUE, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::race, obj::range, SET_FLAG, set_owner(), set_spell_skill(), snprintf(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SPELL, SPELL_EFFECT, obj::stats, obj::type, update_all_los(), obj::x, and obj::y.

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 obj::contr, FREE_AND_CLEAR_STR, obj::hide, pl::invis_race, obj::invisible, PLAYER, pl::tmp_invis, obj::type, UP_OBJ_FACE, 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 obj::contr, FLAG_UNDEAD, pl::invis_race, obj::invisible, is_true_undead(), PLAYER, QUERY_FLAG, obj::race, and obj::type.

Referenced by can_see_enemy(), and cast_invisible().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Main apply handler.

Checks for unpaid items before applying.

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

Definition at line 512 of file apply.c.

References check_race_restrictions(), obj::contr, draw_ext_info(), EVENT_APPLY, execute_event(), FLAG_APPLIED, FLAG_UNPAID, obj::head, 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, SOUND_TYPE_ITEM, and obj::type.

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. thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du
Parameters
pllivng meditating, should be a player.
skillmeditation skill.

Definition at line 1390 of file skills.c.

References ARMOUR, obj::below, BOOTS, draw_ext_info(), FLAG_APPLIED, FLAG_READY_WEAPON, GLOVES, HELMET, liv::hp, obj::inv, obj::last_heal, obj::last_sp, obj::level, liv::maxhp, liv::maxsp, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, NDI_UNIQUE, PLAYER, QUERY_FLAG, SHIELD, liv::sp, obj::stats, and obj::type.

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 obj::level, MAX, obj::path_attuned, obj::path_denied, and obj::path_repelled.

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:

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 obj::above, add_friendly_object(), arch_to_object(), obj::attack_movement, obj::attacktype, caster_level(), CLEAR_FLAG, determine_god(), did_make_save(), obj::enemy, liv::exp, 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, obj::head, insert_ob_in_map(), obj::level, obj::map, MIN, NROFATTACKS, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, PREFER_LOW, QUERY_FLAG, obj::race, random_roll(), obj::range, remove_friendly_object(), obj::resist, SET_FLAG, set_owner(), set_spell_skill(), share_exp(), SK_EXP_ADD_SKILL, obj::skill, obj::slaying, SP_level_range_adjust(), obj::stats, obj::type, obj::x, and obj::y.

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(), obj::env, FLAG_WIZ, liv::food, free_object(), grant_immunity(), is_susceptible_to_disease(), liv::maxhp, QUERY_FLAG, remove_ob(), remove_symptoms(), obj::stats, and obj::value.

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(), obj::inv, llevError, LOG(), obj::map, obj::name, mapdef::name, rndm(), liv::sp, obj::stats, obj::x, and obj::y.

Referenced by legacy_ob_process(), and trigger_connected().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, attack_ob(), obj::contr, obj::count, obj::direction, 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(), pl::golem_count, obj::head, liv::hp, llevDebug, LOG(), obj::map, obj::more, move_ob(), obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, obj::name, NDI_UNIQUE, obj::owner, P_OUT_OF_MAP, QUERY_FLAG, obj::race, range_golem, pl::ranges, remove_friendly_object(), remove_ob(), obj::stats, UP_OBJ_FACE, update_object(), was_destroyed, obj::x, and obj::y.

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)

Main monster processing routine.

Will regenerate spell points, hit points. Moves the monster, handle attack, item applying, pickup, ...

Parameters
opmonster to process.
Returns
1 if the object has been freed, otherwise 0.

Definition at line 566 of file monster.c.

References absdir(), add_refcount(), ALLRUN, animate_object(), obj::animation_id, obj::attack_movement, obj::attacked_by, obj::attacked_by_count, can_hit(), check_wakeup(), compute_path(), obj::count, mapdef::darkness, obj::direction, rv_vector::direction, dist_att(), DISTATT, DISTHIT, disthit_att(), do_hidden_move(), obj::enemy, FABS, obj::face, obj::facing, find_enemy(), FLAG_BLIND, FLAG_CAST_SPELL, FLAG_CONFUSED, FLAG_FREED, FLAG_FRIENDLY, FLAG_NO_ATTACK, FLAG_ONLY_ATTACK, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SCROLL, FLAG_READY_SKILL, FLAG_REMOVED, FLAG_RUN_AWAY, FLAG_SCARED, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_SLEEP, FLAG_STAND_STILL, follow_owner(), free_object(), free_string(), get_nearest_player(), get_owner(), get_rangevector(), obj::head, HI4, obj::hide, HITRUN, hitrun_att(), llevDebug, LO4, LOG(), obj::map, MIN_ACTIVE_SPEED, monster_apply_below(), monster_cast_spell(), monster_check_pickup(), monster_do_living(), monster_move_no_enemy(), monster_use_bow(), monster_use_range(), monster_use_scroll(), monster_use_skill(), obj::more, move_object(), move_randomly(), obj::name, on_same_map(), rv_vector::part, PETMOVE, obj::pick_up, QUERY_FLAG, obj::race, remove_friendly_object(), remove_ob(), run_att(), RUNATT, RUSH, skill_attack(), obj::speed, obj::stats, WAIT2, wait_att(), wait_att2(), WAITATT, liv::wc, and obj::will_apply.

Referenced by process_object().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::below, blocked_link(), check_doors(), check_earthwalls(), obj::contr, obj::direction, pl::do_los, esrv_map_scroll(), FLAG_REMOVED, FLAG_WIZPASS, freearr_x, freearr_y, get_map_flags(), get_map_from_coord(), obj::head, insert_ob_in_map(), obj::inv, llevDebug, llevError, LOG(), socket_struct::look_position, obj::map, obj::more, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, remove_ob(), pl::socket, TRANSPORT, obj::type, socket_struct::update_look, obj::will_apply, WILL_APPLY_DOOR, WILL_APPLY_EARTHWALL, obj::x, and obj::y.

Referenced by cfapi_object_move(), flee_player(), move_golem(), 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(), obj::contr, obj::direction, do_hidden_move(), obj::facing, fire(), pl::fire_on, FLAG_CONFUSED, obj::hide, mapdef::in_memory, llevError, LOG(), obj::map, MAP_IN_MEMORY, move_player_attack(), QUERY_FLAG, pl::run_on, obj::speed_left, obj::state, pl::transport, 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 obj::above, action_makes_visible(), pl::braced, obj::contr, DOOR, draw_ext_info(), obj::enemy, 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(), pl::has_hit, obj::head, obj::hide, liv::hp, LOCKED_DOOR, liv::luck, make_visible(), obj::map, mon, move_ob(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_NOATTACK, op_on_battleground(), out_of_map(), OUT_OF_REAL_MAP, pl::party, pl::peaceful, play_sound_map(), PLAYER, player_attack_door(), push_ob(), QUERY_FLAG, recursive_roll(), skill_attack(), SOUND_TYPE_LIVING, obj::speed, obj::speed_left, obj::stats, pl::tmp_invis, pl::transport, obj::type, pl::weapon_sp, obj::x, and obj::y.

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 obj::above, obj::attacktype, obj::contr, FABS, pl::fire_on, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, liv::hp, obj::level, llevError, LOG(), obj::map, liv::maxsp, move_object(), move_player(), obj::move_type, P_OUT_OF_MAP, mapdef::path, PLAYER, PLAYERMOVER, QUERY_FLAG, remove_ob(), rndm(), should_director_abort(), liv::sp, obj::speed, obj::speed_left, obj::stats, obj::type, obj::x, and obj::y.

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(), obj::attacktype, obj::count, liv::dam, draw_ext_info(), obj::env, FLAG_FREED, FREE_AND_COPY, free_object(), obj::head, hit_player(), insert_ob_in_map(), llevError, LOG(), obj::map, MAX, MAX_BUF, liv::maxhp, liv::maxsp, obj::more, obj::msg, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, obj::name_pl, NDI_RED, NDI_UNIQUE, obj::other_arch, QUERY_FLAG, remove_ob(), snprintf(), liv::sp, obj::stats, was_destroyed, obj::x, and obj::y.

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, obj::map, move_ob(), P_OUT_OF_MAP, obj::x, and obj::y.

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 obj::above, obj::enemy, FLAG_ALIVE, FLAG_UNAGGRESSIVE, get_map_flags(), GET_MAP_OB, obj::map, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::x, and obj::y.

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, obj::map, 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 obj::above, ARROW, AT_COUNTERSPELL, AT_MAGIC, obj::attacktype, BOW, FLAG_MONSTER, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, GOLEM, liv::maxhp, OB_SPELL_TAG_MATCH, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, Statistics::spell_suppressions, SPELL_TAG_SIZE, obj::spell_tags, statistics, obj::stats, obj::subtype, obj::type, and WEAPON.

Referenced by explosion(), and move_cone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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@.nosp@m.woos.nosp@m.world.nosp@m..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, obj::below, EXIT_ALT_X, EXIT_ALT_Y, EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FLAG_IS_FLOOR, FLAG_NO_PICK, FORCE, obj::inv, obj::name, obj::other_arch, QUERY_FLAG, obj::slaying, and obj::type.

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, FABS, obj::resist, obj::speed, and obj::speed_left.

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(), obj::map, MAX, MAX_SPACES, MOVE_ALL, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, obj::x, and obj::y.

Referenced by monster_cast_spell(), monster_use_range(), monster_use_scroll(), and monster_use_skill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::below, CONTAINER, fix_object(), FLAG_APPLIED, obj::inv, llevError, LOG(), pay_from_container(), QUERY_FLAG, query_money(), obj::race, and obj::type.

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 obj::below, change_exp(), CONTAINER, F_BUY, F_NO_BARGAIN, F_SHOP, FALSE, fix_object(), FLAG_APPLIED, FLAG_WAS_WIZ, obj::inv, llevError, LOG(), pay_from_container(), query_cost(), QUERY_FLAG, query_money(), obj::race, Settings::real_wiz, SET_FLAG, settings, SK_EXP_NONE, and obj::type.

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 obj::arch, ARCH_DEPLETION, obj::below, change_resist_msg, describe_item(), determine_god(), draw_ext_info(), draw_ext_info_format(), liv::exp, find_archetype(), find_god(), FORCE, get_attr_value(), obj::glow_radius, obj::inv, is_dragon_pl(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PERCEIVE_SELF, obj::name, archt::name, NDI_UNIQUE, NUM_STATS, present_arch_in_ob(), snprintf(), statname, obj::stats, obj::type, and VERY_BIG_BUF.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int pick_lock ( object pl,
int  dir,
object skill 
)

Lock pick handling.

Implementation by bt. (thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du) monster implementation 7-7-95 by bt.

Parameters
plplayer picking the lock.
dirdirection to pick.
skilllock picking skill.
Returns
experience for picking a lock, 0 if nothing was picked.

Definition at line 400 of file skills.c.

References obj::above, attempt_pick_lock(), calc_skill_exp(), DOOR, draw_ext_info(), obj::facing, freearr_x, freearr_y, GET_MAP_OB, LOCKED_DOOR, obj::map, obj::move_block, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, out_of_map(), obj::type, obj::x, and obj::y.

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 obj::below, can_pick(), obj::container, CONTAINER, obj::contr, obj::count, pl::count, draw_ext_info(), draw_ext_info_format(), obj::env, FLAG_APPLIED, FLAG_STARTEQUIP, INS_NO_MERGE, insert_ob_in_map(), obj::inv, llevDebug, LOG(), obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, obj::nrof, pick_up_object(), PLAYER, QUERY_FLAG, obj::race, sack_can_hold(), stop_item(), and obj::type.

Referenced by attempt_steal(), cast_create_missile(), cfapi_object_pickup(), check_pick(), command_take(), and esrv_move_object().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::chosen_skill, obj::contr, CS_QUERY_SINGLECHAR, FLAG_REMOVED, obj::map, QUERY_FLAG, remove_ob(), send_query(), pl::socket, ST_PLAY_AGAIN, and pl::state.

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
plobject causing op to be applied.
opobject being applied.
aflagspecial (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special().
quietif 1, suppresses the "don't know how to apply" and "you must get it first" messages as needed by 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 obj::anim_suffix, apply_anim_suffix(), obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), obj::env, FLAG_WAS_WIZ, FLAG_WIZ, free_object(), pl::last_used, pl::last_used_id, manual_apply(), MAX_BUF, METHOD_ERROR, METHOD_OK, METHOD_SILENT_ERROR, METHOD_UNHANDLED, MOVE_FLYING, obj::move_type, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, play_sound_map(), PLAYER, QUERY_FLAG, query_name(), remove_ob(), SOUND_TYPE_ITEM, and obj::type.

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 obj::below, obj::container, obj::contr, FLAG_IS_FLOOR, obj::inv, obj::invisible, METHOD_OK, obj::move_on, obj::move_type, ob_apply(), player_apply(), QUERY_FLAG, TRANSPORT, pl::transport, and obj::type.

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 obj::arch, pl::blocked_los, archt::clone, obj::contr, rv_vector::distance_x, rv_vector::distance_y, FABS, get_rangevector(), obj::head, llevError, LOG(), socket_struct::mapx, socket_struct::mapy, obj::more, PLAYER, pl::socket, obj::type, obj::x, and obj::y.

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, obj::map, 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_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 obj::arch, FABS, FLAG_ALIVE, FLAG_ANIMATE, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_PICK, obj::move_block, PLAYER, polymorph_item(), polymorph_living(), polymorph_melt(), QUERY_FLAG, rndm(), obj::speed, TREASURE, and obj::type.

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 obj::below, draw_ext_info(), liv::grace, HOLY_ALTAR, obj::last_grace, MAX_BUF, liv::maxgrace, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, obj::name, NDI_BLACK, obj::other_arch, PLAYER, pray_at_altar(), snprintf(), obj::stats, and obj::type.

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(), archt::clone, create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), EVENT_APPLY, execute_event(), liv::exp, obj::facing, find_god(), god_intervention(), liv::grace, obj::level, LOOSE_MANA, liv::luck, MAX, liv::maxgrace, move_player(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, obj::name, archt::name, NDI_NAVY, NDI_UNIQUE, obj::other_arch, PREFER_LOW, random_roll(), random_roll64(), SCRIPT_FIX_ALL, SK_SUBTRACT_SKILL_EXP, obj::skill, obj::stats, and liv::Wis.

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 obj::above, draw_ext_info(), examine_monster(), FLAG_ALIVE, FLAG_MONSTER, FLAG_WIZCAST, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, obj::map, 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, obj::range, SP_level_range_adjust(), obj::type, obj::x, and obj::y.

Referenced by cast_spell().

+ 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 obj::anim_speed, animate_object(), change_object(), obj::direction, EVENT_TIME, execute_event(), obj::facing, 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, liv::food, free_object(), generate_monster(), make_sure_not_seen(), make_sure_seen(), METHOD_OK, move_monster(), ob_process(), PLAYER, QUERY_FLAG, remove_force(), remove_ob(), SCRIPT_FIX_NOTHING, obj::state, obj::stats, obj::temp_anim_speed, obj::temp_animation_id, and obj::type.

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, obj::contr, draw_ext_info_format(), obj::enemy, esrv_map_scroll(), FLAG_FRIENDLY, FLAG_NEUTRAL, FLAG_SLEEP, FLAG_STAND_STILL, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_owner(), obj::head, insert_ob_in_map(), obj::level, socket_struct::look_position, obj::map, obj::more, move_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_PUSHED, obj::name, NDI_UNIQUE, pl::party, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), remove_ob(), pl::run_on, pl::socket, obj::stats, liv::Str, obj::type, socket_struct::update_look, obj::x, and obj::y.

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(), obj::below, CLEAR_FLAG, obj::container, CONTAINER, obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), obj::env, 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(), obj::inv, obj::map, MAX_BUF, obj::move_off, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, obj::nrof, PLAYER, QUERY_FLAG, query_name(), remove_ob(), sack_can_hold(), set_object_face_main(), obj::slaying, pl::socket, TRANSPORT, transport_can_hold(), obj::type, UPD_WEIGHT, socket_struct::update_look, obj::x, and obj::y.

Referenced by drop(), esrv_move_object(), 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 (mwede.nosp@m.l@py.nosp@m.ramid.nosp@m..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 obj::arch, liv::Cha, cha_bonus, archt::clone, obj::count, 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, liv::food, GEM, get_ob_key_value(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, obj::level, llevDebug, llevError, LOG(), obj::magic, obj::map, Settings::max_level, MIN, MONEY, obj::name, need_identify(), obj::nrof, mapdef::path, PLAYER, POTION, QUERY_FLAG, settings, shop_greed(), shop_specialisation_ratio(), shopkeeper_approval(), SK_BARGAINING, obj::stats, obj::type, obj::value, 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 archt::clone, cost_string_from_value(), F_APPROX, find_next_coin(), find_skill_by_number(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, LARGEST_COIN_GIVEN, MONEY, obj::name, obj::name_pl, query_cost(), real_money_value(), SK_BARGAINING, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_new(), obj::type, and obj::value.

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 obj::below, CONTAINER, FLAG_APPLIED, obj::inv, llevError, LOG(), MONEY, obj::nrof, PLAYER, QUERY_FLAG, obj::race, obj::type, and obj::value.

Referenced by can_pay(), cfapi_object_query_money(), get_payment(), pay_for_amount(), and pay_for_item().

+ 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(), obj::contr, draw_ext_info(), draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, pl::party, pl::party_to_join, party_struct::partyname, send_party_message(), snprintf(), ST_PLAYING, and pl::state.

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(), obj::contr, draw_ext_info(), FREE_AND_CLEAR_STR, free_object(), get_name(), get_player(), leave(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, obj::name, obj::name_pl, NDI_UNIQUE, pl::ob, pl::password, 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(), obj::contr, draw_ext_info(), FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, obj::name, pl::name_changed, obj::name_pl, NDI_UNIQUE, and pl::write_buf.

Referenced by reply_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::arch, archt::clone, create_archetype(), liv::dam, draw_ext_info(), draw_ext_info_format(), find_marked_object(), FLAG_ANIMATE, liv::food, free_object(), liv::hp, insert_ob_in_map(), obj::inv, obj::level, obj::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(), obj::speed, obj::stats, obj::type, update_ob_speed(), WAND, obj::x, and obj::y.

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 obj::above, FLAG_ALIVE, FLAG_REFL_SPELL, GET_MAP_OB, obj::level, 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.

References liv::hp, liv::maxhp, and obj::stats.

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, oblnk::next, oblnk::ob, on_same_map(), PLAYER, QUERY_FLAG, remove_friendly_object(), obj::speed, and obj::type.

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 obj::below, caster_level(), CLEAR_FLAG, draw_ext_info(), esrv_update_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, obj::inv, obj::level, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, obj::type, UPD_FLAGS, and obj::value.

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(), obj::level, obj::map, obj::other_arch, present(), remove_ob(), obj::speed, obj::speed_left, update_ob_speed(), obj::x, and obj::y.

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(), obj::level, LOCKED_DOOR, obj::map, obj::other_arch, present(), remove_ob(), obj::slaying, obj::speed, obj::speed_left, update_ob_speed(), obj::x, and obj::y.

Referenced by legacy_ob_process(), and player_attack_door().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, obj::below, calc_skill_exp(), liv::Cha, liv::exp, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::inv, obj::level, obj::map, obj::owner, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, obj::stats, TRAP, trap_disarm(), trap_show(), obj::type, obj::x, and obj::y.

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 obj::below, FLAG_UNPAID, free_object(), insert_ob_in_map(), obj::inv, obj::map, QUERY_FLAG, remove_ob(), obj::x, and obj::y.

Referenced by check_login(), and kill_player().

+ 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 obj::contr, CS_QUERY_SINGLECHAR, esrv_new_player(), send_query(), and pl::socket.

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 liv::ac, liv::Cha, liv::Con, obj::contr, liv::Dex, liv::exp, fix_object(), liv::grace, liv::hp, liv::Int, obj::level, pl::levgrace, pl::levhp, pl::levsp, liv::maxgrace, liv::maxhp, liv::maxsp, pl::orig_stats, liv::Pow, roll_stat(), liv::sp, obj::stats, liv::Str, and liv::Wis.

Referenced by get_player(), and key_roll_stat().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::carrying, CONTAINER, draw_ext_info_format(), FLAG_APPLIED, liv::food, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, query_name(), obj::race, obj::slaying, SPECIAL_KEY, obj::stats, liv::Str, obj::type, obj::weight, and obj::weight_limit.

Referenced by esrv_move_object(), pick_up(), and put_object_in_sack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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, obj::container, obj::contr, copy_file(), destroy_object(), liv::Dex, pl::digestion, draw_ext_info(), draw_ext_info_format(), Settings::emergency_mapname, esrv_send_inventory(), liv::exp, pl::explore, FLAG_NO_FIX_PLAYER, FLAG_WIZ, pl::gen_grace, pl::gen_hp, pl::gen_sp, liv::Int, obj::inv, key_inventory, keyrings, pl::language, pl::last_level, obj::level, pl::levgrace, pl::levhp, pl::levsp, pl::listening, llevDebug, Settings::localdir, LOG(), make_path_to_file(), obj::map, MAX_BUF, MIN, pl::mode, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, obj::name, 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, mapdef::path, 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, obj::stats, liv::Str, tempnam_secure(), terminate_all_pets(), Settings::tmpdir, TRUE, obj::type, pl::unapply, unapply_never, unapply_nochoice, unlink, pl::usekeys, pl::weapon_sp, liv::Wis, obj::x, and obj::y.

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, obj::below, cancellation(), create_archetype(), decrease_ob_nr(), did_make_save_item(), obj::env, find_archetype(), fix_stopped_item(), FLAG_IS_LIGHTABLE, FLAG_NO_PICK, FLAG_REMOVED, free_object(), insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::map, obj::move_slow, obj::move_slow_penalty, archt::name, obj::nrof, obj::other_arch, present_arch(), QUERY_FLAG, remove_ob(), replace_insert_ob_in_map(), obj::resist, rndm(), RUNE, spring_trap(), stop_item(), obj::type, obj::x, and obj::y.

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, liv::sp, Settings::spell_failure_effects, SPELL_WONDER, obj::stats, and TRUE.

Referenced by scroll_type_apply(), and spellbook_type_apply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::below, obj::carrying, change_exp(), archt::clone, coins, CONTAINER, copy_object(), obj::custom_name, 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(), obj::inv, LARGEST_COIN_GIVEN, llevDebug, llevError, LOG(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_SELL, NDI_UNIQUE, obj::nrof, PLAYER, query_cost(), query_cost_string(), QUERY_FLAG, query_name(), obj::race, SET_FLAG, SK_EXP_NONE, obj::stats, liv::Str, stringbuffer_finish(), obj::type, UPD_WEIGHT, obj::value, obj::weight, weight_limit, and obj::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 obj::contr, draw_ext_info(), first_player, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_WHITE, pl::next, pl::ob, and pl::party.

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 obj::arch, archt::clone, obj::face, FALSE, find_face(), get_ob_key_value(), new_faces, new_face_struct::number, 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(), FREE_AND_CLEAR_STR, and obj::skill.

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, obj::race, 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 obj::contr, get_real_owner(), llevError, LOG(), op_on_battleground(), pl::party, pet_arena, pl::petmode, PLAYER, and obj::type.

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.

References obj::arch, obj::name, archt::name, obj::race, obj::slaying, and obj::subtype.

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 obj::below, clipped_percent(), obj::contr, determine_god(), draw_ext_info(), draw_ext_info_format(), liv::exp, obj::expmul, obj::inv, pl::item_power, obj::level, level_exp(), MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_LIST, obj::name, NDI_RED, NDI_UNIQUE, NUM_SKILLS, obj::perm_exp, Settings::permanent_exp_ratio, settings, SKILL, snprintf(), obj::stats, and obj::type.

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, obj::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 obj::above, calc_skill_exp(), liv::Cha, 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, obj::head, liv::Int, obj::level, obj::map, 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, SIZEOFFREE, obj::stats, obj::type, obj::x, and obj::y.

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 thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du

Parameters
tmpvictim. Can be NULL.
plwho is attacking.
dirdirection to attack.
stringdescribes the damage ("claw", "punch", ...).
skillattack skill.
Returns
0 if no attack, non zero if an attack was done.

Definition at line 1126 of file skill_util.c.

References obj::above, obj::contr, do_skill_attack(), draw_ext_info(), obj::facing, FLAG_ALIVE, FLAG_CAN_ROLL, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, liv::hp, LOCKED_DOOR, obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, pl::party, PLAYER, QUERY_FLAG, obj::stats, obj::type, obj::x, and obj::y.

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, obj::subtype, obj::type, 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(), PLAYER, and obj::type.

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(), obj::dam_modifier, 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(), obj::duration_modifier, 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(), min_casting_level(), and obj::range_modifier.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_light(), cast_polymorph(), cast_smite_spell(), create_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(), liv::grace, obj::level, llevError, LOG(), MAX, liv::maxgrace, liv::maxsp, PATH_SP_MULT, settings, liv::sp, SPELL_GRACE, SPELL_HIGHEST, SPELL_MANA, Settings::spellpoint_level_depend, obj::stats, 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(), insert_ob_in_map(), obj::other_arch, obj::x, and obj::y.

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(), obj::count, create_archetype(), liv::dam, draw_ext_info(), FALSE, free_object(), get_map_flags(), hit_player(), insert_ob_in_map(), isqrt(), obj::level, LOOSE_MANA, obj::map, liv::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, P_NO_MAGIC, paralyze_living(), obj::range, settings, Settings::spell_failure_effects, SPELL_WONDER, obj::stats, obj::x, and obj::y.

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 obj::above, can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, freedir, get_map_flags(), GET_MAP_OB, obj::head, op_on_battleground(), P_BLOCKSVIEW, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, rndm(), SIZEOFFREE, and obj::type.

Referenced by move_ball_spell(), and move_missile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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(), archt::clone, obj::count, obj::direction, rv_vector::distance, draw_ext_info(), FLAG_ALIVE, FLAG_IS_LINKED, FLAG_IS_USED_UP, liv::food, free_object(), get_rangevector(), liv::hp, insert_ob_in_map(), obj::inv, obj::map, MAX, liv::maxhp, obj::msg, MSG_TYPE_APPLY, MSG_TYPE_APPLY_TRAP, NDI_UNIQUE, object_get_env_recursive(), obj::other_arch, PLAYER, QUERY_FLAG, remove_ob(), rune_attack(), SET_FLAG, SIGN, SPELL, obj::stats, trap_show(), obj::type, use_trigger(), was_destroyed, obj::x, and obj::y.

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, obj::glow_radius, isqrt(), obj::map, MAX_LIGHT_RADII, P_OUT_OF_MAP, obj::x, and obj::y.

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 obj::above, obj::contr, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, pl::hidden, obj::map, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::type, obj::x, and obj::y.

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 obj::contr, draw_ext_info(), draw_ext_info_format(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, obj::name, pl::name_changed, 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 obj::above, obj::attack_movement, attempt_steal(), obj::below, calc_skill_exp(), obj::contr, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, get_owner(), obj::head, pl::hidden, obj::map, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, QUERY_FLAG, obj::type, obj::x, and obj::y.

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(), obj::inv, obj::map, MIN_ACTIVE_SPEED, remove_ob(), obj::speed, THROWN_OBJ, and obj::type.

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 obj::duration, 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, obj::attack_movement, obj::attacktype, caster_level(), archt::clone, obj::contr, obj::count, liv::dam, determine_god(), determine_holy_arch(), obj::direction, draw_ext_info(), draw_ext_info_format(), obj::duration, liv::exp, 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, pl::golem_count, liv::hp, insert_ob_in_map(), llevError, LOG(), obj::map, MAX, MAX_BUF, liv::maxgrace, MIN, obj::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_PET, obj::name, NDI_UNIQUE, ob_blocked(), obj::other_arch, PETMOVE, PLAYER, QUERY_FLAG, obj::race, range_golem, pl::ranges, remove_ob(), obj::resist, SET_FLAG, set_owner(), set_spell_skill(), pl::shoottype, SIZEOFFREE1, obj::slaying, snprintf(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::speed, obj::speed_left, obj::stats, obj::type, liv::wc, obj::x, and obj::y.

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 
)
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, obj::attacktype, 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, obj::name, obj::name_pl, NDI_UNIQUE, obj::race, obj::slaying, snprintf(), SPELL, SPELL_EFFECT, obj::title, and obj::type.

Referenced by cast_cone(), cast_smite_spell(), explode_bullet(), fire_arch_from_position(), and fire_swarm().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, obj::arch, archt::clone, obj::contr, find_free_spot(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::head, insert_ob_in_map(), llevError, LOG(), obj::map, map_newmap_cmd(), obj::more, obj::name, OB_TYPE_MOVE_BLOCK, OUT_OF_REAL_MAP, P_OUT_OF_MAP, PLAYER, remove_ob(), SHOP_MAT, pl::socket, obj::type, obj::x, and obj::y.

Referenced by initteleport(), move_teleporter(), runteleport(), and shop_mat_type_move_on().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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(), oblnk::next, oblnk::ob, 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 obj::arch, archt::clone, obj::contr, find_first_free_spot(), find_free_spot(), freearr_x, freearr_y, obj::head, insert_ob_in_map(), obj::map, map_newmap_cmd(), obj::more, PLAYER, remove_ob(), SIZEOFFREE, pl::socket, obj::type, obj::x, and obj::y.

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.

References obj::carrying, obj::weight, and obj::weight_limit.

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, obj::attacktype, liv::Cha, liv::dam, obj::inv, obj::level, obj::other_arch, rndm(), and obj::stats.

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 liv::dam, destroy_object(), liv::Dex, mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), obj::inv, obj::level, obj::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, obj::owner, PLAYER, PREFER_LOW, random_roll(), spring_trap(), sqr, obj::stats, and obj::type.

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 liv::Cha, mapdef::difficulty, draw_ext_info_format(), obj::level, obj::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, PREFER_HIGH, random_roll(), and obj::stats.

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(), obj::face, GET_ANIMATION, insert_ob_in_map(), obj::map, new_faces, obj::x, and obj::y.

Referenced by find_traps(), remove_trap(), and spring_trap().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, attempt_do_alchemy(), obj::below, draw_ext_info_format(), esrv_send_inventory(), FLAG_APPLIED, FLAG_IS_CAULDRON, FLAG_UNPAID, GET_MAP_OB, obj::inv, obj::map, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, NDI_UNIQUE, query_base_name(), QUERY_FLAG, obj::x, and obj::y.

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. (thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du)

Parameters
plplayer trying to convince a monster.
dirdirection to orate in.
skilloratory skill object.
Returns
experience gained for oratoring.
Todo:
check if can't be simplified, code looks duplicated.

Definition at line 976 of file skills.c.

References obj::above, add_friendly_object(), obj::attack_movement, calc_skill_exp(), liv::Cha, CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), liv::exp, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FREE_AND_COPY, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), obj::head, liv::Int, obj::level, obj::map, MAX_BUF, obj::more, obj::msg, 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, set_owner(), obj::skill, obj::stats, obj::type, obj::x, and obj::y.

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 obj::below, do_skill(), draw_ext_info_format(), obj::facing, FLAG_CAN_USE_SKILL, obj::inv, llevDebug, LOG(), MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, QUERY_FLAG, SKILL, obj::skill, SKILL_TOOL, strncasecmp(), and obj::type.

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, INS_BELOW_ORIGINATOR, insert_ob_in_map(), llevInfo, LOG(), obj::map, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, obj::other_arch, obj::race, strcasestr_local(), obj::x, and obj::y.

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, archt::clone, draw_ext_info(), draw_ext_info_format(), find_marked_object(), find_skill_by_name(), FLAG_BLIND, FLAG_UNPAID, FLAG_WIZ, get_archetype_by_type_subtype(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, PLAYER, QUERY_FLAG, SCROLL, SK_LITERACY, SKILL, obj::skill, obj::type, write_note(), and write_scroll().

Referenced by do_skill(), and inscribe_scroll_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 obj::above, add_string(), arch_to_object(), obj::below, blank_face, caster_level(), liv::Cha, copy_object(), create_archetype(), obj::direction, draw_ext_info(), draw_ext_info_format(), obj::face, freearr_x, freearr_y, GENERIC_RUNE, get_map_flags(), GET_MAP_OB, get_object(), liv::grace, insert_ob_in_map(), insert_ob_in_ob(), obj::inv, item_matched_string(), obj::level, obj::map, MAX_BUF, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, obj::other_arch, obj::path_attuned, obj::path_denied, RUNE, set_owner(), set_spell_skill(), obj::skill, snprintf(), liv::sp, SP_level_spellpoint_cost(), SPELL, SPELL_GRACE, SPELL_MANA, obj::stats, obj::type, obj::x, and obj::y.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: