Crossfire Server, Trunk
sproto.h File Reference

Go to the source code of this file.

Functions

int account_change_password (const char *account_name, const char *current_password, const char *new_password)
 
void account_char_add (Account_Chars *chars, player *pl)
 
void account_char_free (Account_Chars *chars)
 
Account_Charsaccount_char_load (const char *account_name)
 
void account_char_remove (Account_Chars *chars, const char *pl_name)
 
void account_char_save (Account_Chars *chars)
 
int account_check_string (const char *str)
 
const char * account_exists (const char *account_name)
 
const char * account_get_account_for_char (const char *charname)
 
linked_characcount_get_additional_chars (const char *account_name, const Account_Chars *chars, int *count)
 
char ** account_get_players_for_account (const char *account_name)
 
int account_is_logged_in (const char *name)
 
int account_link (const char *account_name, const char *player_name)
 
int account_login (const char *account_name, const char *account_password)
 
void account_logout (const char *account_name)
 
int account_new (const char *account_name, const char *account_password)
 
int account_remove_player (const char *account_name, const char *player_name)
 
void accounts_clear (void)
 
void accounts_load (void)
 
void accounts_save (void)
 
playeradd_player (socket_struct *ns, int flags)
 
void add_server_collect_hooks ()
 
int alchemy (object *op, object *caster, object *spell_ob)
 
int animate_weapon (object *op, object *caster, object *spell, int dir)
 
int apply_auto (object *op)
 
void apply_auto_fix (mapstruct *m)
 
void apply_builder_remove (object *pl, int dir)
 
int apply_by_living (object *pl, object *op, int aflag, int quiet)
 
void apply_by_living_below (object *pl)
 
int apply_can_apply_object (const object *who, const object *op)
 
void apply_changes_to_player (object *pl, object *change, int limit_stats)
 
int apply_check_weapon_power (const object *who, int improves)
 
int apply_container (object *op, object *sack, int aflags)
 
void apply_handle_yield (object *tmp)
 
int apply_manual (object *op, object *tmp, int aflag)
 
void apply_map_builder (object *pl, int dir)
 
int apply_race_and_class (object *op, archetype *race, archetype *opclass, living *stats)
 
int apply_special (object *who, object *op, int aflags)
 
int attack_ob (object *op, object *hitter)
 
int become_follower (object *op, const object *new_god)
 
void blind_living (object *op, object *hitter, int dam)
 
int64_t calc_skill_exp (const object *who, const object *op, const object *skill)
 
bool can_follow (object *op, player *other)
 
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 *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 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_bless (object *op, 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)
 
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)
 
void change_object (object *op)
 
int change_skill (object *who, object *new_skill, int flag)
 
void check_active_maps (void)
 
void check_bullet (object *op)
 
void check_login (object *op, const char *password)
 
int check_name (player *me, const char *name)
 
bool check_password (const char *typed, const char *crypted)
 
void check_physically_infect (object *victim, object *hitter)
 
int check_pick (object *op)
 
int check_race_and_class (living *stats, archetype *race, archetype *opclass)
 
void check_spell_expiry (object *spell)
 
objectcheck_spell_known (object *op, const char *name)
 
int checkbanned (const char *login, const char *host)
 
void clean_tmp_files (void)
 
void cleanup (void)
 
void cleanupPlugins (void)
 
void clear_skill (object *who)
 
void close_modules ()
 
void command_abil (object *op, const char *params)
 
void command_accountpasswd (object *op, const char *params)
 
void command_accuse (object *op, const char *params)
 
void command_addexp (object *op, const char *params)
 
void command_afk (object *op, const char *params)
 
void command_apply (object *op, const char *params)
 
void command_applymode (object *op, const char *params)
 
void command_archs (object *op, const char *params)
 
void command_arrest (object *op, const char *params)
 
void command_banish (object *op, const char *params)
 
void command_beg (object *op, const char *params)
 
void command_bleed (object *op, const char *params)
 
void command_blush (object *op, const char *params)
 
void command_body (object *op, const char *params)
 
void command_bounce (object *op, const char *params)
 
void command_bow (object *op, const char *params)
 
void command_bowmode (object *op, const char *params)
 
void command_brace (object *op, const char *params)
 
void command_burp (object *op, const char *params)
 
void command_cackle (object *op, const char *params)
 
void command_cast (object *op, const char *params)
 
void command_cast_spell (object *op, const char *params, int cast_now)
 
void command_chat (object *op, const char *params)
 
void command_chuckle (object *op, const char *params)
 
void command_clap (object *op, const char *params)
 
void command_cointoss (object *op, const char *params)
 
void command_cough (object *op, const char *params)
 
void command_create (object *op, const char *params)
 
void command_cringe (object *op, const char *params)
 
void command_cry (object *op, const char *params)
 
void command_dance (object *op, const char *params)
 
void command_debug (object *op, const char *params)
 
void command_delete (object *op, const char *params)
 
void command_diff (object *op, const char *params)
 
void command_disarm (object *op, const char *params)
 
void command_dm (object *op, const char *params)
 
void command_dmhide (object *op, const char *params)
 
void command_dmtell (object *op, const char *params)
 
void command_drop (object *op, const char *params)
 
void command_dropall (object *op, const char *params)
 
void command_dump (object *op, const char *params)
 
void command_dumpabove (object *op, const char *params)
 
void command_dumpallarchetypes (object *op, const char *params)
 
void command_dumpallmaps (object *op, const char *params)
 
void command_dumpallobjects (object *op, const char *params)
 
void command_dumpbelow (object *op, const char *params)
 
void command_dumpfriendlyobjects (object *op, const char *params)
 
void command_dumpmap (object *op, const char *params)
 
void command_east (object *op, const char *params)
 
void command_empty (object *op, const char *params)
 
void command_examine (object *op, const char *params)
 
void command_execute (object *pl, char *command)
 
void command_face (object *op, const char *params)
 
void command_fire (object *op, const char *params)
 
void command_fire_stop (object *op, const char *params)
 
void command_fix_me (object *op, const char *params)
 
void command_flip (object *op, const char *params)
 
void command_follow (object *op, const char *params)
 
void command_forget_spell (object *op, const char *params)
 
void command_free (object *op, const char *params)
 
void command_freeze (object *op, const char *params)
 
void command_frown (object *op, const char *params)
 
void command_gasp (object *op, const char *params)
 
void command_giggle (object *op, const char *params)
 
void command_glare (object *op, const char *params)
 
void command_goto (object *op, const char *params)
 
void command_grin (object *op, const char *params)
 
void command_groan (object *op, const char *params)
 
void command_growl (object *op, const char *params)
 
void command_gsay (object *op, const char *params)
 
void command_help (object *op, const char *params)
 
void command_hiccup (object *op, const char *params)
 
void command_hide (object *op, const char *params)
 
void command_hiscore (object *op, const char *params)
 
void command_hug (object *op, const char *params)
 
void command_insert_into (object *op, const char *params)
 
void command_inventory (object *op, const char *params)
 
void command_invisible (object *op, const char *params)
 
void command_invoke (object *op, const char *params)
 
void command_kick (object *op, const char *params)
 
void command_kill_pets (object *op, const char *params)
 
void command_kiss (object *op, const char *params)
 
void command_knowledge (object *pl, const char *params)
 
void command_language (object *op, const char *params)
 
void command_laugh (object *op, const char *params)
 
void command_learn_special_prayer (object *op, const char *params)
 
void command_learn_spell (object *op, const char *params)
 
void command_lick (object *op, const char *params)
 
void command_list (object *pl, bool is_dm)
 
void command_listen (object *op, const char *params)
 
void command_listplugins (object *op, const char *params)
 
void command_loadplugin (object *op, const char *params)
 
void command_loadtest (object *op, const char *params)
 
void command_lock_item (object *op, const char *params)
 
void command_malloc (object *op, const char *params)
 
void command_mapinfo (object *op, const char *params)
 
void command_maps (object *op, const char *params)
 
void command_mark (object *op, const char *params)
 
void command_me (object *op, const char *params)
 
void command_mon_aggr (object *op, const char *params)
 
void command_motd (object *op, const char *params)
 
void command_news (object *op, const char *params)
 
void command_nod (object *op, const char *params)
 
void command_north (object *op, const char *params)
 
void command_northeast (object *op, const char *params)
 
void command_northwest (object *op, const char *params)
 
void command_nowiz (object *op, const char *params)
 
void command_orcknuckle (object *op, const char *params)
 
void command_overlay_reset (object *op, const char *params)
 
void command_overlay_save (object *op, const char *params)
 
void command_party (object *op, const char *params)
 
void command_party_rejoin (object *op, const char *params)
 
void command_passwd (object *pl, const char *params)
 
void command_patch (object *op, const char *params)
 
void command_peaceful (object *op, const char *params)
 
void command_petmode (object *op, const char *params)
 
void command_pickup (object *op, const char *params)
 
void command_players (object *op, const char *params)
 
void command_poke (object *op, const char *params)
 
void command_possess (object *op, const char *params)
 
void command_pout (object *op, const char *params)
 
void command_printlos (object *op, const char *params)
 
void command_puke (object *op, const char *params)
 
void command_purge_quest (object *op, const char *param)
 
void command_purge_quest_definitions (object *op, const char *param)
 
void command_quest (object *op, const char *params)
 
void command_quit (object *op, const char *params)
 
void command_recollect (object *op, const char *params)
 
command_registration command_register (const char *name, uint8_t type, command_function func, float time)
 
command_registration command_register_extra (const char *name, const char *extra, uint8_t type, command_function_extra func, float time)
 
void command_remove (object *op, const char *params)
 
void command_rename_item (object *op, const char *params)
 
void command_reply (object *op, const char *params)
 
void command_reset (object *op, const char *params)
 
void command_resistances (object *op, const char *params)
 
void command_rotateshoottype (object *op, const char *params)
 
void command_rskill (object *pl, const char *params)
 
void command_rules (object *op, const char *params)
 
void command_run (object *op, const char *params)
 
void command_run_stop (object *op, const char *params)
 
void command_save (object *op, const char *params)
 
void command_say (object *op, const char *params)
 
void command_scream (object *op, const char *params)
 
void command_search (object *op, const char *params)
 
void command_search_items (object *op, const char *params)
 
void command_setgod (object *op, const char *params)
 
void command_settings (object *op, const char *ignored)
 
void command_shake (object *op, const char *params)
 
void command_shiver (object *op, const char *params)
 
void command_shout (object *op, const char *params)
 
void command_showpets (object *op, const char *params)
 
void command_shrug (object *op, const char *params)
 
void command_shutdown (object *op, const char *params)
 
void command_sigh (object *op, const char *params)
 
void command_skills (object *op, const char *params)
 
void command_slap (object *op, const char *params)
 
void command_smile (object *op, const char *params)
 
void command_smirk (object *op, const char *params)
 
void command_snap (object *op, const char *params)
 
void command_sneeze (object *op, const char *params)
 
void command_snicker (object *op, const char *params)
 
void command_sniff (object *op, const char *params)
 
void command_snore (object *op, const char *params)
 
void command_sound (object *op, const char *params)
 
void command_south (object *op, const char *params)
 
void command_southeast (object *op, const char *params)
 
void command_southwest (object *op, const char *params)
 
void command_speed (object *op, const char *params)
 
void command_spit (object *op, const char *params)
 
void command_ssdumptable (object *op, const char *params)
 
void command_stack_clear (object *op, const char *params)
 
void command_stack_list (object *op, const char *params)
 
void command_stack_pop (object *op, const char *params)
 
void command_stack_push (object *op, const char *params)
 
void command_statistics (object *pl, const char *params)
 
void command_stats (object *op, const char *params)
 
void command_stay (object *op, const char *params)
 
void command_strings (object *op, const char *params)
 
void command_strut (object *op, const char *params)
 
void command_style_map_info (object *op, const char *params)
 
void command_sulk (object *op, const char *params)
 
void command_summon (object *op, const char *params)
 
void command_take (object *op, const char *params)
 
void command_teleport (object *op, const char *params)
 
void command_tell (object *op, const char *params)
 
void command_thank (object *op, const char *params)
 
void command_think (object *op, const char *params)
 
void command_throw (object *op, const char *params)
 
void command_time (object *op, const char *params)
 
void command_title (object *op, const char *params)
 
void command_toggle_shout (object *op, const char *params)
 
void command_twiddle (object *op, const char *params)
 
void command_unarmed_skill (object *op, const char *params)
 
void command_unloadplugin (object *op, const char *params)
 
void command_unregister (command_registration command)
 
void command_use (object *op, const char *params)
 
void command_usekeys (object *op, const char *params)
 
void command_uskill (object *pl, const char *params)
 
void command_version (object *op, const char *params)
 
void command_wave (object *op, const char *params)
 
void command_west (object *op, const char *params)
 
void command_whereabouts (object *op, const char *params)
 
void command_whereami (object *op, const char *params)
 
void command_whistle (object *op, const char *params)
 
void command_who (object *op, const char *params)
 
void command_wimpy (object *op, const char *params)
 
void command_wink (object *op, const char *params)
 
void command_wizcast (object *op, const char *params)
 
void command_wizpass (object *op, const char *params)
 
void command_yawn (object *op, const char *params)
 
void commands_clear ()
 
void commands_init (void)
 
void cone_drop (object *op)
 
void confirm_password (object *op)
 
void confuse_living (object *op, object *hitter, int dam)
 
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)
 
int cure_disease (object *sufferer, object *caster, sstring skill)
 
void dead_player (object *op)
 
void delete_character (const char *name)
 
void destroy_object (object *op)
 
int detect_curse_on_item (object *pl, object *tmp, object *skill)
 
int detect_magic_on_item (object *pl, object *tmp, object *skill)
 
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 *skill, int dir)
 
void display_motd (const object *op)
 
void do_dump (object *who, object *what)
 
void do_forget_spell (object *op, const char *spell)
 
void do_goto (object *op, const char *name, int x, int y)
 
void 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)
 
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_t nrof)
 
void dump_quests (void)
 
void dump_races (void)
 
void dump_spells (void)
 
void emergency_save (int flag)
 
void enter_exit (object *op, object *exit_ob)
 
void enter_player_maplevel (object *op)
 
void enter_player_savebed (object *op)
 
void examine (object *op, object *tmp)
 
void examine_monster (object *op, object *tmp, int level)
 
void explode_bullet (object *op)
 
int face_player (object *op, int dir)
 
objectfind_applied_skill_by_name (const object *op, const char *name)
 
objectfind_key (object *pl, object *container, object *door)
 
objectfind_marked_object (object *op)
 
playerfind_player (const char *plname)
 
playerfind_player_options (const char *plname, int options, const mapstruct *map)
 
playerfind_player_partial_name (const char *plname)
 
playerfind_player_socket (const socket_struct *ns)
 
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 finish_races ()
 
void fire (object *op, int dir)
 
int fire_arch_from_position (object *op, object *caster, int16_t x, int16_t y, int dir, object *spell)
 
int fire_bolt (object *op, object *caster, int dir, object *spob)
 
int fire_bow (object *op, object *arrow, int dir, int wc_mod, int16_t sx, int16_t sy)
 
int fire_swarm (object *op, object *caster, object *spell, int dir)
 
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)
 
int forbid_play (void)
 
void free_knowledge (void)
 
int free_no_drop (object *op)
 
void free_quest (void)
 
void free_quest_definitions (void)
 
void free_races (void)
 
void free_server (void)
 
int friendly_fire (object *op, object *hitter)
 
void get_attack_message_for_attack_type (int dam, uint8_t atm_type, const char *victim_name, char *buf1, char *buf2)
 
void get_name (object *op)
 
objectget_nearest_criminal (object *mon)
 
objectget_nearest_player (object *mon)
 
int get_party_password (object *op, partylist *party)
 
void get_password (object *op)
 
playerget_player (player *p)
 
const char * get_reply_text_own (reply_type rt)
 
void give_initial_items (object *pl, treasurelist *items)
 
int handle_newcs_player (object *op)
 
int hide (object *op, object *skill)
 
int hideability (object *ob)
 
void hiscore_check (object *op, int quiet)
 
void hiscore_display (object *op, int max, const char *match)
 
void hiscore_init (void)
 
int hit_map (object *op, int dir, uint32_t type, int full_hit)
 
int hit_player (object *op, int dam, object *hitter, uint32_t type, int full_hit)
 
objecthit_with_arrow (object *op, object *victim)
 
int identify_object_with_skill (object *tmp, object *pl, object *skill, int print_on_success)
 
int infect_object (object *victim, object *disease, int force)
 
void init (int argc, char **argv)
 
void init_ob_methods (void)
 
void init_signals ()
 
void init_skills (void)
 
void initPlugins (void)
 
void inventory (object *op, object *inv)
 
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, const object *killer)
 
void knowledge_add_probe_monster (object *op, object *mon)
 
void knowledge_first_player_save (player *pl)
 
void knowledge_give (player *pl, const char *marker, const object *book)
 
void knowledge_item_can_be_used_alchemy (object *op, const object *item)
 
int knowledge_player_knows (const player *pl, const char *knowledge)
 
void knowledge_process_incremental (void)
 
void knowledge_read (player *pl, object *book)
 
void knowledge_send_info (socket_struct *ns)
 
void knowledge_send_known (player *pl)
 
int learn_skill (object *pl, object *scroll)
 
void leave (player *pl, int draw_exit)
 
void legacy_animate_trigger (object *op)
 
void legacy_move_hole (object *op)
 
void legacy_remove_force (object *op)
 
int legal_range (object *op, int r)
 
void list_players (object *op, region *reg, partylist *party)
 
void load_races (BufferReader *reader, const char *filename)
 
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)
 
bool map_can_reset (const mapstruct *map, long current_time)
 
void meditate (object *pl, object *skill)
 
int min_casting_level (const object *caster, const object *spell)
 
int monster_can_detect_enemy (object *op, object *enemy, rv_vector *rv)
 
int monster_can_see_enemy (object *op, object *enemy)
 
void monster_check_apply_all (object *monster)
 
void monster_check_doors (object *op, mapstruct *m, int x, int y)
 
void monster_check_earthwalls (object *op, mapstruct *m, int x, int y)
 
objectmonster_check_enemy (object *npc, rv_vector *rv)
 
void monster_communicate (object *op, const char *txt)
 
int monster_compute_path (object *source, object *target, int default_dir)
 
void monster_do_living (object *op)
 
void monster_do_say (const mapstruct *map, const char *message)
 
objectmonster_find_nearest_enemy (object *npc, object *owner)
 
objectmonster_find_throw_ob (object *op)
 
int monster_move (object *op)
 
void monster_npc_call_help (object *op)
 
void monster_npc_say (object *npc, const char *cp)
 
int monster_stand_in_light (object *op)
 
int mood_change (object *op, object *caster, object *spell)
 
int move_disease (object *disease)
 
void move_firewall (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)
 
char const * newhash (char const *password)
 
int object_teleport (object *op, mapstruct *map, int x, int y)
 
int ok_to_put_more (mapstruct *m, int16_t x, int16_t y, object *op, uint32_t immune_stop)
 
int op_on_battleground (object *op, int *x, int *y, archetype **trophy)
 
void paralyze_living (object *op, int dam)
 
int party_confirm_password (const partylist *party, const char *password)
 
partylistparty_find (const char *partyname)
 
partylistparty_form (object *op, const char *partyname)
 
partylistparty_get_first (void)
 
const char * party_get_leader (const partylist *party)
 
partylistparty_get_next (const partylist *party)
 
const char * party_get_password (const partylist *party)
 
void party_join (object *op, partylist *party)
 
void party_leave (object *op)
 
void party_obsolete_parties (void)
 
void party_remove (partylist *party)
 
void party_send_message (object *op, const char *message)
 
void party_set_password (partylist *party, const char *password)
 
int path_to_player (object *mon, object *pl, unsigned mindiff)
 
int perceive_self (object *op)
 
void pets_attempt_follow (object *for_owner, int force)
 
void pets_control_golem (object *op, int dir)
 
void pets_follow_owner (object *ob, object *owner)
 
objectpets_get_enemy (object *pet, rv_vector *rv)
 
void pets_move (object *ob)
 
void pets_move_golem (object *op)
 
int pets_should_arena_attack (object *pet, object *owner, object *target)
 
int pets_summon_golem (object *op, object *caster, int dir, object *spob)
 
int pets_summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 
void pets_terminate_all (object *owner)
 
int pick_lock (object *pl, int dir, object *skill)
 
void pick_up (object *op, object *alt)
 
void play_again (object *op)
 
int player_arrest (object *who)
 
bool player_can_find (object *op, object *ob)
 
int player_can_view (object *pl, object *op)
 
SockListplayer_get_delayed_buffer (player *pl)
 
void player_set_state (player *pl, uint8_t state)
 
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)
 
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, int level)
 
void process_events (void)
 
void 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_t nrof)
 
void quest_first_player_save (player *pl)
 
int quest_get_player_state (player *pl, sstring quest_code)
 
void quest_load_definitions (void)
 
void quest_send_initial_states (player *pl)
 
void quest_set_player_state (player *pl, sstring quest_code, int state)
 
void quest_start (player *pl, sstring quest_code, int state)
 
int quest_was_completed (player *pl, sstring quest_code)
 
objectraces_get_random_monster (const char *race, int level)
 
void read_map_log (void)
 
void receive_party_password (object *op, const char *password)
 
void receive_play_again (object *op, char key)
 
void receive_player_name (object *op, const char *name)
 
void receive_player_password (object *op, const char *password)
 
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)
 
int remove_curse (object *op, object *caster, object *spell)
 
void remove_door (object *op)
 
void remove_locked_door (object *op)
 
int remove_trap (object *op, object *skill)
 
void remove_unpaid_objects (object *op, object *env, int free_items)
 
void rod_adjust (object *rod)
 
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_t nrof)
 
int save_player (object *op, int flag)
 
void save_throw_object (object *op, uint32_t type, object *originator)
 
void scroll_failure (object *op, int failure, int power)
 
void send_news (const object *op)
 
void send_rules (const object *op)
 
void server_main (int argc, char *argv[])
 
void set_darkness_map (mapstruct *m)
 
void set_first_map (object *op)
 
void set_map_timeout (mapstruct *oldmap)
 
int set_object_face_main (object *op)
 
void set_player_socket (player *p, socket_struct *ns)
 
void set_spell_skill (object *op, object *caster, object *spob, object *dest)
 
int should_director_abort (const object *op, const object *victim)
 
void show_skills (object *op, const char *search)
 
void shuffle_attack (object *op)
 
int singing (object *pl, int dir, object *skill)
 
void 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, object *skill)
 
int slow_living_by (object *op, const int speed_penalty)
 
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)
 
int16_t SP_level_spellpoint_cost (object *caster, object *spell, int flags)
 
int SP_level_wc_adjust (const object *caster, const object *spob)
 
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_near_hostile (object *who)
 
int steal (object *op, int dir, object *skill)
 
objectstop_item (object *op)
 
void store_spell_expiry (object *spell)
 
int summon_hostile_monsters (object *op, int n, const char *monstername)
 
int swap_map (mapstruct *map)
 
int tailor_god_spell (object *spellop, object *caster)
 
int teleport (object *teleporter, uint8_t tele_type, object *user)
 
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)
 
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 verify_player (const char *name, char *password)
 
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

◆ account_change_password()

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

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

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

Definition at line 628 of file account.cpp.

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

Referenced by account_password(), and command_accountpasswd().

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

◆ account_char_add()

void account_char_add ( Account_Chars chars,
player pl 
)

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

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

Definition at line 207 of file account_char.cpp.

References add_string(), Account_Char::character_class, Account_Chars::chars, Account_Char::face, free_string(), Account_Char::isDead, Account_Char::level, Account_Char::map, Account_Char::name, Account_Char::party, altar_valkyrie::pl, and Account_Char::race.

Referenced by save_player(), and START_TEST().

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

◆ account_char_free()

void account_char_free ( Account_Chars chars)

This frees all data associated with the character information.

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

Definition at line 345 of file account_char.cpp.

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

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

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

◆ account_char_load()

Account_Chars* account_char_load ( const char *  account_name)

For a given account name, load the character information and return it. It is the responsibility of the caller to call account_char_free() on the returned value to free it.

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

Definition at line 135 of file account_char.cpp.

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

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

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

◆ account_char_remove()

void account_char_remove ( Account_Chars chars,
const char *  pl_name 
)

This removes a character on this account. This is typically used when a character has been deleted, and not for general cleanup

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

Definition at line 313 of file account_char.cpp.

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

+ Here is the call graph for this function:

◆ account_char_save()

void account_char_save ( Account_Chars chars)

Saves the character information for the given account.

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

Definition at line 158 of file account_char.cpp.

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

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

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

◆ account_check_string()

int account_check_string ( const char *  str)

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

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

Definition at line 361 of file account.cpp.

References MAX_NAME, and make_face_from_files::str.

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

+ Here is the caller graph for this function:

◆ account_exists()

const char* account_exists ( const char *  account_name)

Checks the existing accounts, and see if this account exists. This can also be used to get the official name for the account (eg, as user first entered, so Mark instead of mARk)

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

Definition at line 297 of file account.cpp.

References curse_on_apply::ac, accounts, and strcasecmp().

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

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

◆ account_get_account_for_char()

const char* account_get_account_for_char ( const char *  charname)

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

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

Definition at line 580 of file account.cpp.

References curse_on_apply::ac, accounts, and guildjoin::charname.

Referenced by account_add_player_cmd(), and save_player().

+ Here is the caller graph for this function:

◆ account_get_additional_chars()

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

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

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

Definition at line 551 of file account.cpp.

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

Referenced by send_account_players().

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

◆ account_get_players_for_account()

char** account_get_players_for_account ( const char *  account_name)

Returns an array of strings for the characters on this account - the array is null terminated. In fact, it just returns the ac->character_names.

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

Definition at line 520 of file account.cpp.

References curse_on_apply::ac, accounts, and strcasecmp().

Referenced by account_play_cmd(), and START_TEST().

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

◆ account_is_logged_in()

int account_is_logged_in ( const char *  name)

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

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

Definition at line 605 of file account.cpp.

References accounts_logged_in, and give::name.

Referenced by account_add_player_cmd().

+ Here is the caller graph for this function:

◆ account_link()

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

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

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

Definition at line 445 of file account.cpp.

References curse_on_apply::ac, accounts, ensure_available_characters(), strcasecmp(), and strdup_local.

Referenced by account_add_player_cmd(), save_player(), and START_TEST().

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

◆ account_login()

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

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

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

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

Definition at line 319 of file account.cpp.

References curse_on_apply::ac, account_password(), accounts, accounts_logged_in, check_password(), and strcasecmp().

Referenced by account_login_cmd().

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

◆ account_logout()

void account_logout ( const char *  account_name)

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

Definition at line 338 of file account.cpp.

References accounts_logged_in.

Referenced by free_newsocket().

+ Here is the caller graph for this function:

◆ account_new()

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

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

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

Definition at line 400 of file account.cpp.

References curse_on_apply::ac, account_alloc(), account_check_string(), account_exists(), account_password(), accounts, accounts_loaded, newhash(), and strdup_local.

Referenced by account_new_cmd(), and START_TEST().

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

◆ account_remove_player()

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

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

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

Definition at line 475 of file account.cpp.

References curse_on_apply::ac, accounts, push::match, and strcasecmp().

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

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

◆ accounts_clear()

void accounts_clear ( void  )

This is used purely by the test harness - by clearing the accounts, it can then verify that the data is added is loaded back into memory properly. As such, we don't worry about memory cleanup, etc.

Definition at line 153 of file account.cpp.

References accounts, and accounts_loaded.

Referenced by START_TEST().

+ Here is the caller graph for this function:

◆ accounts_load()

void accounts_load ( void  )

This loads all the account entries into memory. It is presumed to only be called once during the program startup.

Definition at line 162 of file account.cpp.

References curse_on_apply::ac, account_alloc(), ACCOUNT_FILE, accounts, accounts_loaded, buf, bufferreader_destroy(), bufferreader_init_from_file(), bufferreader_next_line(), ensure_available_characters(), llevError, llevInfo, Settings::localdir, LOG(), MAX_BUF, NUM_ACCOUNT_FIELDS, settings, split_string(), strdup_local, and Ice::tmp.

Referenced by init(), and START_TEST().

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

◆ accounts_save()

void accounts_save ( void  )

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

Definition at line 256 of file account.cpp.

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

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

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

◆ add_player()

player* add_player ( socket_struct ns,
int  flags 
)

Tries to add player on the connection passwd in ns.

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

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

Definition at line 460 of file player.cpp.

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

Referenced by add_me_cmd(), create_player_cmd(), and START_TEST().

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

◆ add_server_collect_hooks()

void add_server_collect_hooks ( )

Definition at line 1071 of file init.cpp.

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

Referenced by init(), and ResourcesManager::load().

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

◆ alchemy()

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

Change items to gold nuggets. Only works for players.

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

Definition at line 2304 of file spell_effect.cpp.

References alchemy_object(), object::duration, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, MOVE_WALK, give::op, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, QUERY_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by cast_spell().

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

◆ animate_weapon()

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

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

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

Definition at line 3063 of file spell_effect.cpp.

References disinfect::a, add_friendly_object(), add_string(), object::anim_speed, object::animation, object::arch, arch_to_object(), AT_PHYSICAL, ATNR_BLIND, ATNR_CONFUSION, ATNR_DEATH, ATNR_DEPLETE, ATNR_FEAR, ATNR_PARALYZE, ATNR_PHYSICAL, ATNR_POISON, ATNR_SLOW, ATNR_TURN_UNDEAD, buf, caster_level(), CLEAR_FLAG, archetype::clone, living::Con, living::dam, living::Dex, draw_ext_info(), draw_ext_info_format(), object::duration, esrv_update_item(), object::face, find_marked_object(), fix_object(), FLAG_ANIMATE, FLAG_APPLIED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_REMOVED, FLAG_UNPAID, FLAG_USE_WEAPON, free_string(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GOLEM, make_face_from_files::int, object::last_anim, llevError, LOG(), m, object::magic, MAX, MAX_BUF, living::maxgrace, object::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, archetype::name, name_to_material(), NDI_BLACK, NDI_UNIQUE, object::nrof, NROFATTACKS, object_find_free_spot(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_owner(), object_split(), object_update_speed(), give::op, object::other_arch, P_OUT_OF_MAP, pets_control_golem(), PLAYER, QUERY_FLAG, query_name(), object::race, range_golem, materialtype_t::save, SET_FLAG, set_spell_skill(), living::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::state, object::stats, living::Str, Ice::tmp, object::type, UPD_NROF, WEAPON, diamondslots::x, and diamondslots::y.

Referenced by cast_spell().

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

◆ apply_auto()

int apply_auto ( object op)

Map was just loaded, handle op's initialization.

Generates shop floor's item, and treasures.

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

Definition at line 211 of file main.cpp.

References BOOK, CLEAR_FLAG, create_treasure(), FLAG_AUTO_APPLY, FLAG_BLESSED, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_IS_A_TEMPLATE, FLAG_KNOWN_MAGICAL, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, FREE_OBJ_NO_DESTROY_CALLBACK, generate_treasure(), GT_ENVIRONMENT, GT_ONLY_GOOD, HAS_RANDOM_ITEMS, identify(), is_magical(), MAX, object_free(), object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), give::op, QUERY_FLAG, SET_FLAG, SHOP_FLOOR, Ice::tmp, and TREASURE.

Referenced by apply_auto_fix(), auto_apply_fix_inventory(), and do_auto_apply().

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

◆ apply_auto_fix()

void apply_auto_fix ( mapstruct m)

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

Parameters
mmap to fix.

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

Definition at line 258 of file main.cpp.

References apply_auto(), auto_apply_fix_inventory(), check_trigger(), CLASS, CONTAINER, create_treasure(), FLAG_AUTO_APPLY, FLAG_IS_LINKED, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, GET_MAP_OB, HAS_RANDOM_ITEMS, HEAD, m, MAP_HEIGHT, MAP_WIDTH, monster_check_apply_all(), object_update_speed(), PLAYER, PLAYER_CHANGER, QUERY_FLAG, SPELL, TIMED_GATE, Ice::tmp, TREASURE, TRIGGER_BUTTON, TRIGGER_PEDESTAL, nlohmann::detail::void(), diamondslots::x, and diamondslots::y.

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

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

◆ apply_builder_remove()

void apply_builder_remove ( object pl,
int  dir 
)

Item remover.

Removes first buildable item, either under or above the floor

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

Definition at line 890 of file build_map.cpp.

References BUTTON, CF_HANDLE, DETECTOR, DOOR, draw_ext_info(), draw_ext_info_format(), FLAG_IS_FLOOR, FLAG_IS_LINKED, FLOOR, freearr_x, freearr_y, GATE, GET_MAP_OB, say::item, llevError, LOG(), MAGIC_EAR, MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, give::name, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), PEDESTAL, altar_valkyrie::pl, QUERY_FLAG, query_name(), remove_button_link(), SIGN, TIMED_GATE, WALL, diamondslots::x, and diamondslots::y.

Referenced by apply_map_builder().

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

◆ apply_by_living()

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

Living thing is applying an object.

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

Definition at line 637 of file apply.cpp.

References apply_anim_suffix(), apply_manual(), draw_ext_info(), draw_ext_info_format(), FLAG_WAS_WIZ, FLAG_WIZ, MAX_BUF, METHOD_ERROR, METHOD_OK, METHOD_SILENT_ERROR, METHOD_UNHANDLED, MOVE_FLYING, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, give::name, NDI_UNIQUE, object_free(), object_remove(), give::op, altar_valkyrie::pl, play_sound_map(), PLAYER, QUERY_FLAG, query_name(), SOUND_TYPE_ITEM, and Ice::tmp.

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

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

◆ apply_by_living_below()

void apply_by_living_below ( object pl)

Attempt to apply the object 'below' the player. If the player has an open container, we use that for below, otherwise we use the ground.

Parameters
plplayer.

Definition at line 695 of file apply.cpp.

References apply_by_living(), FLAG_IS_FLOOR, banquet::floors, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, METHOD_OK, ob_apply(), altar_valkyrie::pl, QUERY_FLAG, Ice::tmp, and TRANSPORT.

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

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

◆ apply_can_apply_object()

int apply_can_apply_object ( const object who,
const object op 
)

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

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

Definition at line 1016 of file apply.cpp.

References object::body_info, BOW, CAN_APPLY_NEVER, CAN_APPLY_RESTRICTION, CAN_APPLY_UNAPPLY, CAN_APPLY_UNAPPLY_CHOICE, CAN_APPLY_UNAPPLY_MULT, FABS, FLAG_USE_ARMOUR, FLAG_USE_BOW, FLAG_USE_RANGE, FLAG_USE_RING, FLAG_USE_SHIELD, FLAG_USE_WEAPON, get_item_from_body_location(), IS_ARMOR, IS_SHIELD, IS_WEAPON, NUM_BODY_LOCATIONS, object_find_by_type_applied(), give::op, PLAYER, QUERY_FLAG, RING, ROD, SHIELD, Ice::tmp, WAND, WEAPON, and autojail::who.

Referenced by apply_check_apply_restrictions(), and monster_check_apply().

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

◆ apply_changes_to_player()

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

Applies (race) changes to a player.

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

Definition at line 1672 of file apply.cpp.

References AC_PLAYER_STAT_LIMIT, AC_PLAYER_STAT_NO_CHANGE, animate::anim, object::anim_suffix, animate_object(), buf, change_attr_value(), CHARISMA, CLASS, CLEAR_FLAG, object::face, FLAG_ANIMATE, FLAG_USE_WEAPON, FORCE, GET_ANIM, get_attr_value(), give_initial_items(), MAX_BUF, NUM_STATS, object_find_by_name(), object_present_in_ob_by_name(), altar_valkyrie::pl, QUERY_FLAG, object::randomitems, rndm(), set_attr_value(), SET_FLAG, object::stats, try_find_animation(), and object::type.

Referenced by apply_race_and_class(), and player_changer_type_process().

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

◆ apply_check_weapon_power()

int apply_check_weapon_power ( const object who,
int  improves 
)

This checks to see of the player (who) is sufficient level to use a weapon with improves improvements (typically last_eat). We take an int here instead of the object so that the improvement code can pass along the increased value to see if the object is usable. we return 1 (true) if the player can use the weapon. See ../types/weapon_improver/weapon_improver.c

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

Definition at line 1131 of file apply.cpp.

References autojail::who.

Referenced by apply_special(), and improve_weapon().

+ Here is the caller graph for this function:

◆ apply_container()

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

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

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

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

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

Definition at line 222 of file apply.cpp.

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

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

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

◆ apply_handle_yield()

void apply_handle_yield ( object tmp)

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

Parameters
tmpitem that was applied.

Definition at line 122 of file apply.cpp.

References create_archetype(), drop(), INS_BELOW_ORIGINATOR, object_get_value(), object_insert_in_map_at(), object_insert_in_ob(), and Ice::tmp.

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

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

◆ apply_manual()

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

Main apply handler.

Checks for unpaid items before applying.

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

Definition at line 597 of file apply.cpp.

References apply_check_race_restrictions(), draw_ext_info(), FLAG_APPLIED, FLAG_UNPAID, HEAD, METHOD_SILENT_ERROR, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, ob_apply(), give::op, play_sound_player_only(), PLAYER, QUERY_FLAG, SOUND_TYPE_ITEM, and Ice::tmp.

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

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

◆ apply_map_builder()

void apply_map_builder ( object pl,
int  dir 
)

◆ apply_race_and_class()

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

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

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

Definition at line 1479 of file player.cpp.

References AC_PLAYER_STAT_NO_CHANGE, add_statbonus(), add_string(), allowed_class(), apply_changes_to_player(), buf, CLEAR_FLAG, archetype::clone, create_treasure(), esrv_add_spells(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, events_execute_global_event(), find_treasurelist(), fix_object(), FLAG_WIZ, free_string(), get_attr_value(), give_initial_items(), commongive::inv, link_player_skills(), Settings::localdir, make_path_to_file(), MAX_BUF, give::name, NUM_STATS, object_copy(), object_free(), object_remove(), object_set_msg(), object_update(), give::op, Settings::playerdir, pticks, SET_ANIMATION, set_attr_value(), settings, strlcpy(), UP_OBJ_FACE, and UPD_FACE.

Referenced by create_player_cmd(), and START_TEST().

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

◆ apply_special()

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

Apply an object.

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

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

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

Definition at line 1156 of file apply.cpp.

References AMULET, AP_APPLY, AP_BASIC_FLAGS, AP_IGNORE_CURSE, AP_NOPRINT, AP_UNAPPLY, apply_check_apply_restrictions(), apply_check_item_power(), apply_check_owner(), apply_check_personalized_blessings(), apply_check_weapon_power(), apply_update_ranged_skill(), ARMOUR, BOOTS, BOW, BRACERS, BUILDER, change_abil(), change_skill(), CLOAK, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_skill_by_name(), fix_object(), FLAG_APPLIED, FLAG_BEEN_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SKILL, FLAG_READY_WEAPON, GIRDLE, GLOVES, HELMET, llevError, LOG(), MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, NDI_UNIQUE, object_insert_in_ob(), object_split(), give::op, PLAYER, QUERY_FLAG, query_name(), range_bow, range_builder, range_misc, RING, ROD, SET_FLAG, SHIELD, SKILL, SKILL_TOOL, Ice::tmp, unapply_special(), UPD_FLAGS, UPD_NAME, UPD_NROF, UPD_WEIGHT, nlohmann::detail::void(), WAND, WEAPON, and autojail::who.

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

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

◆ attack_ob()

int attack_ob ( object op,
object hitter 
)

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

Parameters
opvictim.
hitterattacker.
Returns
dealt damage.

Definition at line 937 of file attack.cpp.

References attack_ob_simple(), HEAD, death_message::hitter, and give::op.

Referenced by do_skill_attack(), CRECombatSimulator::fight(), monsterFight(), and pets_move_golem().

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

◆ become_follower()

int become_follower ( object op,
const object new_god 
)

This function is called whenever a player has switched to a new god. It handles basically all the stat changes that happen to the player, including the removal of godgiven items (from the former cult). Handles race restrictions on god, and will punish player if needed.

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

Definition at line 413 of file gods.cpp.

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

Referenced by command_setgod(), and pray_at_altar().

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

◆ blind_living()

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

Blind a living thing.

Parameters
opvictim.
hitterwho is attacking.
damdamage to deal.

Definition at line 2354 of file attack.cpp.

References ATNR_BLIND, BLINDNESS, change_abil(), create_archetype(), draw_ext_info_format(), fix_object(), FLAG_APPLIED, FLAG_BLIND, death_message::hitter, MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, NDI_UNIQUE, object_get_owner(), object_insert_in_ob(), object_present_in_ob(), give::op, query_name(), SET_FLAG, Ice::tmp, and reputation::victim.

Referenced by hit_with_one_attacktype(), and scroll_failure().

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

◆ calc_skill_exp()

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

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

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

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

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

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

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

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

Definition at line 667 of file skill_util.cpp.

References object::arch, archetype::clone, living::exp, FLAG_ALIVE, object::level, llevDebug, LOG(), MAX, give::op, PLAYER, QUERY_FLAG, RUNE, settings, Settings::simple_exp, SKILL, object::stats, TRAP, object::type, autojail::value, and autojail::who.

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

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

◆ can_follow()

bool can_follow ( object op,
player other 
)

Definition at line 2776 of file c_wiz.cpp.

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

Referenced by command_follow().

+ Here is the caller graph for this function:

◆ cast_bless()

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

◆ cast_cause_disease()

◆ cast_change_ability()

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

Cast some stat-improving spell.

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

Definition at line 1900 of file spell_effect.cpp.

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

Referenced by cast_spell(), and god_intervention().

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

◆ cast_change_map_lightlevel()

int cast_change_map_lightlevel ( object op,
object spell 
)

This changes the light level for the entire map.

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

Definition at line 3293 of file spell_effect.cpp.

References change_map_light(), living::dam, draw_ext_info(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, give::op, and object::stats.

Referenced by cast_spell().

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

◆ cast_cone()

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

Casts a cone spell.

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

Definition at line 297 of file spell_attack.cpp.

References arch_to_object(), AT_FEAR, AT_GODPOWER, AT_HOLYWORD, AT_TURN_UNDEAD, object::attacktype, caster_level(), living::Cha, archetype::clone, cone_drop(), living::dam, draw_ext_info(), object::duration, FLAG_UNDEAD, freearr_x, freearr_y, get_fear_bonus(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_turn_bonus(), object::level, llevDebug, LOG(), m, MOVE_FLY_LOW, object::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, archetype::name, NDI_UNIQUE, object_insert_in_map_at(), object_set_owner(), give::op, object::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, RUNE, set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, tailor_god_spell(), Ice::tmp, object::type, living::Wis, diamondslots::x, and diamondslots::y.

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

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

◆ cast_consecrate()

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

A spell to make an altar your god's.

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

Definition at line 2985 of file spell_effect.cpp.

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

Referenced by cast_spell().

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

◆ cast_create_food()

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

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

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

Definition at line 627 of file spell_effect.cpp.

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

Referenced by cast_spell().

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

◆ cast_create_missile()

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

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

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

Definition at line 493 of file spell_effect.cpp.

References BOW, cast_create_obj(), object::count, create_archetype(), living::dam, draw_ext_info_format(), object::duration, find_artifactlist(), FLAG_IDENTIFIED, FREE_OBJ_NO_DESTROY_CALLBACK, give_artifact_abilities(), artifact::item, artifactlist::items, llevDebug, LOG(), object::magic, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object::nrof, object_find_by_type_applied(), object_free(), object_was_destroyed, give::op, pick_up(), PLAYER, SET_FLAG, object::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), object::stats, CFweardisguise::tag, Ice::tmp, try_find_archetype(), object::type, and object::value.

Referenced by cast_spell().

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

◆ cast_create_obj()

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

Creates object new_op in direction dir or if that is blocked, beneath the player (op). This is really just a simple wrapper function .

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

Definition at line 494 of file spell_util.cpp.

References draw_ext_info(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, INS_BELOW_ORIGINATOR, m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), give::op, and P_OUT_OF_MAP.

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

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

◆ cast_create_town_portal()

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

This function cast the spell of town portal for op.

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

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

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

Definition at line 1241 of file spell_effect.cpp.

References add_string(), ARCH_PORTAL_FAILED, cast_create_obj(), caster_level(), create_archetype(), Settings::create_home_portals, draw_ext_info(), EXIT_PATH, EXIT_X, EXIT_Y, dragon_attune::force, FREE_AND_COPY, HUGE_BUF, mapstruct::last_reset_time, llevError, Settings::localdir, LOG(), MAP_PLAYER_UNIQUE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, object::name_pl, NDI_NAVY, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_msg(), give::op, object::race, ready_map_name(), settings, object::slaying, Ice::tmp, town_portal_destroy_existing(), town_portal_find_force(), diamondslots::x, and diamondslots::y.

Referenced by cast_spell().

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

◆ cast_curse()

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

◆ cast_destruction()

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

Hit all monsters around the caster.

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

Definition at line 707 of file spell_attack.cpp.

References arch_to_object(), ATNR_MAGIC, object::attacktype, change_skill(), living::dam, object::duration, find_skill_by_name(), FLAG_ALIVE, FLAG_FRIENDLY, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), HEAD, hit_player(), commongive::inv, m, make_object_glow(), object_insert_in_map_at(), give::op, object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, object::skill, SP_DESTRUCTION, SP_FAERY_FIRE, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, object::subtype, and Ice::tmp.

Referenced by cast_spell().

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

◆ cast_detection()

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

Detect magic or invisible items.

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

Definition at line 2578 of file spell_effect.cpp.

References ALTAR, archininventory::arch, object::arch, arch_to_object(), AT_MAGIC, BOOK, BUTTON, caster_level(), CF_HANDLE, CLEAR_FLAG, archetype::clone, determine_god(), esrv_send_item(), EXIT, find_god(), FLAG_ANIMATE, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_FLOOR, FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FLAG_MAKE_INVIS, FLAG_MONSTER, FLAG_WIZ, object::flags, living::food, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, FREE_AND_COPY, GATE, get_map_flags(), object::glow_radius, HEAD, HOLE, HOLY_ALTAR, object::invisible, is_magical(), object::last_anim, level, LOCKED_DOOR, m, object::map_layer, object::more, object::move_allow, object::move_block, object::move_type, object::name, object_create_arch(), object_insert_in_map_at(), object_update_speed(), give::op, object::other_arch, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, object::race, random_roll(), object::range, archetype::reference_count, RUNE, SET_FLAG, SIGN, object::slaying, SP_level_range_adjust(), SPECIAL_KEY, object::speed, object::speed_left, object::stats, TELEPORTER, Ice::tmp, TRAPDOOR, TREASURE, TRIGGER_PEDESTAL, object::type, WEAPON, object::weight, diamondslots::x, and diamondslots::y.

Referenced by cast_spell().

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

◆ cast_dust()

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

Handles op throwing objects of type 'DUST'. This is much simpler in the new spell code - we basically just treat this as any other spell casting object.

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

Definition at line 3927 of file player.cpp.

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

Referenced by do_throw().

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

◆ cast_earth_to_dust()

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

Basically destroys earthwalls in the area.

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

Definition at line 855 of file spell_effect.cpp.

References AT_PHYSICAL, FLAG_TEAR_DOWN, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_player(), m, give::op, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, SP_level_range_adjust(), and Ice::tmp.

Referenced by cast_spell().

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

◆ cast_heal()

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

Heals something.

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

Definition at line 1745 of file spell_effect.cpp.

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

Referenced by cast_spell(), and god_intervention().

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

◆ cast_identify()

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

Identifies objects in the players inventory/on the ground.

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

Definition at line 2503 of file spell_effect.cpp.

References living::dam, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, identify(), is_identified(), MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, ob_describe(), give::op, PLAYER, SP_level_dam_adjust(), spell_effect(), object::stats, Ice::tmp, UPD_FLAGS, and UPD_NAME.

Referenced by cast_spell().

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

◆ cast_invisible()

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

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

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

Definition at line 803 of file spell_effect.cpp.

References add_refcount(), draw_ext_info(), object::duration, FLAG_MAKE_INVIS, FREE_AND_CLEAR_STR, makes_invisible_to(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_update(), give::op, PLAYER, QUERY_FLAG, object::race, SP_level_duration_adjust(), and UP_OBJ_FACE.

Referenced by cast_spell().

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

◆ cast_item_curse_or_bless()

int cast_item_curse_or_bless ( object op,
object spell_ob 
)

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

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

Definition at line 2452 of file spell_effect.cpp.

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

Referenced by cast_spell().

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

◆ cast_light()

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

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

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

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

Definition at line 1136 of file spell_attack.cpp.

References arch_to_object(), object::attacktype, living::dam, draw_ext_info(), object::duration, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_player(), llevError, LOG(), m, map_find_by_flag(), MAX_LIGHT_RADII, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), give::op, object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, object::range, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, Ice::tmp, nlohmann::detail::void(), diamondslots::x, and diamondslots::y.

Referenced by cast_spell().

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

◆ cast_magic_storm()

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

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

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

Definition at line 49 of file spell_effect.cpp.

References object_insert_in_map_at(), give::op, and Ice::tmp.

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

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

◆ cast_polymorph()

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

Polymorph spell casting.

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

Definition at line 425 of file spell_effect.cpp.

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

Referenced by cast_spell().

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

◆ cast_raise_dead_spell()

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

This handles the raise dead / resurrection spells. So try to revive a player.

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

Definition at line 181 of file resurrection.cpp.

References archininventory::arch, arch_to_object(), CALLOC, caster_level(), CORPSE, draw_ext_info(), draw_ext_info_format(), find_archetype(), FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), treasurelist::items, object::last_heal, m, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, object::name, NDI_UNIQUE, commongive::newob, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), give::op, P_OUT_OF_MAP, object::randomitems, resurrect_player(), resurrection_fails(), safe_strncpy, summon_hostile_monsters(), Floor::t, guildbuy::temp, and Ice::tmp.

Referenced by cast_spell().

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

◆ cast_smite_spell()

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

◆ cast_spell()

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

Main dispatch when someone casts a spell.

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

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

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

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

Definition at line 1424 of file spell_util.cpp.

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

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

+ Here is the caller graph for this function:

◆ cast_transfer()

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

This spell transfers sp from the player to another person. We let the target go above their normal maximum SP.

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

Definition at line 2836 of file spell_effect.cpp.

References caster_level(), charge_mana_effect(), living::dam, draw_ext_info(), FLAG_ALIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_BLACK, give::op, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, living::sp, SP_level_dam_adjust(), object::stats, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by cast_spell().

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

◆ cast_wonder()

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

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

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

Definition at line 968 of file spell_effect.cpp.

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

Referenced by cast_spell(), and scroll_failure().

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

◆ cast_word_of_recall()

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

Word of recall causes the player to return 'home'. we put a force into the player object, so that there is a time delay effect.

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

Definition at line 906 of file spell_effect.cpp.

References add_string(), create_archetype(), draw_ext_info(), object::duration, EXIT_PATH, EXIT_X, EXIT_Y, FORCE_NAME, llevError, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_find_by_type_subtype(), object_insert_in_ob(), object_update_speed(), give::op, PLAYER, SP_level_duration_adjust(), SP_WORD_OF_RECALL, object::speed, object::speed_left, SPELL_EFFECT, object::subtype, object::type, and nlohmann::detail::void().

Referenced by cast_spell().

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

◆ caster_level()

int caster_level ( const object caster,
const object spell 
)

This function returns the effective level the spell is being cast at. Note that I changed the repelled/attuned bonus to 2 from 5. This is because the new code compares casting_level against min_caster_level, so the difference is effectively 4

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

Definition at line 194 of file spell_util.cpp.

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

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

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

◆ cftimer_create()

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

Creates a new timer.

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

Definition at line 97 of file timers.cpp.

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

Referenced by cfapi_timer_create().

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

◆ cftimer_destroy()

int cftimer_destroy ( int  id)

Destroys an existing timer.

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

Definition at line 128 of file timers.cpp.

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

Referenced by cfapi_timer_destroy().

+ Here is the caller graph for this function:

◆ cftimer_find_free_id()

int cftimer_find_free_id ( void  )

Finds a free ID for a new timer.

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

Definition at line 144 of file timers.cpp.

References MAX_TIMERS, TIMER_ERR_ID, TIMER_MODE_DEAD, and timers_table.

Referenced by cfapi_timer_create().

+ Here is the caller graph for this function:

◆ cftimer_init()

void cftimer_init ( void  )

Initialize timers.

Definition at line 157 of file timers.cpp.

References MAX_TIMERS, and timers_table.

Referenced by init().

+ Here is the caller graph for this function:

◆ cftimer_process_timers()

void cftimer_process_timers ( void  )

Processes all timers.

Definition at line 44 of file timers.cpp.

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

Referenced by server_main().

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

◆ change_object()

void change_object ( object op)

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

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

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

Definition at line 592 of file time.cpp.

References add_friendly_object(), arch_to_object(), env, FLAG_ALIVE, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, LAMP, llevError, llevInfo, LOG(), object_find_multi_free_spot_around(), object_fix_multipart(), object_free_drop_inventory(), object_get_owner(), object_insert_in_map(), object_insert_in_ob(), object_insert_to_free_spot_or_free(), object_remove(), object_set_owner(), give::op, PETMOVE, QUERY_FLAG, remove_friendly_object(), SET_FLAG, SIZEOFFREE1, and Ice::tmp.

Referenced by do_monster_change(), hit_player(), and process_object().

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

◆ change_skill()

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

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

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

Definition at line 359 of file skill_util.cpp.

References AP_APPLY, AP_NOPRINT, AP_UNAPPLY, apply_special(), PLAYER, range_skill, object::skill, autojail::who, and guild_entry::x1.

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

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

◆ check_active_maps()

void check_active_maps ( void  )

Finds maps in memory to swap.

Definition at line 201 of file swap.cpp.

References first_map, disinfect::map, MAP_IN_MEMORY, give::next, and swap_map().

Referenced by server_main().

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

◆ check_bullet()

void check_bullet ( object op)

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

Parameters
opobject to check.

Definition at line 217 of file spell_attack.cpp.

References explode_bullet(), FLAG_ALIVE, FLAG_REMOVED, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_player(), m, OB_TYPE_MOVE_BLOCK, object_free_drop_inventory(), object_remove(), object_was_destroyed, give::op, P_IS_ALIVE, QUERY_FLAG, and Ice::tmp.

Referenced by fire_arch_from_position(), and move_bullet().

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

◆ check_login()

void check_login ( object op,
const char *  password 
)

Actually login a player, load from disk and such.

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

Definition at line 511 of file login.cpp.

References add_string(), buf, check_password(), check_path(), CLEAR_FLAG, confirm_password(), containers, disinfect::count, draw_ext_info(), draw_ext_info_format(), enter_player_maplevel(), esrv_add_spells(), esrv_new_player(), esrv_send_inventory(), esrv_send_pickup(), EVENT_LOGIN, events_execute_global_event(), npc_dialog::filename, 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, has_been_loaded(), i18n_get_language_by_code(), if(), is_dragon_pl(), key_inventory, keyrings, kill_player(), knowledge_send_known(), leave(), legal_range(), link_player_skills(), llevDebug, llevError, llevInfo, LO_NEWFILE, load_object(), Settings::localdir, LOG(), login_check_shutdown(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, player::next, Ns_Dead, object_find_by_type_and_arch_name(), object_remove(), object_reset(), object_sum_weight(), object_update_speed(), give::op, party_confirm_password(), party_find(), party_form(), party_join(), party_rejoin_always, party_rejoin_no, party_set_password(), partylist::partyname, altar_valkyrie::pl, PLAYER, player_set_own_title(), player_set_state(), Settings::playerdir, PROFILE_BEGIN, PROFILE_END, pticks, QUERY_FLAG, quest_send_initial_states(), range_none, remove_unpaid_objects(), Settings::reset_loc_time, save_player(), Settings::search_items, set_dragon_name(), SET_FLAG, Settings::set_title, settings, ST_PLAYING, strdup_local, strlcpy(), TRUE, unapply_always, unapply_never, unapply_nochoice, autojail::value, and wrong_password().

Referenced by account_play_cmd(), and receive_player_password().

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

◆ check_name()

int check_name ( player me,
const char *  name 
)

Ensure player's name is valid.

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

Definition at line 181 of file login.cpp.

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

Referenced by receive_player_name().

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

◆ check_password()

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

Hash a password and compare it to the stored version.

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

Definition at line 114 of file server.cpp.

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

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

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

◆ check_physically_infect()

void check_physically_infect ( object victim,
object hitter 
)

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

Parameters
victimpotential victim.
hitterwho is hitting.

Definition at line 663 of file disease.cpp.

References DISEASE, FOR_INV_FINISH, FOR_INV_PREPARE, death_message::hitter, infect_object(), and reputation::victim.

Referenced by hit_with_one_attacktype().

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

◆ check_pick()

◆ check_race_and_class()

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

This checks to see if the race and class are legal. Legal in this contexts means that after apply the race/class stat modifiers, the race is still in legal range.

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

Definition at line 1429 of file player.cpp.

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

Referenced by create_player_cmd().

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

◆ check_spell_expiry()

void check_spell_expiry ( object spell)

Checks if player should be warned of soon expiring spell.

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

Parameters
spellforce or spell whose effects will expire.

Definition at line 2006 of file spell_util.cpp.

References draw_ext_info_format(), object::duration, object::env, IS_PLAYER(), castle_read::key, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_PROTECTION_GAIN, object::name, NDI_NAVY, NDI_UNIQUE, and object_get_value().

Referenced by move_aura(), and remove_force().

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

◆ check_spell_known()

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

Checks to see if player knows the spell. If the name is the same as an existing spell, we presume they know it.

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

Definition at line 394 of file spell_util.cpp.

References give::name, object_find_by_type_and_name(), give::op, and SPELL.

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

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

◆ checkbanned()

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

Check if a player and/or host is banned. Wildcards can be used.

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

Definition at line 32 of file ban.cpp.

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

Referenced by new_connection(), and receive_player_password().

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

◆ clean_tmp_files()

void clean_tmp_files ( void  )

Save unique maps and clean up temporary map files unless recycling temporary maps. The function name is somewhat misleading.

Definition at line 351 of file main.cpp.

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

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

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

◆ cleanup()

◆ cleanupPlugins()

void cleanupPlugins ( void  )

Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown. Will not unload plugins. Free all items of plugins_list.

Definition at line 4612 of file plugins.cpp.

References plugins_list.

Referenced by cleanup().

+ Here is the caller graph for this function:

◆ clear_skill()

void clear_skill ( object who)

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

Parameters
wholiving to clear.

Definition at line 398 of file skill_util.cpp.

References CLEAR_FLAG, FLAG_READY_SKILL, PLAYER, range_none, range_skill, and autojail::who.

Referenced by unapply_special().

+ Here is the caller graph for this function:

◆ close_modules()

void close_modules ( )

Clean up all modules which are not disabled.

Definition at line 80 of file init.cpp.

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

Referenced by cleanup().

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

◆ command_abil()

void command_abil ( object op,
const char *  params 
)

Changes an object's statistics.

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

Definition at line 1799 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), FALSE, first_player, fix_object(), FLAG_WAS_WIZ, Settings::max_stat, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, altar_valkyrie::pl, Settings::real_wiz, SET_FLAG, and settings.

Referenced by commands_init().

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

◆ command_accountpasswd()

void command_accountpasswd ( object op,
const char *  params 
)

Definition at line 1618 of file c_wiz.cpp.

References account_change_password(), draw_ext_info(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_accuse()

void command_accuse ( object op,
const char *  params 
)

'accuse' command.

Parameters
opplayer.
paramsmessage.

Definition at line 909 of file c_chat.cpp.

References basic_emote(), EMOTE_ACCUSE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_addexp()

void command_addexp ( object op,
const char *  params 
)

This adds exp to a player. We now allow adding to a specific skill.

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

Definition at line 1656 of file c_wiz.cpp.

References buf, calc_perm_exp(), check_exp_adjust(), draw_ext_info(), draw_ext_info_format(), living::exp, FALSE, find_skill_by_name(), first_player, FLAG_WAS_WIZ, MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, altar_valkyrie::pl, player_lvl_adj(), item::q, Settings::real_wiz, SET_FLAG, settings, and object::stats.

Referenced by commands_init().

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

◆ command_afk()

void command_afk ( object op,
const char *  params 
)

Toggles the afk status of a player. 'afk' command.

Parameters
opplayer to toggle status for.
paramsunused.

Definition at line 775 of file c_misc.cpp.

References CLEAR_FLAG, draw_ext_info(), FLAG_AFK, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, QUERY_FLAG, SET_FLAG, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_apply()

void command_apply ( object op,
const char *  params 
)

'apply' command.

Parameters
opplayer.
paramswhat to apply.

Definition at line 251 of file c_object.cpp.

References AP_APPLY, AP_NULL, AP_OPEN, AP_UNAPPLY, apply_by_living(), apply_by_living_below(), draw_ext_info_format(), find_best_apply_object_match(), commongive::inv, say::item, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_applymode()

void command_applymode ( object op,
const char *  params 
)

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

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1277 of file c_misc.cpp.

References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, types, unapply_always, unapply_never, and unapply_nochoice.

Referenced by commands_init().

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

◆ command_archs()

void command_archs ( object op,
const char *  params 
)

◆ command_arrest()

void command_arrest ( object op,
const char *  params 
)

Wizard jails player.

Parameters
opwizard.
paramsplayer to jail.

Definition at line 821 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), llevInfo, LOG(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, altar_valkyrie::pl, and player_arrest().

Referenced by commands_init().

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

◆ command_banish()

void command_banish ( object op,
const char *  params 
)

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

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

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

Definition at line 502 of file c_wiz.cpp.

References BANISHFILE, buf, command_kick2(), draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), llevDebug, Settings::localdir, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_ALL, NDI_RED, NDI_UNIQUE, give::op, roll-o-matic::params, altar_valkyrie::pl, and settings.

Referenced by commands_init().

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

◆ command_beg()

void command_beg ( object op,
const char *  params 
)

'beg' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1272 of file c_chat.cpp.

References basic_emote(), EMOTE_BEG, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_bleed()

void command_bleed ( object op,
const char *  params 
)

'bleed' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1283 of file c_chat.cpp.

References basic_emote(), EMOTE_BLEED, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_blush()

void command_blush ( object op,
const char *  params 
)

'blush' command.

Parameters
opplayer.
paramsmessage.

Definition at line 953 of file c_chat.cpp.

References basic_emote(), EMOTE_BLUSH, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_body()

void command_body ( object op,
const char *  params 
)

This command dumps the body information for object *op. it doesn't care what the params are.

This is mostly meant as a debug command.

This is the 'body' command.

Parameters
opplayer to display body info for.
paramsunused

Definition at line 175 of file c_misc.cpp.

References body_locations, draw_ext_info(), draw_ext_info_format(), FLAG_USE_ARMOUR, FLAG_USE_WEAPON, i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_BODY, NDI_UNIQUE, NUM_BODY_LOCATIONS, give::op, roll-o-matic::params, QUERY_FLAG, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_bounce()

void command_bounce ( object op,
const char *  params 
)

'bounce' command.

Parameters
opplayer.
paramsmessage.

Definition at line 755 of file c_chat.cpp.

References basic_emote(), EMOTE_BOUNCE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_bow()

void command_bow ( object op,
const char *  params 
)

'bow' command.

Parameters
opplayer.
paramsmessage.

Definition at line 931 of file c_chat.cpp.

References basic_emote(), EMOTE_BOW, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_bowmode()

void command_bowmode ( object op,
const char *  params 
)

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

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1318 of file c_misc.cpp.

References bow_bestarrow, bow_nw, buf, draw_ext_info(), draw_ext_info_format(), is_valid_types_gen::found, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, rotate-tower::result, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_finish(), stringbuffer_new(), and types.

Referenced by commands_init().

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

◆ command_brace()

void command_brace ( object op,
const char *  params 
)

Player toggles her braced status.

Parameters
opplayer.
paramsbrace status (on/off).

Definition at line 2172 of file c_misc.cpp.

References draw_ext_info(), fix_object(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_burp()

void command_burp ( object op,
const char *  params 
)

'burp' command.

Parameters
opplayer.
paramsmessage.

Definition at line 964 of file c_chat.cpp.

References basic_emote(), EMOTE_BURP, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_cackle()

void command_cackle ( object op,
const char *  params 
)

'cackle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 777 of file c_chat.cpp.

References basic_emote(), EMOTE_CACKLE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_cast()

void command_cast ( object op,
const char *  params 
)

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

Parameters
opplayer.
paramsspell.

Definition at line 50 of file c_range.cpp.

References command_cast_spell(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_cast_spell()

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

Sets up to cast a spell.

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

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

Definition at line 146 of file c_range.cpp.

References cast_spell(), draw_ext_info_format(), find_skill_by_name(), lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, object::name, NDI_UNIQUE, object_find_by_tag(), object_free_drop_inventory(), object_get_value(), object_remove(), give::op, roll-o-matic::params, range_golem, range_magic, remove_friendly_object(), make_face_from_files::required, safe_strncpy, show_matching_spells(), object::skill, SPELL, sstring, and object::type.

Referenced by command_cast(), and command_invoke().

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

◆ command_chat()

void command_chat ( object op,
const char *  params 
)

'chat' command.

Parameters
opplayer.
paramsmessage.

Definition at line 221 of file c_chat.cpp.

References command_tell_all(), MSG_TYPE_COMMUNICATION_CHAT, NDI_BLUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_chuckle()

void command_chuckle ( object op,
const char *  params 
)

'chuckle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 975 of file c_chat.cpp.

References basic_emote(), EMOTE_CHUCKLE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_clap()

void command_clap ( object op,
const char *  params 
)

'clap' command.

Parameters
opplayer.
paramsmessage.

Definition at line 942 of file c_chat.cpp.

References basic_emote(), EMOTE_CLAP, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_cointoss()

void command_cointoss ( object op,
const char *  params 
)

'cointoss' command.

Parameters
opplayer.
paramsmessage.

Definition at line 64 of file c_chat.cpp.

References buf, draw_ext_info_format(), ext_info_map_except(), MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, NDI_UNIQUE, NDI_WHITE, give::op, roll-o-matic::params, rotate-tower::result, rndm(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_cough()

void command_cough ( object op,
const char *  params 
)

'cough' command.

Parameters
opplayer.
paramsmessage.

Definition at line 986 of file c_chat.cpp.

References basic_emote(), EMOTE_COUGH, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_create()

void command_create ( object op,
const char *  params 
)

Wizard wants to create an object.

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

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

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

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

Definition at line 979 of file c_wiz.cpp.

References arch_to_object(), bigchest::check, archetype::clone, create_treasure(), dm_stack_pop(), dm_stack_push(), draw_ext_info(), draw_ext_info_format(), FALSE, find_archetype_by_object_name(), find_artifactlist(), FLAG_ALIVE, FLAG_IDENTIFIED, FLAG_MONSTER, FLAG_WAS_WIZ, FREE_OBJ_NO_DESTROY_CALLBACK, give_artifact_abilities(), is_identifiable_type(), artifact::item, artifactlist::items, llevDebug, LOG(), MAX, MAX_BUF, monster_check_apply_all(), object::more, archetype::more, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object::nrof, object_copy(), object_create_arch(), object_free(), object_give_identified_properties(), object_insert_in_map_at(), object_insert_in_ob(), give::op, object::other_arch, out_of_map(), roll-o-matic::params, POTION, QUERY_FLAG, object::randomitems, Settings::real_wiz, ROD, safe_strncpy, SCROLL, set_abs_magic(), SET_FLAG, set_magic(), set_variable(), settings, banquet::size_x, banquet::size_y, SPELL, SPELLBOOK, Ice::tmp, try_find_archetype(), object::type, and WAND.

Referenced by commands_init().

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

◆ command_cringe()

void command_cringe ( object op,
const char *  params 
)

'cringe' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1294 of file c_chat.cpp.

References basic_emote(), EMOTE_CRINGE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_cry()

void command_cry ( object op,
const char *  params 
)

'cry' command.

Parameters
opplayer.
paramsmessage.

Definition at line 887 of file c_chat.cpp.

References basic_emote(), EMOTE_CRY, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_dance()

void command_dance ( object op,
const char *  params 
)

'dance' command.

Parameters
opplayer.
paramsmessage.

Definition at line 733 of file c_chat.cpp.

References basic_emote(), EMOTE_DANCE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_debug()

void command_debug ( object op,
const char *  params 
)

Player wants to see/change the debug level.

Parameters
opplayer asking for information.
paramsnew debug value.

Definition at line 893 of file c_misc.cpp.

References Settings::debug, draw_ext_info_format(), FABS, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, and settings.

Referenced by commands_init().

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

◆ command_delete()

void command_delete ( object op,
const char *  params 
)

Player wants to totally delete her character.

Parameters
opplayer wanting to delete her character.
paramsunused.

Definition at line 1889 of file c_misc.cpp.

References CS_QUERY_SINGLECHAR, draw_ext_info(), FLAG_WIZ, i18n(), MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, player_set_state(), QUERY_FLAG, send_query(), ST_CONFIRM_QUIT, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_diff()

void command_diff ( object op,
const char *  params 
)

Get a diff of specified items. Second item is compared to first, and differences displayed.

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

Ryo, august 2004

Parameters
opwizard.
paramsobject specifier.

Definition at line 2602 of file c_wiz.cpp.

References dm_stack_pop(), draw_ext_info(), get_dm_object(), get_ob_diff(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_find_by_tag_global(), give::op, roll-o-matic::params, STACK_FROM_NUMBER, STACK_FROM_TOP, stringbuffer_finish(), and stringbuffer_new().

Referenced by commands_init().

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

◆ command_disarm()

void command_disarm ( object op,
const char *  params 
)

'disarm' command.

Parameters
opplayer.
paramsunused.

Definition at line 224 of file c_object.cpp.

References do_skill_by_number(), give::op, roll-o-matic::params, and SK_DISARM_TRAPS.

Referenced by commands_init().

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

◆ command_dm()

void command_dm ( object op,
const char *  params 
)

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

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

Definition at line 2194 of file c_wiz.cpp.

References do_wizard_dm(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_dmhide()

void command_dmhide ( object op,
const char *  params 
)

A players wants to become DM and hide. Let's see if that's authorized. Make sure to not tell anything to anyone.

Parameters
opwizard.
paramspassword.

Definition at line 2499 of file c_wiz.cpp.

References do_wizard_dm(), do_wizard_hide(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_dmtell()

void command_dmtell ( object op,
const char *  params 
)

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

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

Definition at line 320 of file c_chat.cpp.

References do_tell(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_drop()

void command_drop ( object op,
const char *  params 
)

'drop' command.

Parameters
opplayer.
paramswhat to drop.

Definition at line 1354 of file c_object.cpp.

References CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), drop(), esrv_update_item(), fix_object(), FLAG_INV_LOCKED, FLAG_NO_DROP, FLAG_NO_FIX_PLAYER, FOR_INV_FINISH, FOR_INV_PREPARE, make_matcher(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, PLAYER, QUERY_FLAG, SET_FLAG, Ice::tmp, and UPD_WEIGHT.

Referenced by commands_init(), and do_test().

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

◆ command_dropall()

void command_dropall ( object op,
const char *  params 
)

Command to drop all items that have not been locked.

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

Definition at line 1230 of file c_object.cpp.

References AMULET, ARMOUR, ARMOUR_IMPROVER, ARROW, BOOK, BOOTS, BOW, BRACERS, CLEAR_FLAG, CLOAK, CONTAINER, disinfect::count, draw_ext_info(), DRINK, drop(), esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_INV_LOCKED, FLAG_NO_FIX_PLAYER, FLESH, FOOD, FOR_INV_FINISH, FOR_INV_PREPARE, GEM, GIRDLE, GLOVES, HELMET, KEY, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, PLAYER, POTION, QUERY_FLAG, RING, ROD, SCROLL, SET_FLAG, SHIELD, SPECIAL_KEY, SPELLBOOK, UPD_WEIGHT, WAND, WEAPON, and WEAPON_IMPROVER.

Referenced by commands_init().

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

◆ command_dump()

void command_dump ( object op,
const char *  params 
)

Dumps the difference between an object and its archetype.

Parameters
opwiard.
paramsobject to dump.

Definition at line 1357 of file c_wiz.cpp.

References draw_ext_info(), FLAG_OBJ_ORIGINAL, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, object_dump(), give::op, roll-o-matic::params, QUERY_FLAG, stringbuffer_finish(), stringbuffer_new(), and Ice::tmp.

Referenced by commands_init().

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

◆ command_dumpabove()

void command_dumpabove ( object op,
const char *  params 
)

Player wants to dump object above her.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 2882 of file c_wiz.cpp.

References do_dump(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_dumpallarchetypes()

void command_dumpallarchetypes ( object op,
const char *  params 
)

Various archetypes-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1005 of file c_misc.cpp.

References dump_all_archetypes(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_dumpallmaps()

void command_dumpallmaps ( object op,
const char *  params 
)

Various map-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1047 of file c_misc.cpp.

References dump_all_maps(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_dumpallobjects()

void command_dumpallobjects ( object op,
const char *  params 
)

Various object-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 977 of file c_misc.cpp.

References object_dump_all(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_dumpbelow()

void command_dumpbelow ( object op,
const char *  params 
)

Player wants to dump object below her.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 2867 of file c_wiz.cpp.

References do_dump(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_dumpfriendlyobjects()

void command_dumpfriendlyobjects ( object op,
const char *  params 
)

Various friendly object-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 991 of file c_misc.cpp.

References dump_friendly_objects(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_dumpmap()

void command_dumpmap ( object op,
const char *  params 
)

Various map-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1033 of file c_misc.cpp.

References dump_map(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_east()

void command_east ( object op,
const char *  params 
)

'east' command.

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

Definition at line 57 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_empty()

void command_empty ( object op,
const char *  params 
)

'empty' command.

Parameters
opplayer.
paramsitem specifier.

Definition at line 1450 of file c_object.cpp.

References CONTAINER, draw_ext_info(), empty_container(), find_best_object_match(), FOR_INV_FINISH, FOR_INV_PREPARE, commongive::inv, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, and object::type.

Referenced by commands_init().

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

◆ command_examine()

void command_examine ( object op,
const char *  params 
)

'examine' command.

Parameters
opplayer.
paramsoptional item specifier.

Definition at line 1489 of file c_object.cpp.

References draw_ext_info_format(), examine(), find_best_object_match(), FOR_BELOW_FINISH, FOR_BELOW_PREPARE, LOOK_OBJ, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, and Ice::tmp.

Referenced by commands_init().

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

◆ command_execute()

void command_execute ( object pl,
char *  command 
)

Handle a player-issued command.

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

Definition at line 455 of file commands.cpp.

References devourers::command, command_find(), registered_command::extra, registered_command::func_extra, registered_command::func_std, llevDebug, LOG(), altar_valkyrie::pl, registered_command::time, and tolower.

Referenced by new_player_cmd().

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

◆ command_face()

void command_face ( object op,
const char *  params 
)

Player wants to face a given direction.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 111 of file c_new.cpp.

References draw_ext_info(), draw_ext_info_format(), face_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_fire()

void command_fire ( object op,
const char *  params 
)

Player wants to start furing.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 77 of file c_new.cpp.

References draw_ext_info(), move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_fire_stop()

void command_fire_stop ( object op,
const char *  params 
)

Player wants to stop firing.

Parameters
opplayer.
paramsignored.

Definition at line 98 of file c_new.cpp.

References give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_fix_me()

void command_fix_me ( object op,
const char *  params 
)

Wrapper to fix a player.

Parameters
opplayer asking to be fixed.
paramsunused.

Definition at line 1213 of file c_misc.cpp.

References fix_object(), object_sum_weight(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_flip()

void command_flip ( object op,
const char *  params 
)

'flip' command.

Parameters
opplayer.
paramsmessage.

Definition at line 997 of file c_chat.cpp.

References basic_emote(), EMOTE_FLIP, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_follow()

void command_follow ( object op,
const char *  params 
)

Follow a player, or stop following a player.

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

Definition at line 2789 of file c_wiz.cpp.

References add_string(), can_follow(), rv_vector::distance, draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), FLAG_WIZ, FREE_AND_CLEAR_STR, get_rangevector(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, object::name, NDI_UNIQUE, player::ob, give::op, roll-o-matic::params, and QUERY_FLAG.

Referenced by commands_init().

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

◆ command_forget_spell()

void command_forget_spell ( object op,
const char *  params 
)

Command for players to forget a spell. This command used to be available only to DMs.

Parameters
opplayer
paramsspell name to forget.

Definition at line 2395 of file c_wiz.cpp.

References do_forget_spell(), draw_ext_info(), draw_ext_info_format(), lookup_spell_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_free()

void command_free ( object op,
const char *  params 
)

Totally free an object.

Parameters
opwizard.
paramsobject to free.

Definition at line 1592 of file c_wiz.cpp.

References dm_stack_pop(), draw_ext_info(), FLAG_REMOVED, get_dm_object(), HEAD, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), give::op, roll-o-matic::params, QUERY_FLAG, STACK_FROM_STACK, and Ice::tmp.

Referenced by commands_init().

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

◆ command_freeze()

void command_freeze ( object op,
const char *  params 
)

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

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

Definition at line 745 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_RED, NDI_UNIQUE, give::op, roll-o-matic::params, and altar_valkyrie::pl.

Referenced by commands_init().

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

◆ command_frown()

void command_frown ( object op,
const char *  params 
)

'frown' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1008 of file c_chat.cpp.

References basic_emote(), EMOTE_FROWN, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_gasp()

void command_gasp ( object op,
const char *  params 
)

'gasp' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1019 of file c_chat.cpp.

References basic_emote(), EMOTE_GASP, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_giggle()

void command_giggle ( object op,
const char *  params 
)

'giggle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 799 of file c_chat.cpp.

References basic_emote(), EMOTE_GIGGLE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_glare()

void command_glare ( object op,
const char *  params 
)

'glare' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1030 of file c_chat.cpp.

References basic_emote(), EMOTE_GLARE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_goto()

void command_goto ( object op,
const char *  params 
)

Wizard teleports to a map.

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

Definition at line 724 of file c_wiz.cpp.

References do_goto(), draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by command_loadtest(), and commands_init().

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

◆ command_grin()

void command_grin ( object op,
const char *  params 
)

'grin' command.

Parameters
opplayer.
paramsmessage.

Definition at line 920 of file c_chat.cpp.

References basic_emote(), EMOTE_GRIN, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_groan()

void command_groan ( object op,
const char *  params 
)

'groan' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1041 of file c_chat.cpp.

References basic_emote(), EMOTE_GROAN, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_growl()

void command_growl ( object op,
const char *  params 
)

'growl' command.

Parameters
opplayer.
paramsmessage.

Definition at line 832 of file c_chat.cpp.

References basic_emote(), EMOTE_GROWL, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_gsay()

void command_gsay ( object op,
const char *  params 
)

'gsay' command, talks to party.

Parameters
opplayer.
paramsmessage.

Definition at line 75 of file c_party.cpp.

References command_party(), draw_ext_info(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_help()

void command_help ( object op,
const char *  params 
)

Player is asking for some help.

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

Definition at line 1772 of file c_misc.cpp.

References command_list(), Settings::datadir, display_help_file(), draw_ext_info_format(), npc_dialog::filename, find_help_file(), FLAG_WIZ, help_topics(), i18n_get_language_code(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, give::op, roll-o-matic::params, QUERY_FLAG, and settings.

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

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

◆ command_hiccup()

void command_hiccup ( object op,
const char *  params 
)

'hiccup' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1052 of file c_chat.cpp.

References basic_emote(), EMOTE_HICCUP, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_hide()

void command_hide ( object op,
const char *  params 
)

Wizard 'hide' command.

Parameters
opDM wanting to hide.
paramsignored.

Definition at line 389 of file c_wiz.cpp.

References do_wizard_hide(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_hiscore()

void command_hiscore ( object op,
const char *  params 
)

Player is asking for the hiscore.

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

Definition at line 881 of file c_misc.cpp.

References hiscore_display(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_hug()

void command_hug ( object op,
const char *  params 
)

'hug' command.

Parameters
opplayer.
paramsmessage.

Definition at line 876 of file c_chat.cpp.

References basic_emote(), EMOTE_HUG, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_insert_into()

void command_insert_into ( object op,
const char *  params 
)

Puts an object into another.

Parameters
opwizard.
paramsobject specifier.

Definition at line 2666 of file c_wiz.cpp.

References dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), esrv_update_item(), FLAG_REMOVED, get_dm_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_find_by_tag_global(), object_insert_in_ob(), object_remove(), give::op, roll-o-matic::params, PLAYER, QUERY_FLAG, query_name(), STACK_FROM_NUMBER, STACK_FROM_TOP, object::type, UPD_NAME, UPD_NROF, UPD_WEIGHT, and python_pickup::where.

Referenced by commands_init().

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

◆ command_inventory()

void command_inventory ( object op,
const char *  params 
)

Shows the inventory or some item.

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

Definition at line 1315 of file c_wiz.cpp.

References draw_ext_info(), inventory(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_find_by_tag_global(), give::op, roll-o-matic::params, and Ice::tmp.

Referenced by commands_init().

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

◆ command_invisible()

void command_invisible ( object op,
const char *  params 
)

Wizard wants to become invisible.

Parameters
opwizard.
paramsignored.

Definition at line 2206 of file c_wiz.cpp.

References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, object_update(), give::op, roll-o-matic::params, UP_OBJ_FACE, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_invoke()

void command_invoke ( object op,
const char *  params 
)

'invoke' command, fires a spell immediately.

Parameters
opplayer.
paramsspell.

Definition at line 38 of file c_range.cpp.

References command_cast_spell(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_kick()

void command_kick ( object op,
const char *  params 
)

Kicks a player from the server.

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

Definition at line 556 of file c_wiz.cpp.

References command_kick2(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_kill_pets()

void command_kill_pets ( object op,
const char *  params 
)

Player wants to get rid of pets.

Parameters
opplayer.
paramsunused.

Definition at line 2196 of file c_misc.cpp.

References draw_ext_info(), draw_ext_info_format(), FLAG_REMOVED, free_objectlink(), get_friends_of(), guildoracle::list, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, objectlink::next, guildjoin::ob, objectlink::ob, object_free_drop_inventory(), object_get_owner(), object_remove(), give::op, roll-o-matic::params, pets_terminate_all(), QUERY_FLAG, remove_friendly_object(), and strcasecmp().

Referenced by commands_init().

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

◆ command_kiss()

void command_kiss ( object op,
const char *  params 
)

'kiss' command.

Parameters
opplayer.
paramsmessage.

Definition at line 744 of file c_chat.cpp.

References basic_emote(), EMOTE_KISS, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_knowledge()

void command_knowledge ( object pl,
const char *  params 
)

Handle the 'knowledge' for a player.

Parameters
plwho is using the command.
paramsadditional parameters.

Definition at line 1213 of file knowledge.cpp.

References command_help(), knowledge_display(), knowledge_do_attempt(), knowledge_do_display(), knowledge_show(), llevError, LOG(), roll-o-matic::params, and altar_valkyrie::pl.

Referenced by commands_init().

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

◆ command_language()

void command_language ( object op,
const char *  params 
)

This is the 'language' command.

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

Definition at line 132 of file c_misc.cpp.

References draw_ext_info(), draw_ext_info_format(), i18n_find_language_by_code(), i18n_list_languages(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_laugh()

void command_laugh ( object op,
const char *  params 
)

'laugh' command.

Parameters
opplayer.
paramsmessage.

Definition at line 788 of file c_chat.cpp.

References basic_emote(), EMOTE_LAUGH, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_learn_special_prayer()

void command_learn_special_prayer ( object op,
const char *  params 
)

Wizard wants to learn a god-given spell.

Parameters
opwizard.
paramsspell name.

Definition at line 2382 of file c_wiz.cpp.

References command_learn_spell_or_prayer(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_learn_spell()

void command_learn_spell ( object op,
const char *  params 
)

Wizard wants to learn a regular spell.

Parameters
opwizard.
paramsspell name.

Definition at line 2370 of file c_wiz.cpp.

References command_learn_spell_or_prayer(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_lick()

void command_lick ( object op,
const char *  params 
)

'lick' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1063 of file c_chat.cpp.

References basic_emote(), EMOTE_LICK, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_list()

void command_list ( object pl,
bool  is_dm 
)

Display the list of commands to a player.

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

Definition at line 389 of file commands.cpp.

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

Referenced by command_help().

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

◆ command_listen()

void command_listen ( object op,
const char *  params 
)

Change the player's listen level.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1090 of file c_misc.cpp.

References draw_ext_info_format(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_listplugins()

void command_listplugins ( object op,
const char *  params 
)

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

Parameters
opwizard.
paramsignored.

Definition at line 2423 of file c_wiz.cpp.

References give::op, roll-o-matic::params, plugins_display_list(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_loadplugin()

void command_loadplugin ( object op,
const char *  params 
)

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

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

Definition at line 2438 of file c_wiz.cpp.

References buf, draw_ext_info(), draw_ext_info_format(), llevDebug, llevInfo, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, and plugins_init_plugin().

Referenced by commands_init().

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

◆ command_loadtest()

void command_loadtest ( object op,
const char *  params 
)

This command will stress server.

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

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

Definition at line 306 of file c_wiz.cpp.

References buf, command_goto(), draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, give::op, roll-o-matic::params, settings, Settings::worldmapstartx, Settings::worldmapstarty, Settings::worldmaptilesx, Settings::worldmaptilesy, diamondslots::x, and diamondslots::y.

Referenced by commands_init().

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

◆ command_lock_item()

void command_lock_item ( object op,
const char *  params 
)

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

Parameters
opplayer
paramssent command line.

Definition at line 2710 of file c_object.cpp.

References CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_best_object_match(), FLAG_INV_LOCKED, HUGE_BUF, say::item, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, give::name, NDI_UNIQUE, object_merge(), give::op, roll-o-matic::params, QUERY_FLAG, query_short_name(), SET_FLAG, Ice::tmp, and UPD_FLAGS.

Referenced by commands_init().

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

◆ command_malloc()

void command_malloc ( object op,
const char *  params 
)

Display memory information.

Parameters
opplayer requesting information.
paramsunused.

Definition at line 796 of file c_misc.cpp.

References malloc_info(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_mapinfo()

void command_mapinfo ( object op,
const char *  params 
)

'mapinfo' command.

Parameters
opplayer requesting the information.
paramsunused.

Definition at line 809 of file c_misc.cpp.

References current_map_info(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_maps()

void command_maps ( object op,
const char *  params 
)

'maps' command.

Parameters
opplayer requesting the information.
paramsregion to restrict to.

Definition at line 835 of file c_misc.cpp.

References map_info(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_mark()

void command_mark ( object op,
const char *  params 
)

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

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

Definition at line 1567 of file c_object.cpp.

References object::count, draw_ext_info(), draw_ext_info_format(), find_best_object_match(), find_marked_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, give::name, NDI_UNIQUE, give::op, roll-o-matic::params, and query_name().

Referenced by commands_init().

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

◆ command_me()

void command_me ( object op,
const char *  params 
)

'me' command.

Parameters
opplayer.
paramsmessage.

Definition at line 47 of file c_chat.cpp.

References buf, ext_info_map(), MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_ME, NDI_BLUE, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_mon_aggr()

void command_mon_aggr ( object op,
const char *  params 
)

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

Parameters
opwiard.
paramsignored.

Definition at line 1385 of file c_wiz.cpp.

References CLEAR_FLAG, draw_ext_info(), FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, object_set_enemy(), give::op, roll-o-matic::params, QUERY_FLAG, SET_FLAG, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_motd()

void command_motd ( object op,
const char *  params 
)

Display the message of the day.

Parameters
opplayer requesting the motd.
paramsunused.

Definition at line 217 of file c_misc.cpp.

References display_motd(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_news()

void command_news ( object op,
const char *  params 
)

Display the server news.

Parameters
opplayer requesting the news.
paramsunused.

Definition at line 243 of file c_misc.cpp.

References give::op, roll-o-matic::params, send_news(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_nod()

void command_nod ( object op,
const char *  params 
)

'nod' command.

Parameters
opplayer.
paramsmessage.

Definition at line 722 of file c_chat.cpp.

References basic_emote(), EMOTE_NOD, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_north()

void command_north ( object op,
const char *  params 
)

'north' command.

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

Definition at line 68 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_northeast()

void command_northeast ( object op,
const char *  params 
)

'northeast' command.

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

Definition at line 79 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_northwest()

void command_northwest ( object op,
const char *  params 
)

'northwest' command.

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

Definition at line 90 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_nowiz()

void command_nowiz ( object op,
const char *  params 
)

Steps down from wizard mode.

Parameters
opwizard.
paramsignored.

Definition at line 2060 of file c_wiz.cpp.

References CLEAR_FLAG, draw_ext_info(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_ALL, NDI_LT_GREEN, NDI_UNIQUE, give::op, roll-o-matic::params, Settings::real_wiz, settings, TRUE, unhide(), update_los(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_orcknuckle()

void command_orcknuckle ( object op,
const char *  params 
)

Plays the "orcknucke" game.

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

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

Definition at line 108 of file c_chat.cpp.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_overlay_reset()

void command_overlay_reset ( object op,
const char *  params 
)

Removes the overlay for op's current map.

Parameters
opDM acting.
paramsignored.

Definition at line 589 of file c_wiz.cpp.

References create_overlay_pathname(), draw_ext_info(), npc_dialog::filename, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_overlay_save()

void command_overlay_save ( object op,
const char *  params 
)

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

Parameters
opDM wanting to save.
paramsignored.

Definition at line 568 of file c_wiz.cpp.

References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, give::op, roll-o-matic::params, save_map(), SAVE_MODE_OVERLAY, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_party()

void command_party ( object op,
const char *  params 
)

'party' command, subdivided in different sub commands.

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

Definition at line 97 of file c_party.cpp.

References buf, command_help(), draw_ext_info(), draw_ext_info_format(), get_party_password(), list_players(), say::max, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_UNIQUE, NDI_WHITE, give::op, roll-o-matic::params, party_find(), party_form(), party_get_first(), party_get_leader(), party_get_next(), party_get_password(), party_join(), party_leave(), party_send_message(), party_set_password(), and partylist::partyname.

Referenced by command_gsay(), and commands_init().

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

◆ command_party_rejoin()

void command_party_rejoin ( object op,
const char *  params 
)

Handles the 'party_rejoin' command.

Parameters
opplayer.
paramsoptional parameters.

Definition at line 307 of file c_party.cpp.

References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, give::op, roll-o-matic::params, and rejoin_modes.

Referenced by commands_init().

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

◆ command_passwd()

void command_passwd ( object pl,
const char *  params 
)

Player is asking to change password.

Parameters
plplayer.
paramsunused.

Definition at line 2239 of file c_misc.cpp.

References CS_QUERY_HIDEINPUT, draw_ext_info(), i18n(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, roll-o-matic::params, altar_valkyrie::pl, player_set_state(), send_query(), ST_CHANGE_PASSWORD_OLD, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_patch()

void command_patch ( object op,
const char *  params 
)

Wizard wants to altar an object.

Parameters
opwizard.
paramsobject and what to patch.

Definition at line 1473 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), FALSE, FLAG_WAS_WIZ, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, Settings::real_wiz, SET_FLAG, set_variable(), settings, and Ice::tmp.

Referenced by commands_init().

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

◆ command_peaceful()

void command_peaceful ( object op,
const char *  params 
)

Player toggles her peaceful status.

Parameters
opplayer.
paramsunused.

Definition at line 2124 of file c_misc.cpp.

References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_petmode()

void command_petmode ( object op,
const char *  params 
)

Player wants to change how her pets behave.

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1437 of file c_misc.cpp.

References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, pet_arena, pet_defend, pet_normal, pet_sad, and types.

Referenced by commands_init().

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

◆ command_pickup()

void command_pickup ( object op,
const char *  params 
)

'pickup' command.

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

Definition at line 2361 of file c_object.cpp.

References display_new_pickup(), draw_ext_info(), draw_ext_info_format(), get_pickup_mode_index(), npc_dialog::index, llevDebug, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, pickup_modes, PU_NEWMODE, and set_pickup_mode().

Referenced by commands_init().

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

◆ command_players()

void command_players ( object op,
const char *  params 
)

Display all known players.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1227 of file c_misc.cpp.

References buf, closedir(), draw_ext_info_format(), Settings::localdir, MAX_BUF, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, opendir(), roll-o-matic::params, Settings::playerdir, readdir(), settings, Floor::t, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_poke()

void command_poke ( object op,
const char *  params 
)

'poke' command.

Parameters
opplayer.
paramsmessage.

Definition at line 898 of file c_chat.cpp.

References basic_emote(), EMOTE_POKE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_possess()

void command_possess ( object op,
const char *  params 
)

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

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

Definition at line 1412 of file c_wiz.cpp.

References buf, do_some_living(), draw_ext_info(), esrv_new_player(), esrv_send_inventory(), fix_object(), FLAG_WIZ, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, NUM_BODY_LOCATIONS, object_find_by_name_global(), object_find_by_tag_global(), give::op, roll-o-matic::params, altar_valkyrie::pl, PLAYER, SET_FLAG, and reputation::victim.

+ Here is the call graph for this function:

◆ command_pout()

void command_pout ( object op,
const char *  params 
)

'pout' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1074 of file c_chat.cpp.

References basic_emote(), EMOTE_POUT, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_printlos()

void command_printlos ( object op,
const char *  params 
)

Various LOS-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1061 of file c_misc.cpp.

References give::op, roll-o-matic::params, print_los(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_puke()

void command_puke ( object op,
const char *  params 
)

'puke' command.

Parameters
opplayer.
paramsmessage.

Definition at line 821 of file c_chat.cpp.

References basic_emote(), EMOTE_PUKE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_purge_quest()

void command_purge_quest ( object op,
const char *  param 
)

Definition at line 2833 of file c_wiz.cpp.

References draw_ext_info(), free_quest(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_UNIQUE, give::op, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_purge_quest_definitions()

void command_purge_quest_definitions ( object op,
const char *  param 
)

Definition at line 2839 of file c_wiz.cpp.

References assets_collect(), ASSETS_QUESTS, Settings::datadir, draw_ext_info(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_UNIQUE, give::op, settings, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_quest()

void command_quest ( object op,
const char *  params 
)

Command handler for 'quest'.

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

Definition at line 738 of file quest.cpp.

References quest_state::code, command_help(), draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), FLAG_WIZ, get_quest(), get_quest_by_number(), i18n(), llevError, LOG(), MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_QUESTS, MSG_TYPE_COMMAND_SUCCESS, give::name, NDI_UNIQUE, quest_state::next, player::ob, give::op, roll-o-matic::params, item::q, QUERY_FLAG, quest_get_by_code(), quest_info(), quest_list(), quest_set_state(), quest_player::quests, quest::state, and autojail::who.

Referenced by commands_init().

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

◆ command_quit()

void command_quit ( object op,
const char *  params 
)

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

Definition at line 1873 of file c_misc.cpp.

References draw_ext_info(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_recollect()

void command_recollect ( object op,
const char *  params 
)

Definition at line 1511 of file c_wiz.cpp.

References Socket_Info::allocated_sockets, assets_finish_archetypes_for_play(), first_player, load_assets(), give::next, give::op, roll-o-matic::params, altar_valkyrie::pl, reset_faces_sent(), socket_info, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_register()

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

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

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

Definition at line 102 of file commands.cpp.

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

Referenced by cfapi_register_command().

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

◆ command_register_extra()

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

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

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

Definition at line 525 of file commands.cpp.

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

Referenced by cfapi_register_command().

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

◆ command_remove()

void command_remove ( object op,
const char *  params 
)

Remove an object from its position.

Parameters
opwizard.
paramsobject to remove.

Definition at line 1545 of file c_wiz.cpp.

References dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), FLAG_REMOVED, get_dm_object(), HEAD, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, give::name, NDI_UNIQUE, object_remove(), object_update_speed(), give::op, roll-o-matic::params, PLAYER, QUERY_FLAG, query_name(), STACK_FROM_STACK, and Ice::tmp.

Referenced by commands_init().

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

◆ command_rename_item()

void command_rename_item ( object op,
const char *  params 
)

Changing the custom name of an item

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

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

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

Parameters
opplayer.
paramshow to rename.

Definition at line 2524 of file c_object.cpp.

References buf, CUSTOM_NAME_FIELD, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_best_object_match(), find_marked_object(), FOR_INV_FINISH, FOR_INV_PREPARE, commongive::inv, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, give::name, NDI_UNIQUE, object_get_value(), object_merge(), object_set_value(), give::op, roll-o-matic::params, query_base_name(), sstring, Ice::tmp, UPD_NAME, and VERY_BIG_BUF.

Referenced by commands_init().

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

◆ command_reply()

void command_reply ( object op,
const char *  params 
)

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

Must have been told something by someone first.

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

Definition at line 336 of file c_chat.cpp.

References draw_ext_info(), draw_ext_info_format(), find_player(), FLAG_WIZ, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, NDI_ORANGE, NDI_UNIQUE, give::op, roll-o-matic::params, altar_valkyrie::pl, QUERY_FLAG, and safe_strncpy.

Referenced by commands_init().

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

◆ command_reset()

◆ command_resistances()

void command_resistances ( object op,
const char *  params 
)

Players wants to know her resistances.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1597 of file c_misc.cpp.

References ATNR_INTERNAL, atnr_is_dragon_enabled(), attacktype_desc, change_resist_msg, draw_ext_info(), draw_ext_info_format(), FORCE, is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, NROFATTACKS, object_find_by_type_and_arch_name(), give::op, roll-o-matic::params, Ice::tmp, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_rotateshoottype()

void command_rotateshoottype ( object op,
const char *  params 
)

'rotateshoottype' command, switch range attack.

Parameters
opplayer.
paramsarguments to the command.

Definition at line 351 of file c_range.cpp.

References change_spell(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_rskill()

void command_rskill ( object pl,
const char *  params 
)

'ready_skill' command.

Parameters
plplayer.
paramsskill name.

Definition at line 161 of file c_object.cpp.

References change_skill(), draw_ext_info(), draw_ext_info_format(), find_skill_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, roll-o-matic::params, and altar_valkyrie::pl.

Referenced by commands_init().

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

◆ command_rules()

void command_rules ( object op,
const char *  params 
)

Display the server rules.

Parameters
opplayer requesting the rules.
paramsunused.

Definition at line 230 of file c_misc.cpp.

References give::op, roll-o-matic::params, send_rules(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_run()

void command_run ( object op,
const char *  params 
)

Player wants to start running.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 41 of file c_new.cpp.

References draw_ext_info(), move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_run_stop()

void command_run_stop ( object op,
const char *  params 
)

Player wants to stop running.

Parameters
opplayer.
paramsignored.
Returns
1.

Definition at line 64 of file c_new.cpp.

References give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_save()

void command_save ( object op,
const char *  params 
)

Player wants to get saved.

Parameters
opplayer.
paramsunused.

Definition at line 2098 of file c_misc.cpp.

References draw_ext_info(), get_map_flags(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, P_NO_CLERIC, roll-o-matic::params, save_player(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_say()

void command_say ( object op,
const char *  params 
)

'say' command.

Parameters
opplayer.
paramsmessage.

Definition at line 34 of file c_chat.cpp.

References monster_communicate(), give::op, and roll-o-matic::params.

Referenced by cfapi_object_say(), and commands_init().

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

◆ command_scream()

void command_scream ( object op,
const char *  params 
)

'scream' command.

Parameters
opplayer.
paramsmessage.

Definition at line 843 of file c_chat.cpp.

References basic_emote(), EMOTE_SCREAM, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_search()

void command_search ( object op,
const char *  params 
)

'search' command.

Parameters
opplayer.
paramsunused.

Definition at line 212 of file c_object.cpp.

References do_skill_by_number(), give::op, roll-o-matic::params, and SK_FIND_TRAPS.

Referenced by commands_init().

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

◆ command_search_items()

void command_search_items ( object op,
const char *  params 
)

'search-items' command.

Parameters
opplayer.
paramsoptions.

Definition at line 2479 of file c_object.cpp.

References 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, give::op, roll-o-matic::params, Settings::search_items, and settings.

Referenced by commands_init(), and kill_player_not_permadeath().

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

◆ command_setgod()

void command_setgod ( object op,
const char *  params 
)

Sets the god for some objects.

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

Definition at line 418 of file c_wiz.cpp.

References become_follower(), draw_ext_info(), draw_ext_info_format(), find_god(), find_object_both(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, guildjoin::ob, give::op, roll-o-matic::params, PLAYER, and make_face_from_files::str.

Referenced by commands_init().

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

◆ command_settings()

void command_settings ( object op,
const char *  ignored 
)

◆ command_shake()

void command_shake ( object op,
const char *  params 
)

'shake' command.

Parameters
opplayer.
paramsmessage.

Definition at line 810 of file c_chat.cpp.

References basic_emote(), EMOTE_SHAKE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_shiver()

void command_shiver ( object op,
const char *  params 
)

'shiver' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1085 of file c_chat.cpp.

References basic_emote(), EMOTE_SHIVER, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_shout()

void command_shout ( object op,
const char *  params 
)

'shout' command.

Parameters
opplayer.
paramsmessage.

Definition at line 210 of file c_chat.cpp.

References command_tell_all(), MSG_TYPE_COMMUNICATION_SHOUT, NDI_RED, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_showpets()

void command_showpets ( object op,
const char *  params 
)

Players wants to know her pets.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1481 of file c_misc.cpp.

References draw_ext_info(), draw_ext_info_format(), free_objectlink(), get_friends_of(), guildoracle::list, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, objectlink::next, guildjoin::ob, objectlink::ob, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_shrug()

void command_shrug ( object op,
const char *  params 
)

'shrug' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1096 of file c_chat.cpp.

References basic_emote(), EMOTE_SHRUG, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_shutdown()

void command_shutdown ( object op,
const char *  params 
)

Totally shutdowns the server.

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

Definition at line 658 of file c_wiz.cpp.

References command_help(), draw_ext_info(), draw_ext_info_format(), llevInfo, LOG(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_ALL, NDI_UNIQUE, shutdown_s::next_warn, give::op, roll-o-matic::params, SHUTDOWN_IDLE, SHUTDOWN_NONE, shutdown_state, SHUTDOWN_TIME, shutdown_s::time, and shutdown_s::type.

Referenced by commands_init().

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

◆ command_sigh()

void command_sigh ( object op,
const char *  params 
)

'sigh' command.

Parameters
opplayer.
paramsmessage.

Definition at line 854 of file c_chat.cpp.

References basic_emote(), EMOTE_SIGH, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_skills()

void command_skills ( object op,
const char *  params 
)

Player is asking for her skills.

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

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

Definition at line 1345 of file c_wiz.cpp.

References give::op, roll-o-matic::params, and show_skills().

Referenced by commands_init().

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

◆ command_slap()

void command_slap ( object op,
const char *  params 
)

'slap' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1107 of file c_chat.cpp.

References basic_emote(), EMOTE_SLAP, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_smile()

void command_smile ( object op,
const char *  params 
)

'smile' command.

Parameters
opplayer.
paramsmessage.

Definition at line 766 of file c_chat.cpp.

References basic_emote(), EMOTE_SMILE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_smirk()

void command_smirk ( object op,
const char *  params 
)

'smirk' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1118 of file c_chat.cpp.

References basic_emote(), EMOTE_SMIRK, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_snap()

void command_snap ( object op,
const char *  params 
)

'snap' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1129 of file c_chat.cpp.

References basic_emote(), EMOTE_SNAP, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_sneeze()

void command_sneeze ( object op,
const char *  params 
)

'sneeze' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1140 of file c_chat.cpp.

References basic_emote(), EMOTE_SNEEZE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_snicker()

void command_snicker ( object op,
const char *  params 
)

'snicker' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1151 of file c_chat.cpp.

References basic_emote(), EMOTE_SNICKER, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_sniff()

void command_sniff ( object op,
const char *  params 
)

'sniff' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1162 of file c_chat.cpp.

References basic_emote(), EMOTE_SNIFF, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_snore()

void command_snore ( object op,
const char *  params 
)

'snore' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1173 of file c_chat.cpp.

References basic_emote(), EMOTE_SNORE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_sound()

void command_sound ( object op,
const char *  params 
)

Player wants to change sound status.

Parameters
opplayer asking for change.
paramsunused.

Definition at line 1910 of file c_misc.cpp.

References draw_ext_info(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, SND_MUTE, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_south()

void command_south ( object op,
const char *  params 
)

'south' command.

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

Definition at line 101 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_southeast()

void command_southeast ( object op,
const char *  params 
)

'southeast' command.

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

Definition at line 112 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_southwest()

void command_southwest ( object op,
const char *  params 
)

'southwest' command.

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

Definition at line 123 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_speed()

void command_speed ( object op,
const char *  params 
)

Changes the server speed.

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

Definition at line 1712 of file c_wiz.cpp.

References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, give::op, roll-o-matic::params, reset_sleep(), set_tick_duration(), and tick_duration.

Referenced by commands_init().

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

◆ command_spit()

void command_spit ( object op,
const char *  params 
)

'spit' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1184 of file c_chat.cpp.

References basic_emote(), EMOTE_SPIT, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_ssdumptable()

void command_ssdumptable ( object op,
const char *  params 
)

Various string-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1019 of file c_misc.cpp.

References give::op, roll-o-matic::params, SS_DUMP_TABLE, ss_dump_table(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_stack_clear()

void command_stack_clear ( object op,
const char *  params 
)

Empty DM item stack.

Parameters
opwizard.
paramsignored.

Definition at line 2576 of file c_wiz.cpp.

References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_stack_list()

void command_stack_list ( object op,
const char *  params 
)

Displays stack contents.

Parameters
opwizard.
paramsignored.

Definition at line 2545 of file c_wiz.cpp.

References object::count, draw_ext_info(), draw_ext_info_format(), say::item, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, object::name, NDI_UNIQUE, object_find_by_tag_global(), give::op, roll-o-matic::params, altar_valkyrie::pl, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_stack_pop()

void command_stack_pop ( object op,
const char *  params 
)

Pop the stack top.

Parameters
opwizard.
paramsignored.

Definition at line 2514 of file c_wiz.cpp.

References dm_stack_pop(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_stack_push()

void command_stack_push ( object op,
const char *  params 
)

Push specified item on stack.

Parameters
opwizard.
paramsobject specifier.

Definition at line 2527 of file c_wiz.cpp.

References dm_stack_push(), get_dm_object(), guildjoin::ob, give::op, roll-o-matic::params, and STACK_FROM_NUMBER.

Referenced by commands_init().

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

◆ command_statistics()

void command_statistics ( object pl,
const char *  params 
)

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

Parameters
plplayer asking for information.
paramsunused.

Add preliminary damage per second calculations here

Definition at line 1121 of file c_misc.cpp.

References buf, draw_ext_info(), draw_ext_info_format(), FMT64, i18n(), level_exp(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, NDI_UNIQUE, roll-o-matic::params, altar_valkyrie::pl, safe_strncpy, seconds(), tick_duration, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_stats()

void command_stats ( object op,
const char *  params 
)

Displays the statistics of a player.

Parameters
opwizard.
paramsplayer's name.

Definition at line 1742 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), FMT64, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, and altar_valkyrie::pl.

Referenced by commands_init().

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

◆ command_stay()

void command_stay ( object op,
const char *  params 
)

'stay' command. Used to specify to fire under oneself.

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

Definition at line 145 of file c_move.cpp.

References fire(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_strings()

void command_strings ( object op,
const char *  params 
)

Various string-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 847 of file c_misc.cpp.

References draw_ext_info(), draw_ext_info_format(), HUGE_BUF, MSG_TYPE_COMMAND, MSG_TYPE_LAST, NDI_UNIQUE, give::op, roll-o-matic::params, ss_dump_statistics(), ss_dump_table(), SS_DUMP_TOTALS, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_strut()

void command_strut ( object op,
const char *  params 
)

'strut' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1195 of file c_chat.cpp.

References basic_emote(), EMOTE_STRUT, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_style_map_info()

void command_style_map_info ( object op,
const char *  params 
)

Displays information about styles loaded for random maps.

Parameters
opwizard.
paramsignored.

Definition at line 2743 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), FOR_MAP_FINISH, FOR_MAP_PREPARE, MAP_HEIGHT, map_size(), MAP_WIDTH, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapstruct::next, give::op, roll-o-matic::params, styles, Ice::tmp, nlohmann::detail::void(), diamondslots::x, and diamondslots::y.

Referenced by commands_init().

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

◆ command_sulk()

void command_sulk ( object op,
const char *  params 
)

'sulk' command.

Parameters
opplayer.
paramsmessage.

Definition at line 865 of file c_chat.cpp.

References basic_emote(), EMOTE_SULK, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_summon()

void command_summon ( object op,
const char *  params 
)

Summons player near DM.

Parameters
opDM.
paramsplayer to summon.

Definition at line 866 of file c_wiz.cpp.

References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, FREE_OBJ_NO_DESTROY_CALLBACK, freearr_x, freearr_y, get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_find_free_spot(), object_free(), object_new(), give::op, roll-o-matic::params, and altar_valkyrie::pl.

Referenced by commands_init().

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

◆ command_take()

void command_take ( object op,
const char *  params 
)

This takes (picks up) an item.

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

Definition at line 845 of file c_object.cpp.

References CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), fix_object(), FLAG_NO_FIX_PLAYER, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, is_valid_types_gen::found, make_matcher(), matcher_params::missed, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, NDI_UNIQUE, give::op, roll-o-matic::params, pick_up(), PLAYER, SET_FLAG, Ice::tmp, and UPD_WEIGHT.

Referenced by commands_init(), do_test(), and knowledge_alchemy_attempt().

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

◆ command_teleport()

void command_teleport ( object op,
const char *  params 
)

Teleport next to target player.

Parameters
opDM teleporting.
paramsoptions sent by player.

Definition at line 913 of file c_wiz.cpp.

References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_player_partial_name(), FREE_OBJ_NO_DESTROY_CALLBACK, freearr_x, freearr_y, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_find_free_spot(), object_free(), object_new(), give::op, roll-o-matic::params, and altar_valkyrie::pl.

Referenced by commands_init().

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

◆ command_tell()

void command_tell ( object op,
const char *  params 
)

Private communication.

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

Definition at line 308 of file c_chat.cpp.

References do_tell(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_thank()

void command_thank ( object op,
const char *  params 
)

'thank' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1206 of file c_chat.cpp.

References basic_emote(), EMOTE_THANK, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_think()

void command_think ( object op,
const char *  params 
)

'think' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1305 of file c_chat.cpp.

References basic_emote(), EMOTE_THINK, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_throw()

void command_throw ( object op,
const char *  params 
)

'throw' command.

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

Parameters
opplayer.
paramswhat to throw.

Definition at line 239 of file c_object.cpp.

References do_skill_by_number(), give::op, roll-o-matic::params, and SK_THROWING.

Referenced by commands_init().

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

◆ command_time()

void command_time ( object op,
const char *  params 
)

Players asks for the time.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 868 of file c_misc.cpp.

References give::op, roll-o-matic::params, time_info(), and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_title()

void command_title ( object op,
const char *  params 
)

Player wishes to change her title.

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

Definition at line 2047 of file c_misc.cpp.

References buf, draw_ext_info(), FALSE, HUGE_BUF, is_dragon_pl(), MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, player_get_title(), player_has_own_title(), player_set_own_title(), Settings::set_title, settings, and Ice::tmp.

Referenced by commands_init().

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

◆ command_toggle_shout()

void command_toggle_shout ( object op,
const char *  params 
)

A simple toggle for the no_shout field. AKA the MUZZLE command.

Parameters
opwizard toggling.
paramsplayer to mute/unmute.

Definition at line 615 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), EVENT_MUZZLE, events_execute_global_event(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_ORANGE, NDI_RED, NDI_UNIQUE, give::op, roll-o-matic::params, and altar_valkyrie::pl.

Referenced by commands_init().

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

◆ command_twiddle()

void command_twiddle ( object op,
const char *  params 
)

'twiddle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1217 of file c_chat.cpp.

References basic_emote(), EMOTE_TWIDDLE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_unarmed_skill()

void command_unarmed_skill ( object op,
const char *  params 
)

Player wants to change prefered unarmed skill

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1381 of file c_misc.cpp.

References add_string(), draw_ext_info_format(), find_skill_by_name(), free_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, give::op, roll-o-matic::params, and object::subtype.

Referenced by commands_init().

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

◆ command_unloadplugin()

void command_unloadplugin ( object op,
const char *  params 
)

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

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

Definition at line 2470 of file c_wiz.cpp.

References draw_ext_info(), draw_ext_info_format(), init_signals(), llevInfo, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, and plugins_remove_plugin().

Referenced by commands_init().

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

◆ command_unregister()

void command_unregister ( command_registration  command)

Unregister a previously registered command.

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

Definition at line 534 of file commands.cpp.

References devourers::command, and registered_commands.

Referenced by cfapi_unregister_command().

+ Here is the caller graph for this function:

◆ command_use()

void command_use ( object op,
const char *  params 
)

Try to use an item on another. Items are checked for key/values matching.

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

Definition at line 2753 of file c_object.cpp.

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

Referenced by commands_init().

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

◆ command_usekeys()

void command_usekeys ( object op,
const char *  params 
)

Player wants to change how keys are used.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1556 of file c_misc.cpp.

References containers, draw_ext_info_format(), key_inventory, keyrings, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, and types.

Referenced by commands_init().

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

◆ command_uskill()

void command_uskill ( object pl,
const char *  params 
)

'use_skill' command.

Parameters
plplayer.
paramsskill to use, and optional parameters.

Definition at line 144 of file c_object.cpp.

References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, roll-o-matic::params, altar_valkyrie::pl, and use_skill().

Referenced by commands_init().

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

◆ command_version()

void command_version ( object op,
const char *  params 
)

Server version.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1076 of file c_misc.cpp.

References draw_ext_info_format(), FULL_VERSION, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_VERSION, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_wave()

void command_wave ( object op,
const char *  params 
)

'wave' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1228 of file c_chat.cpp.

References basic_emote(), EMOTE_WAVE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_west()

void command_west ( object op,
const char *  params 
)

'west' command.

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

Definition at line 134 of file c_move.cpp.

References move_internal(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_whereabouts()

void command_whereabouts ( object op,
const char *  params 
)

'whereabouts' command.

Displays how many players are in which regions.

Parameters
opplayer requesting information.
paramsunused.

Definition at line 484 of file c_misc.cpp.

References all_regions, region::counter, draw_ext_info(), draw_ext_info_format(), first_player, get_region_by_map(), get_region_longname(), llevError, LOG(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, altar_valkyrie::pl, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_whereami()

void command_whereami ( object op,
const char *  params 
)

'whereami' command.

Parameters
opplayer requesting the information.
paramsunused.

Definition at line 822 of file c_misc.cpp.

References current_region_info(), give::op, roll-o-matic::params, and nlohmann::detail::void().

Referenced by commands_init().

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

◆ command_whistle()

void command_whistle ( object op,
const char *  params 
)

'whistle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1239 of file c_chat.cpp.

References basic_emote(), EMOTE_WHISTLE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_who()

void command_who ( object op,
const char *  params 
)

'who' command.

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

Definition at line 623 of file c_misc.cpp.

References get_region_from_string(), list_players(), give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_wimpy()

void command_wimpy ( object op,
const char *  params 
)

Player wants to change how soon she'll flee.

Parameters
opplayer.
paramsnew value.

Definition at line 2142 of file c_misc.cpp.

References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_wink()

void command_wink ( object op,
const char *  params 
)

'wink' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1250 of file c_chat.cpp.

References basic_emote(), EMOTE_WINK, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ command_wizcast()

void command_wizcast ( object op,
const char *  params 
)

Wizard toggling "cast everywhere" ability.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 947 of file c_misc.cpp.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZCAST, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), give::op, roll-o-matic::params, QUERY_FLAG, and SET_FLAG.

Referenced by commands_init().

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

◆ command_wizpass()

void command_wizpass ( object op,
const char *  params 
)

Wizard toggling wall-crossing.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 917 of file c_misc.cpp.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZPASS, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), give::op, roll-o-matic::params, QUERY_FLAG, and SET_FLAG.

Referenced by commands_init().

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

◆ command_yawn()

void command_yawn ( object op,
const char *  params 
)

'yawn' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1261 of file c_chat.cpp.

References basic_emote(), EMOTE_YAWN, give::op, and roll-o-matic::params.

Referenced by commands_init().

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

◆ commands_clear()

void commands_clear ( )

Clear all registered commands.

Definition at line 345 of file commands.cpp.

References next_registration, and registered_commands.

Referenced by cleanup().

+ Here is the caller graph for this function:

◆ commands_init()

void commands_init ( void  )

Init standard commands.

Wizard commands.

Definition at line 109 of file commands.cpp.

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

Referenced by init().

+ Here is the caller graph for this function:

◆ cone_drop()

void cone_drop ( object op)

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

Parameters
opwhat object should drop.

Definition at line 265 of file spell_attack.cpp.

References add_refcount(), arch_to_object(), free_string(), object::level, object_get_owner(), object_insert_in_map_at(), object_set_owner(), give::op, and object::skill.

Referenced by cast_cone(), and move_cone().

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

◆ confirm_password()

void confirm_password ( object op)

Ask the player to confirm her password during creation.

Parameters
opplayer.

Definition at line 1006 of file player.cpp.

References CS_QUERY_HIDEINPUT, i18n(), give::op, player_set_state(), send_query(), and ST_CONFIRM_PASSWORD.

Referenced by check_login().

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

◆ confuse_living()

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

Confuse a living thing.

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

Definition at line 2311 of file attack.cpp.

References add_string(), ATNR_CONFUSION, create_archetype(), draw_ext_info(), FLAG_APPLIED, FLAG_CONFUSED, FORCE, FORCE_CONFUSION, FORCE_NAME, free_string(), death_message::hitter, MAX, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_UNIQUE, object_insert_in_ob(), object_present_in_ob_by_name(), give::op, PLAYER, QUERY_FLAG, SET_FLAG, Ice::tmp, and nlohmann::detail::void().

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

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

◆ counterspell()

void counterspell ( object op,
int  dir 
)

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

Parameters
opcounterspell object.
dirdirection it was cast in.

Definition at line 2909 of file spell_effect.cpp.

References AT_COUNTERSPELL, AT_MAGIC, object::attacktype, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, living::hp, object::level, m, object_free(), object_get_owner(), object_remove(), give::op, P_OUT_OF_MAP, QUERY_FLAG, rndm(), RUNE, SPELL_EFFECT, object::stats, Ice::tmp, and object::type.

Referenced by hit_map().

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

◆ create_aura()

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

Create an aura spell object and put it in the player's inventory. This is also used for elemental shields - the creation is the same just the 'move' code is different.

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

Definition at line 3325 of file spell_effect.cpp.

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

Referenced by cast_spell().

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

◆ create_bomb()

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

Create a bomb.

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

Definition at line 447 of file spell_attack.cpp.

References arch_to_object(), object::attacktype, living::dam, draw_ext_info(), object::duration, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, m, MOVE_WALK, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object_insert_in_map_at(), object_set_owner(), give::op, object::other_arch, P_OUT_OF_MAP, object::range, set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, and Ice::tmp.

Referenced by cast_spell().

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

◆ cure_disease()

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

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

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

Definition at line 685 of file disease.cpp.

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

Referenced by cast_heal(), and restore_player().

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

◆ dead_player()

void dead_player ( object op)

Kill a player on a permanent death server with resurrection.

Parameters
opplayer to kill.

Definition at line 297 of file resurrection.cpp.

References npc_dialog::filename, llevError, Settings::localdir, LOG(), make_perma_dead(), MAX_BUF, give::op, python_init::path, Settings::playerdir, and settings.

Referenced by kill_player_permadeath().

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

◆ delete_character()

void delete_character ( const char *  name)

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

Parameters
nameplayer to delete.

Definition at line 88 of file login.cpp.

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

Referenced by key_confirm_quit(), and kill_player_permadeath().

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

◆ destroy_object()

void destroy_object ( object op)

Recursively object_free_drop_inventory() op and its inventory.

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

Definition at line 209 of file login.cpp.

References FLAG_REMOVED, object_free_drop_inventory(), object_remove(), give::op, and QUERY_FLAG.

Referenced by save_player(), and trap_disarm().

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

◆ detect_curse_on_item()

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

Runs a 'detect curse' check on a given item

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

Definition at line 703 of file skills.cpp.

References calc_skill_exp(), esrv_update_item(), FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_KNOWN_CURSED, object::level, NROF(), altar_valkyrie::pl, QUERY_FLAG, SET_FLAG, Ice::tmp, and UPD_FLAGS.

Referenced by do_skill_detect_curse(), and examine_autoidentify().

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

◆ detect_magic_on_item()

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

Runs a 'detect magic' check on a given item

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

Definition at line 752 of file skills.cpp.

References calc_skill_exp(), esrv_update_item(), FLAG_KNOWN_MAGICAL, is_magical(), object::level, NROF(), altar_valkyrie::pl, QUERY_FLAG, SET_FLAG, Ice::tmp, and UPD_FLAGS.

Referenced by do_skill_detect_magic(), and examine_autoidentify().

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

◆ determine_god()

const char* determine_god ( object op)

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

Parameters
opobject to get name of.
Returns
god name, "none" if nothing suitable.

Definition at line 55 of file gods.cpp.

References add_string(), find_god(), FLAG_ALIVE, get_god_for_race(), get_rand_god(), object::name, object_find_by_type_subtype(), give::op, PLAYER, QUERY_FLAG, SK_PRAYING, SKILL, SPELL, SPELL_EFFECT, and Ice::tmp.

Referenced by become_follower(), cast_bless(), cast_consecrate(), cast_curse(), cast_detection(), cast_smite_spell(), cast_spell(), cfapi_object_get_property(), hit_player(), hit_with_one_attacktype(), kill_player_not_permadeath(), mood_change(), perceive_self(), pets_summon_golem(), pets_summon_object(), pray_at_altar(), prayer_failure(), ring_bell(), show_skills(), and tailor_god_spell().

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

◆ determine_holy_arch()

archetype* determine_holy_arch ( const object god,
const char *  type 
)

Determines the archetype for holy servant and god avatar.

Possible monsters are stored as invisible books in god's inventory, one having the right name is selected randomly.

Parameters
godgod for which we want something.
typewhat the summon type is. Must be a shared string.
Returns
random archetype matching the type, NULL if none found.

Definition at line 675 of file gods.cpp.

References BOOK, archetype::clone, disinfect::count, treasure::item, say::item, treasurelist::items, llevError, LOG(), treasure::next, object::randomitems, rndm(), and is_valid_types_gen::type.

Referenced by CREMainWindow::onReportSummon(), and pets_summon_golem().

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

◆ dimension_door()

int dimension_door ( object op,
object caster,
object spob,
int  dir 
)

Teleport through some doors and space.

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

Definition at line 1609 of file spell_effect.cpp.

References draw_ext_info(), FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, m, map_newmap_cmd(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, ob_apply(), OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), object_remove(), give::op, P_BLOCKSVIEW, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, player_update_bg_music(), object::range, SP_level_range_adjust(), and TRANSPORT.

Referenced by cast_spell().

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

◆ dispel_rune()

int dispel_rune ( object op,
object skill,
int  dir 
)

Someone is trying to disarm a rune. The actual attempt is done in trap_disarm().

Parameters
opobject trying to disarm.
skillskill to disarm runes.
dirdirection to disarm.
Return values
0rune wasn't disarmed.
1a rune was disarmed.

Definition at line 304 of file rune.cpp.

References draw_ext_info(), FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_find_by_type2(), object_free_drop_inventory(), object_remove(), give::op, P_OUT_OF_MAP, RUNE, SIGN, Ice::tmp, TRAP, trap_disarm(), diamondslots::x, and diamondslots::y.

Referenced by cast_spell().

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

◆ display_motd()

void display_motd ( const object op)

Sends the message of the day to the player.

Parameters
opplayer to send to.

Definition at line 139 of file player.cpp.

References buf, Settings::confdir, draw_ext_info(), HUGE_BUF, MAX_BUF, Settings::motd, MSG_SUBTYPE_NONE, MSG_TYPE_MOTD, NDI_GREEN, NDI_UNIQUE, give::op, safe_strcat(), and settings.

Referenced by add_player(), command_motd(), and receive_player_password().

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

◆ do_dump()

void do_dump ( object who,
object what 
)

Definition at line 2845 of file c_wiz.cpp.

References object::count, dm_stack_push(), draw_ext_info(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, object_dump(), stringbuffer_finish(), stringbuffer_new(), and autojail::who.

Referenced by command_dumpabove(), command_dumpbelow(), and examine_cmd().

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

◆ do_forget_spell()

void do_forget_spell ( object op,
const char *  spell 
)

Erases spell from player's inventory. Will inform player of loss.

Parameters
opplayer.
spellspell name to forget.

Definition at line 525 of file apply.cpp.

References check_spell_known(), draw_ext_info_format(), esrv_remove_spell(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, NDI_NAVY, NDI_UNIQUE, object_free(), object_remove(), give::op, PLAYER, and player_unready_range_ob().

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

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

◆ do_goto()

void do_goto ( object op,
const char *  name,
int  x,
int  y 
)

Definition at line 151 of file c_move.cpp.

References add_string(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, FREE_OBJ_NO_DESTROY_CALLBACK, object::map, give::name, object::name, object_free(), object_new(), give::op, diamondslots::x, and diamondslots::y.

Referenced by command_goto().

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

◆ do_harvest()

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

Player is trying to harvest something.

Parameters
plplayer trying to harvest.
dirdirection.
skillskill being used.

In the past, things were made harvestable by adding randomitems. This is not ideal, because randomitems are treasurelist-generated on map load, which means that if common items (e.g. mountains) are harvestable, then we have to do a lot of extra work generating junk that probably nobody will use.

Instead of doing that, check for a harvestitems field. The value will be used as the name of a treasurelist and we only generate it when it is being harvested.

We still have to keep the old way of treasurelist harvestables working, even though this can be much slower.

Definition at line 2263 of file c_misc.cpp.

References change_exp(), disinfect::count, create_treasure(), draw_ext_info_format(), find_treasurelist(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, is_valid_types_gen::found, FREE_OBJ_FREE_INVENTORY, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_weight_limit(), i18n(), INS_BELOW_ORIGINATOR, commongive::inv, IS_PLAYER(), say::item, object::level, level, llevError, LOG(), disinfect::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, object::name, NDI_WHITE, object_create_arch(), object_find_free_spot(), object_free(), object_get_value(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_value(), object_split(), object_value_set(), P_OUT_OF_MAP, altar_valkyrie::pl, QUERY_FLAG, random_roll(), rndm(), SIZEOFFREE, SK_EXP_ADD_SKILL, object::skill, object::slaying, sstring, Floor::t, try_find_archetype(), diamondslots::x, and diamondslots::y.

Referenced by do_skill().

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

◆ do_hidden_move()

void do_hidden_move ( object op)

For hidden creatures - a chance of becoming 'unhidden' every time they move - as we subtract off 'invisibility' AND, for players, if they move into a ridiculously unhideable spot (surrounded by clear terrain in broad daylight). -b.t.

Parameters
opobject moving.

Definition at line 4033 of file player.cpp.

References calc_skill_exp(), change_exp(), draw_ext_info(), hide(), hideability(), object::level, make_visible(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, object_find_by_type_subtype(), give::op, PLAYER, PREFER_LOW, random_roll(), SK_HIDING, SKILL, and object::skill.

Referenced by face_player(), monster_move(), and move_player().

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

◆ do_learn_spell()

void do_learn_spell ( object op,
object spell,
int  special_prayer 
)

Actually makes op learn spell. Informs player of new spell and binding.

Parameters
opplayer who'll learn the spell.
spellspell to learn.
special_prayer1 for god-given prayer, 0 else.

Definition at line 484 of file apply.cpp.

References check_spell_known(), draw_ext_info_format(), esrv_add_spells(), FLAG_STARTEQUIP, llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, object::name, NDI_UNIQUE, object_copy(), object_insert_in_ob(), object_new(), give::op, play_sound_player_only(), PLAYER, QUERY_FLAG, SET_FLAG, SOUND_TYPE_SPELL, and Ice::tmp.

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

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

◆ do_skill()

int do_skill ( object op,
object part,
object skill,
int  dir,
const char *  string 
)

Main skills use function-similar in scope to cast_spell(). We handle all requests for skill use outside of some combat here. We require a separate routine outside of fire() so as to allow monsters to utilize skills.

This is changed (2002-11-30) from the old method that returned exp - no caller needed that info, but it also prevented the callers from know if a skill was actually used, as many skills don't give any exp for their direct use (eg, throwing).

Gives experience if appropriate.

Parameters
opThe object actually using the skill
partactual part using the skill, used by throwing for monsters
skillThe skill used by op
dirThe direction in which the skill is used
stringA parameter string, necessary to use some skills
Return values
0skill failure.
1use of the skill was successful.

Definition at line 431 of file skill_util.cpp.

References object::anim_suffix, apply_anim_suffix(), attack_hth(), attack_melee_weapon(), change_exp(), CLEAR_FLAG, do_harvest(), draw_ext_info(), find_traps(), fix_object(), FLAG_APPLIED, give_skill_by_name(), hide(), jump(), llevDebug, llevError, LOG(), MAX_BUF, meditate(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, give::name, NDI_UNIQUE, object_find_by_type_and_skill(), give::op, pick_lock(), PLAYER, pray(), QUERY_FLAG, query_name(), remove_trap(), SET_FLAG, shop_describe(), singing(), SK_AIR_MAGIC, SK_ALCHEMY, SK_BARGAINING, SK_BOWYER, SK_CLAWING, SK_CLIMBING, SK_DET_CURSE, SK_DET_MAGIC, SK_DISARM_TRAPS, SK_EARTH_MAGIC, SK_EVOCATION, SK_FIND_TRAPS, SK_FIRE_MAGIC, SK_FLAME_TOUCH, SK_HARVESTING, SK_HIDING, SK_INSCRIPTION, SK_JEWELER, SK_JUMPING, SK_KARATE, SK_LEVITATION, SK_LITERACY, SK_LOCKPICKING, SK_MEDITATION, SK_MISSILE_WEAPON, SK_ONE_HANDED_WEAPON, SK_ORATORY, SK_PRAYING, SK_PUNCHING, SK_PYROMANCY, SK_SET_TRAP, SK_SINGING, SK_SMITHERY, SK_SORCERY, SK_STEALING, SK_SUBTRACT_SKILL_EXP, SK_SUMMONING, SK_THAUMATURGY, SK_THROWING, SK_TWO_HANDED_WEAPON, SK_USE_MAGIC_ITEM, SK_WATER_MAGIC, SK_WOODSMAN, SK_WRAITH_FEED, SKILL, object::skill, skill_ident(), skill_throw(), steal(), object::subtype, Ice::tmp, object::type, use_alchemy(), use_oratory(), nlohmann::detail::void(), and write_on_item().

Referenced by do_skill_by_number(), fire(), monster_use_skill(), player_attack_door(), and use_skill().

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

◆ do_some_living()

void do_some_living ( object op)

Regenerate hp/sp/gr, decreases food. This only works for players. Will grab food if needed, or kill player.

Parameters
opplayer to regenerate for.

Definition at line 3272 of file player.cpp.

References give::op, and ST_PLAYING.

Referenced by command_possess(), monsterFight(), and process_players1().

+ Here is the caller graph for this function:

◆ dragon_ability_gain()

◆ drain_rod_charge()

void drain_rod_charge ( object rod)

Drain charges from a rod.

Parameters
rodrod to drain.

Definition at line 776 of file spell_util.cpp.

References living::hp, object::inv, SP_level_spellpoint_cost(), SPELL_HIGHEST, and object::stats.

Referenced by fire_misc_object(), and monster_use_range().

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

◆ drain_wand_charge()

void drain_wand_charge ( object wand)

Drains a charge from a wand. Handles animation fix, and player update if required.

Parameters
wandwand to drain. Must be of type WAND.

Definition at line 786 of file spell_util.cpp.

References object::arch, CLEAR_FLAG, archetype::clone, esrv_update_item(), object::face, FLAG_ANIMATE, living::food, object_get_player_container(), object_update_speed(), object::speed, object::stats, Ice::tmp, object::type, UPD_ANIM, and WAND.

Referenced by fire_misc_object(), and monster_use_range().

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

◆ drop()

void drop ( object op,
object tmp 
)

Drop an item, either on the floor or in a container.

Parameters
opwho is dropping an item.
tmpwhat object to drop.

Definition at line 1168 of file c_object.cpp.

References draw_ext_info(), drop_object(), FLAG_INV_LOCKED, FLAG_NO_DROP, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), give::op, PLAYER, put_object_in_sack(), QUERY_FLAG, and Ice::tmp.

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

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

◆ drop_object()

object* drop_object ( object op,
object tmp,
uint32_t  nrof 
)

Try to drop an object on the floor.

This function was part of drop, now is own function.

Parameters
opwho is dropping the item.
tmpitem to drop.
nrofif is non zero, then nrof objects is tried to be dropped.
Returns
object dropped, NULL if it was destroyed.
Todo:
shouldn't tmp be NULL if object_was_destroyed returns true?

Definition at line 1073 of file c_object.cpp.

References AP_NO_MERGE, AP_UNAPPLY, apply_special(), draw_ext_info(), draw_ext_info_format(), esrv_update_item(), EVENT_DROP, events_execute_object_event(), fix_object(), FLAG_APPLIED, FLAG_NO_DROP, FLAG_NO_FIX_PLAYER, FLAG_REMOVED, FLAG_STARTEQUIP, FLAG_UNPAID, INS_BELOW_ORIGINATOR, MAX_BUF, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, give::name, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_split(), object_was_destroyed, give::op, PLAYER, QUERY_FLAG, query_name(), save_player(), SCRIPT_FIX_ALL, sell_item(), shop_contains(), Ice::tmp, and UPD_WEIGHT.

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

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

◆ dump_quests()

void dump_quests ( void  )

Dump all of the quests, then calls exit() - useful in terms of debugging to make sure that quests are set up and recognised correctly.

Definition at line 880 of file quest.cpp.

References dump::level, output_quests(), dump::parent, and quest_for_each().

+ Here is the call graph for this function:

◆ dump_races()

void dump_races ( void  )

Dumps all race information to stderr.

Definition at line 83 of file races.cpp.

References mon, and races.

Referenced by init_beforeplay().

+ Here is the caller graph for this function:

◆ dump_spells()

void dump_spells ( void  )

Dumps all the spells - now also dumps skill associated with the spell. not sure what this would be used for, as the data seems pretty minimal, but easy enough to keep around.

Definition at line 108 of file spell_util.cpp.

References AssetsManager::archetypes(), AssetsCollection< T, Key >::each(), getManager(), and SPELL.

Referenced by init_beforeplay().

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

◆ emergency_save()

void emergency_save ( int  flag)

Save all players.

Parameters
flagif non zero, it means that we want to try and save everyone, but keep the game running. Thus, we don't want to free any information.

Definition at line 347 of file main.cpp.

References draw_ext_info(), first_map_path, first_player, hiscore_check(), llevError, llevInfo, LOG(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, NDI_UNIQUE, altar_valkyrie::pl, save_player(), trying_emergency_save, nlohmann::detail::void(), and diamondslots::x.

Referenced by fatal(), and LOG().

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

◆ enter_exit()

void enter_exit ( object op,
object exit_ob 
)

Tries to move 'op' to exit_ob.

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

May call abort() in some situations.

Parameters
opcharacter or monster that is using the exit.
exit_obexit object (boat, door, teleporter, etc.)

Definition at line 734 of file server.cpp.

References AP_UNAPPLY, object::attacktype, buf, living::dam, draw_ext_info_format(), enter_fixed_template_map(), enter_map(), enter_random_map(), enter_random_template_map(), enter_unique_map(), EXIT_PATH, EXIT_X, EXIT_Y, FLAG_DAMNED, FLAG_UNIQUE, FLAG_UNPAID, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, FORCE, FREE_OBJ_NO_DESTROY_CALLBACK, hit_player(), HUGE_BUF, llevDebug, Settings::localdir, LOG(), object::map, MAP_ENTER_X, MAP_ENTER_Y, MAP_PLAYER_UNIQUE, MAX_BUF, object::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, object::name, NDI_UNIQUE, ob_apply(), ob_describe(), object_copy(), object_find_by_type_and_slaying(), object_free(), object_new(), object_remove(), object_update_speed(), give::op, mapstruct::path, path_combine_and_normalize(), PLAYER, PORTAL_DESTINATION_NAME, QUERY_FLAG, ready_map_name(), save_player(), settings, SP_WORD_OF_RECALL, object::speed, object::stats, object::subtype, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by command_reset(), command_summon(), command_teleport(), create_player_cmd(), do_follow(), do_goto(), enter_player_savebed(), execute_word_of_recall(), exit_type_apply(), exit_type_move_on(), key_change_class(), move_teleporter(), player_arrest(), and player_changer_type_process().

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

◆ enter_player_maplevel()

void enter_player_maplevel ( object op)

Move a player to its stored map level. This function is used to place the player just after logging in. Since the map may no longer exist, dump the player to an alternative 'emergency' location if that's the case.

Definition at line 689 of file server.cpp.

References draw_ext_info_format(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_map(), flags, llevError, LOG(), MAP_ENTER_X, MAP_ENTER_Y, MSG_TYPE_MISC, NDI_UNIQUE, give::op, PLAYER, ready_map_name(), settings, diamondslots::x, and diamondslots::y.

Referenced by check_login(), and set_first_map().

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

◆ enter_player_savebed()

void enter_player_savebed ( object op)

This is a basic little function to put the player back to his savebed. We do some error checking - its possible that the savebed map may no longer exist, so we make sure the player goes someplace.

Parameters
opplayer.

Definition at line 138 of file server.cpp.

References add_string(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, FREE_OBJ_NO_DESTROY_CALLBACK, free_string(), llevDebug, LOG(), MAX_BUF, object_free(), object_new(), give::op, mapstruct::path, safe_strncpy, settings, and Ice::tmp.

Referenced by kill_player_not_permadeath(), and save_life().

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

◆ examine()

◆ examine_monster()

void examine_monster ( object op,
object tmp,
int  level 
)

Player examine a monster.

Parameters
opplayer.
tmpmonster being examined.
levellevel of the probe, to have a persistant marker for some duration.

Definition at line 1614 of file c_object.cpp.

References add_string(), AT_ACID, object::attacktype, create_archetype(), draw_ext_info(), fix_object(), FLAG_APPLIED, FLAG_PROBE, FLAG_UNDEAD, FORCE, FORCE_NAME, free_string(), HEAD, living::hp, knowledge_add_probe_monster(), object::level, level, living::maxhp, mon, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, NDI_UNIQUE, object_find_by_type_and_name(), object_insert_in_ob(), object_present_in_ob(), give::op, POISONING, probe(), QUERY_FLAG, SET_FLAG, object::stats, and Ice::tmp.

Referenced by examine(), and probe().

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

◆ explode_bullet()

void explode_bullet ( object op)

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

Parameters
opthe object to explode.

Definition at line 121 of file spell_attack.cpp.

References add_refcount(), arch_to_object(), AT_GODPOWER, AT_HOLYWORD, AT_MAGIC, env, FREE_AND_CLEAR_STR, hit_map(), INS_NO_MERGE, INS_NO_WALK_ON, llevError, LOG(), object_copy_owner(), object_free_drop_inventory(), object_get_env_recursive(), object_get_owner(), object_insert_in_map_at(), object_remove(), object_was_destroyed, give::op, out_of_map(), SP_BOMB, SP_CONE, SPELL_EFFECT, tailor_god_spell(), and Ice::tmp.

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

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

◆ face_player()

int face_player ( object op,
int  dir 
)

Face player in the given direction.

Parameters
opplayer.
dirdirection to face
Returns
0.

Definition at line 3027 of file player.cpp.

References animate_object(), object::contr, do_hidden_move(), FLAG_CONFUSED, get_randomized_dir(), llevError, LOG(), MAP_IN_MEMORY, give::op, QUERY_FLAG, and turn_transport().

Referenced by command_face().

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

◆ find_applied_skill_by_name()

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

Find a skill by name using the last_skill_ob list. Assume last_skill_ob was correctly updated before.

This is defined here rather than server/skill_util.c because things defined in libserver.a are not available when libcommon.a is linked.

Definition at line 1921 of file living.cpp.

References FLAG_REMOVED, llevDebug, llevError, LOG(), MAX_SKILLS, give::name, give::op, and QUERY_FLAG.

Referenced by add_player_exp(), caster_level(), and kill_object().

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

◆ find_key()

object* find_key ( object pl,
object container,
object door 
)

We try to find a key for the door as passed. If we find a key and player can use it (based on the usekeys settings), we return the key, otherwise NULL.

This function merges both normal and locked door, since the logic for both is the same - just the specific key is different.

This function can be called recursively to search containers.

Parameters
plplayer.
containerinventory to searched for keys.
doordoor we are trying to match against.
Returns
key to use, NULL if none found or usekeys mode doesn't let reach the key.
Todo:
document use key modes.

Definition at line 2468 of file player.cpp.

References CONTAINER, DOOR, draw_ext_info_format(), FLAG_APPLIED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, object::inv, castle_read::key, KEY, key_inventory, keyrings, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, NDI_BROWN, NDI_UNIQUE, object_find_by_type_and_slaying(), object_find_by_type_without_flags(), altar_valkyrie::pl, QUERY_FLAG, query_name(), object::race, object::slaying, SPECIAL_KEY, Ice::tmp, and object::type.

Referenced by apply_container(), and player_attack_door().

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

◆ find_marked_object()

object* find_marked_object ( object op)

Return the object the player has marked with the 'mark' command below. If no match is found (or object has changed), we return NULL. We leave it up to the calling function to print messages if nothing is found.

Parameters
opobject. Should be a player.
Returns
marked object if still valid, NULL else.

Definition at line 1520 of file c_object.cpp.

References give::op.

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

+ Here is the caller graph for this function:

◆ find_player()

player* find_player ( const char *  plname)

Find a player by her full name.

Parameters
plnamename to find.
Returns
matching player, or NULL if no match.

Definition at line 59 of file player.cpp.

References find_player_options().

Referenced by command_reply(), and list_players().

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

◆ find_player_options()

player* find_player_options ( const char *  plname,
int  options,
const mapstruct map 
)

Find a player.

Parameters
plnamename of the player to search for. Can be partial.
optionscombination of FIND_PLAYER_xxx flags.
mapoptional map the player must be on (adjacent maps are ok too).
Returns
matching player, NULL if none or more than one.

Definition at line 70 of file player.cpp.

References FIND_PLAYER_NO_HIDDEN_DM, FIND_PLAYER_PARTIAL_NAME, first_player, FLAG_WIZ, is_valid_types_gen::found, disinfect::map, MAX_BUF, give::name, options, altar_valkyrie::pl, QUERY_FLAG, and query_name().

Referenced by basic_emote(), find_player(), and find_player_partial_name().

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

◆ find_player_partial_name()

player* find_player_partial_name ( const char *  plname)

Find a player by a partial name.

Parameters
plnamename to match.
Returns
matching player if only one matching, or one perfectly matching, NULL if no match or more than one.

Definition at line 114 of file player.cpp.

References find_player_options(), and FIND_PLAYER_PARTIAL_NAME.

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

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

◆ find_player_socket()

player* find_player_socket ( const socket_struct ns)

Return a player for a socket structure.

Parameters
nssocket to search for.
Returns
NULL if no player, player else.

Definition at line 123 of file player.cpp.

References first_player, and altar_valkyrie::pl.

Referenced by add_me_cmd(), and set_up_cmd().

+ Here is the caller graph for this function:

◆ find_random_spell_in_ob()

object* find_random_spell_in_ob ( object ob,
const char *  skill 
)

This returns a random spell from 'ob'. If skill is set, then the spell must be of this skill, it can be NULL in which case all matching spells are used.

Parameters
obobject to find spells in.
skillskill the spell should match, NULL if can match any spell.
Returns
random spell, or NULL if none found.
Todo:
change skill to sstring.

Definition at line 48 of file spell_util.cpp.

References FOR_INV_FINISH, FOR_INV_PREPARE, guildjoin::ob, RANDOM, SPELL, and Ice::tmp.

Referenced by cast_spell(), and write_scroll().

+ Here is the caller graph for this function:

◆ find_skill_by_name()

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

This returns the skill pointer of the given name (the one that accumulates exp, has the level, etc).

It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.

This code is basically the same as find_skill_by_number() below, but instead of a skill number, we search by the name.

Because a multiple skill names are allowed, we have to use arrays to store the intermediate results - we can't have skill_tool point to praying with skill pointing to fire magic.

Parameters
whoPlayer to get skill.
nameskill to find. Needs not to be a shared string. name can be a comma separated list of skill names - in that case, we will find the skill of the highest level.
Returns
pointer to skill object, or NULL if player doesn't have it.
Todo:
Maybe better selection of skill when choice of multiple skills is in use (highest level may not be the best answer?)

Definition at line 211 of file skill_util.cpp.

References adjust_skill_tool(), FLAG_APPLIED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, object::level, llevError, LOG(), MAX_SKILLS, give::name, QUERY_FLAG, SKILL, skill_names, SKILL_TOOL, Ice::tmp, and autojail::who.

Referenced by apply_special(), attempt_do_alchemy(), attempt_recipe(), book_type_apply(), calc_alch_danger(), cast_destruction(), cast_dust(), cast_spell(), command_addexp(), command_cast_spell(), command_rskill(), command_unarmed_skill(), do_skill_attack(), dragon_ability_gain(), find_best_player_hth_skill(), fire_bow(), inscribe_scroll_cmd(), player_attack_door(), spellbook_type_apply(), and write_on_item().

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

◆ find_skill_by_number()

object* find_skill_by_number ( object who,
int  skillno 
)

This returns the first skill pointer of the given subtype (the one that accumulates exp, has the level, etc).

It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.

This code is basically the same as find_skill_by_name() above, but instead of a skill name, we search by matching subtype.

Warning: skill subtypes are not unique to skills, various skills (eg harvesting-like) will share the same subtype, so this function should only be used if the skill's subtype is known to be used only by one skill.

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

Definition at line 375 of file main.cpp.

References adjust_skill_tool(), FLAG_APPLIED, FOR_INV_FINISH, FOR_INV_PREPARE, MAX_SKILLS, QUERY_FLAG, SKILL, SKILL_TOOL, Ice::tmp, nlohmann::detail::void(), and autojail::who.

Referenced by compute_price_variation_with_bargaining(), cost_approx_str(), do_skill_by_number(), examine_autoidentify(), find_best_player_hth_skill(), god_enchants_weapon(), monster_can_detect_enemy(), object_check_move_on(), price_approx(), and scroll_type_apply().

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

◆ find_target_for_friendly_spell()

object* find_target_for_friendly_spell ( object op,
int  dir 
)

This function is commonly used to find a friendly target for spells such as heal or protection or armour

Parameters
opwhat is looking for the target (which can be a player).
dirdirection we are looking in.
Returns
object found, or NULL if no good object.

Definition at line 813 of file spell_util.cpp.

References FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, commongive::inv, m, object_get_owner(), give::op, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, Ice::tmp, TRANSPORT, diamondslots::x, and diamondslots::y.

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

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

◆ find_traps()

int find_traps ( object pl,
object skill 
)

Checks for traps on the spaces around the player or in certain objects.

Parameters
plplayer searching.
skillfind trap skill object.
Returns
experience gained for finding traps.

Definition at line 1240 of file skills.cpp.

References calc_skill_exp(), draw_ext_info(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, object_get_owner(), P_OUT_OF_MAP, altar_valkyrie::pl, PLAYER, QUERY_FLAG, RUNE, Ice::tmp, TRAP, trap_see(), trap_show(), object::type, diamondslots::x, and diamondslots::y.

Referenced by do_skill().

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

◆ finish_races()

void finish_races ( )

Definition at line 100 of file races.cpp.

References addToRace, AssetsManager::archetypes(), AssetsCollection< T, Key >::find(), FLAG_MONSTER, getManager(), llevError, LOG(), mon, give::name, QUERY_FLAG, and races.

Referenced by init_beforeplay().

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

◆ fire()

void fire ( object op,
int  dir 
)

Received a fire command for the player - go and do it.

Parameters
opplayer.
dirdirection to fire into.

Definition at line 2396 of file player.cpp.

References action_makes_visible(), apply_map_builder(), cast_spell(), do_skill(), draw_ext_info(), fire_misc_object(), make_visible(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, pets_control_golem(), PLAYER, player_fire_bow(), range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_skill, and nlohmann::detail::void().

Referenced by command_stay(), and move_player().

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

◆ fire_arch_from_position()

int fire_arch_from_position ( object op,
object caster,
int16_t  x,
int16_t  y,
int  dir,
object spell 
)

Fires an archetype.

Note
it uses op->map for the map for these coordinates, which is probably a really bad idea.
Parameters
opperson firing the object.
casterobject casting the spell.
x
ywhere to fire the spell.
dirdirection to fire in.
spellspell that is being fired. It uses other_arch for the archetype to fire.
Returns
0 on failure, 1 on success.
Todo:
check the note?

Definition at line 629 of file spell_util.cpp.

References absdir(), add_refcount(), arch_to_object(), AT_GODPOWER, AT_HOLYWORD, object::attacktype, caster_level(), check_bullet(), living::dam, DIRX, DIRY, draw_ext_info(), object::duration, FLAG_REFLECTING, living::food, get_map_flags(), GET_MAP_MOVE_BLOCK, llevError, LOG(), m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, NDI_UNIQUE, ob_process(), OB_TYPE_MOVE_BLOCK, object_copy_owner(), object_free_drop_inventory(), object_get_owner(), object_insert_in_map_at(), object_set_owner(), object_update_turn_face(), give::op, object::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RANDOM, object::range, set_spell_skill(), object::slaying, SP_BULLET, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SP_MAGIC_MISSILE, SP_MOVING_BALL, SPELL, object::stats, object::subtype, tailor_god_spell(), Ice::tmp, object::type, diamondslots::x, and diamondslots::y.

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

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

◆ fire_bolt()

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

Cast a bolt-like spell.

We remove the magic flag - that can be derived from spob->attacktype. This function sets up the appropriate owner and skill pointers.

Parameters
opwho is casting the spell.
casterwhat object is casting the spell (rod, ...).
dirfiring direction.
spobspell object for the bolt.
Return values
0no bolt could be fired.
1bolt was fired (but may have been destroyed already).

Definition at line 61 of file spell_attack.cpp.

References absdir(), add_refcount(), arch_to_object(), object::attacktype, living::Con, living::dam, living::Dex, DIRX, DIRY, object::duration, FLAG_REFLECTING, get_map_flags(), GET_MAP_MOVE_BLOCK, ob_process(), OB_TYPE_MOVE_BLOCK, object_free_drop_inventory(), object_insert_in_map_at(), object_set_owner(), object_update_turn_face(), give::op, object::other_arch, P_OUT_OF_MAP, QUERY_FLAG, object::range, set_spell_skill(), object::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, and Ice::tmp.

Referenced by cast_spell().

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

◆ fire_bow()

int fire_bow ( object op,
object arrow,
int  dir,
int  wc_mod,
int16_t  sx,
int16_t  sy 
)

Creature (monster or player) fires a bow.

Parameters
opobject firing the bow.
arrowobject to fire.
dirdirection of fire.
wc_modany special modifier to give (used in special player fire modes)
sx
sycoordinates to fire arrow from - also used in some of the special player fire modes.
Returns
1 if bow was actually fired, 0 otherwise.
Todo:
describe player firing modes.

Definition at line 2093 of file player.cpp.

References add_refcount(), add_string(), object::anim_suffix, apply_anim_suffix(), AT_PHYSICAL, object::attacktype, BOW, bow_bestarrow, change_skill(), CLEAR_FLAG, object::count, living::dam, object::direction, draw_ext_info(), draw_ext_info_format(), FABS, find_arrow(), find_skill_by_name(), fix_object(), FLAG_NO_STRENGTH, FLAG_READY_BOW, free_string(), get_dam_bonus(), get_dex_bonus(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_thaco_bonus(), living::grace, living::hp, if(), object::level, llevError, LOG(), m, object::magic, MOVE_FLY_LOW, object::move_on, object::move_type, MOVE_WALK, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, object::nrof, ob_process(), object_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_set_owner(), object_split(), object_update_speed(), object_update_turn_face(), object_was_destroyed, give::op, P_OUT_OF_MAP, play_sound_map(), PLAYER, QUERY_FLAG, object::race, range_bow, object::skill, object::slaying, SOUND_TYPE_ITEM, living::sp, object::speed, object::speed_left, object::spellarg, object::stats, strdup_local, CFweardisguise::tag, and living::wc.

Referenced by monster_use_bow(), and player_fire_bow().

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

◆ fire_swarm()

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

The following routine creates a swarm of objects. It actually sets up a specific swarm object, which then fires off all the parts of the swarm.

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

Definition at line 1088 of file spell_attack.cpp.

References arch_to_object(), AT_GODPOWER, AT_HOLYWORD, caster_level(), create_archetype(), die_roll(), object::duration, object_insert_in_map_at(), object_set_owner(), give::op, object::other_arch, PREFER_HIGH, set_spell_skill(), SP_level_duration_adjust(), SWARM_SPELL, tailor_god_spell(), and Ice::tmp.

Referenced by cast_spell().

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

◆ fix_luck()

void fix_luck ( void  )

Fixes luck of players, slowly move it towards 0.

Definition at line 3906 of file player.cpp.

References change_luck(), first_player, and altar_valkyrie::pl.

Referenced by do_specials().

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

◆ fix_stopped_arrow()

object* fix_stopped_arrow ( object op)

An ARROW stops moving.

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

Definition at line 512 of file time.cpp.

References add_string(), animate_object(), FREE_AND_CLEAR_STR, free_no_drop(), object_clear_owner(), object_free_drop_inventory(), object_remove(), object_update(), object_update_speed(), give::op, rndm(), and UP_OBJ_FACE.

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:

◆ fix_stopped_item()

void fix_stopped_item ( object op,
mapstruct map,
object originator 
)

Put stopped item where stop_item() had found it. Inserts item into the old map, or merges it if it already is on the map.

Parameters
opobject to stop.
mapmust be the value of op->map before stop_item() was called.
originatorwhat caused op to be stopped.

Definition at line 495 of file time.cpp.

References ARROW, FLAG_REMOVED, disinfect::map, object_insert_in_map(), object_merge(), give::op, and QUERY_FLAG.

Referenced by save_throw_object().

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

◆ fix_weight()

void fix_weight ( void  )

Check recursively the weight of all players, and fix what needs to be fixed. Refresh windows and fix speed if anything was changed.

Todo:
is this still useful?

Definition at line 3890 of file player.cpp.

References first_player, fix_object(), llevDebug, LOG(), object_sum_weight(), and altar_valkyrie::pl.

Referenced by do_specials().

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

◆ flush_old_maps()

void flush_old_maps ( void  )

Reset maps that need to, remove their swap file. This is very useful if the tmp-disk is very full.

Definition at line 291 of file swap.cpp.

References clean_tmp_map(), delete_map(), EVENT_MAPRESET, events_execute_global_event(), first_map, llevDebug, LOG(), m, map_can_reset(), MAP_IN_MEMORY, MAP_SWAPPED, players_on_map(), seconds(), set_map_timeout(), and TRUE.

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

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

◆ forbid_play()

int forbid_play ( void  )

Checks if server should be started.

Returns
1 if play is forbidden, 0 if ok.
Todo:
document forbidden stuff.

Definition at line 1366 of file server.cpp.

References buf, Settings::confdir, days, llevDebug, LOG(), logfile, MAX_BUF, PERM_FILE, settings, and roll-o-matic::stop().

Referenced by init_startup().

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

◆ free_knowledge()

void free_knowledge ( void  )

Free all knowledge data.

Definition at line 1280 of file knowledge.cpp.

References free_knowledge_player(), knowledge_global, give::next, and knowledge_player::next.

Referenced by cleanup().

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

◆ free_no_drop()

int free_no_drop ( object op)

Check whether the given object is FLAG_NO_DROP. If so, (optionally) remove and free it.

Parameters
opthe object to check
Returns
whether the object was freed

Definition at line 565 of file time.cpp.

References FLAG_NO_DROP, FLAG_REMOVED, FREE_OBJ_FREE_INVENTORY, object_free(), object_remove(), give::op, and QUERY_FLAG.

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

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

◆ free_quest()

void free_quest ( void  )

Free all quest status structures. It is all right to call quest functions again after that.

Definition at line 891 of file quest.cpp.

References free_state(), free_string(), give::next, quest_player::next, quest_player::player_name, and player_states.

Referenced by cleanup(), command_purge_quest(), and free_server().

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

◆ free_quest_definitions()

void free_quest_definitions ( void  )

Referenced by cleanup().

+ Here is the caller graph for this function:

◆ free_races()

void free_races ( void  )

Frees all race-related information.

Definition at line 95 of file races.cpp.

References llevDebug, LOG(), and races.

Referenced by free_server().

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

◆ free_server()

void free_server ( void  )

Frees all memory allocated around here:

  • materials
  • races

Definition at line 1123 of file init.cpp.

References Settings::disabled_plugins, free_materials(), free_quest(), free_races(), and settings.

Referenced by cleanup().

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

◆ friendly_fire()

int friendly_fire ( object op,
object hitter 
)

Find out if this is friendly fire (PVP and attacker is peaceful) or not

Parameters
opvictim.
hitterattacker.
Returns
0 this is not friendly fire, 1 if hitter is a peaceful player, 2 if hitter is a pet of a peaceful player.

Definition at line 1854 of file attack.cpp.

References object::contr, DISEASE, HEAD, death_message::hitter, object_get_owner(), give::op, player::peaceful, PLAYER, POISONING, RUNE, SPELL, and object::type.

Referenced by hit_player().

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

◆ get_attack_message_for_attack_type()

void get_attack_message_for_attack_type ( int  dam,
uint8_t  atm_type,
const char *  victim_name,
char *  buf1,
char *  buf2 
)

Get the attack message for a damage and a type.

Parameters
damdamage done.
atm_typeone Attack types of type ATM_xxx.
victim_namename of the victim of the attack.
[out]buf1where to write the message for the one doing the attack, must be at least MAX_BUF long.
[out]buf2where to write the message for the victim of the attack, must be at least MAX_BUF long.

Definition at line 538 of file attack.cpp.

References attack_mess, attackmess_t::level, MAX_BUF, and MAXATTACKMESS.

Referenced by AttackMessagePanel::currentCellChanged(), and get_attack_message().

+ Here is the caller graph for this function:

◆ get_name()

void get_name ( object op)

Waiting for the player's name.

Parameters
opplayer.

Definition at line 881 of file player.cpp.

References i18n(), give::op, player_set_state(), send_query(), and ST_GET_NAME.

Referenced by add_player(), receive_play_again(), receive_player_name(), receive_player_password(), and wrong_password().

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

◆ get_nearest_criminal()

object* get_nearest_criminal ( object mon)

Definition at line 583 of file player.cpp.

References first_player, is_criminal(), mon, monster_can_detect_enemy(), give::op, and altar_valkyrie::pl.

Referenced by monster_find_enemy().

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

◆ get_nearest_player()

object* get_nearest_player ( object mon)

Finds the nearest visible player or player-friendly for some object.

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

Definition at line 540 of file player.cpp.

References rv_vector::distance, first_player, FLAG_FREED, FLAG_FRIENDLY, free_objectlink(), get_friends_of(), guildoracle::list, mon, monster_can_detect_enemy(), objectlink::next, objectlink::ob, give::op, altar_valkyrie::pl, and QUERY_FLAG.

Referenced by monster_find_enemy(), monster_move(), and START_TEST().

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

◆ get_party_password()

int get_party_password ( object op,
partylist party 
)

Ask the player for the password of the party she wants to join.

Parameters
opplayer.
partyparty op wishes to join.
Returns
whether a party password has been requested from the client

Definition at line 1021 of file player.cpp.

References CS_QUERY_HIDEINPUT, i18n(), give::op, party_get_password(), player_set_state(), send_query(), and ST_GET_PARTY_PASSWORD.

Referenced by command_party().

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

◆ get_password()

void get_password ( object op)

Waiting for the player's password.

Parameters
opplayer.

Definition at line 892 of file player.cpp.

References CS_QUERY_HIDEINPUT, i18n(), give::op, player_set_state(), send_query(), and ST_GET_PASSWORD.

Referenced by receive_player_name().

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

◆ get_player()

player* get_player ( player p)

Create a player's object, initialize a player's structure.

This no longer sets the player map. Also, it now updates all the pointers so the caller doesn't need to do that. Caller is responsible for setting the correct map.

Redo this to do both get_player_ob and get_player. Hopefully this will be bugfree and simpler.

Parameters
pif NULL, a new player structure is created, else p is recycled.
Returns
initialized player structure.

Definition at line 285 of file player.cpp.

References add_string(), arch_to_object(), bow_normal, player::bowtype, living::Cha, CLEAR_FLAG, clear_los(), clear_player(), living::Con, living::Dex, player::do_los, living::exp, fatal(), first_map_path, first_player, FLAG_READY_SKILL, player::gen_sp_armour, get_player_archetype(), i18n_get_language_by_code(), living::Int, player::language, player::last_applied_stats, player::last_character_flags, player::last_resist, player::last_skill_exp, player::last_skill_ob, player::last_speed, player::last_stats, player::last_weapon_sp, player::last_weight, player::listening, MAX_SKILLS, player::no_shout, NROFATTACKS, player::ob, offsetof, give::op, OUT_OF_MEMORY, player::party, party_rejoin_if_exists, player::peaceful, pet_normal, player::petmode, player_set_state(), living::Pow, range_none, player::rejoin_party, roll_stats(), player::savebed_map, player::shoottype, ST_ROLL_STAT, living::Str, player::swap_first, player::ticks_played, player::title, Ice::tmp, player::unapply, unapply_nochoice, player::unarmed_skill, and living::Wis.

Referenced by account_play_cmd(), add_player(), make_perma_dead(), and receive_play_again().

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

◆ get_reply_text_own()

const char* get_reply_text_own ( reply_type  rt)

Return the verb for the player's dialog type.

Parameters
rtdialog type.
Returns
verb.

Definition at line 2318 of file monster.cpp.

References rt_question, rt_reply, and rt_say.

Referenced by convertType(), CREMessageTypeDelegate::createEditor(), and monster_communicate().

+ Here is the caller graph for this function:

◆ give_initial_items()

void give_initial_items ( object pl,
treasurelist items 
)

Gives a new player her initial items.

They will be god-given, and suitable for the player's race/restrictions.

Parameters
plplayer.
itemstreasure list containing the items.

Now we do a second loop, to apply weapons/armors/... This is because weapons require the skill, which can be given after the first loop.

Definition at line 784 of file player.cpp.

References AP_NOPRINT, apply_manual(), CLEAR_FLAG, create_treasure(), FLAG_APPLIED, FLAG_CAN_USE_SKILL, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_INV_LOCKED, FLAG_NEUTRAL, FLAG_STARTEQUIP, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, FOR_INV_FINISH, FOR_INV_PREPARE, FORCE, is_valid_types_gen::found, GT_ONLY_GOOD, GT_STARTEQUIP, IS_ARMOR, is_identifiable_type(), IS_SHIELD, IS_WEAPON, link_player_skills(), llevError, LOG(), object_can_merge(), object_free_drop_inventory(), object_remove(), give::op, altar_valkyrie::pl, PLAYER, QUERY_FLAG, SET_FLAG, SKILL, SPELLBOOK, and Ice::tmp.

Referenced by apply_changes_to_player(), apply_race_and_class(), and key_change_class().

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

◆ handle_newcs_player()

int handle_newcs_player ( object op)

Handles commands the player can send us, and various checks on invisibility, golem and such.

This is sort of special, in that the new client/server actually uses the new speed values for commands.

Parameters
opplayer to handle.
Returns
true if there are more actions we can do.

Definition at line 3086 of file player.cpp.

References CLEAR_FLAG, draw_ext_info(), FLAG_MAKE_INVIS, FLAG_PARALYZED, FLAG_REMOVED, FLAG_SCARED, flee_player(), make_visible(), move_player(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_SPELL, MSG_TYPE_SPELL_END, NDI_UNIQUE, give::op, PLAYER, pticks, QUERY_FLAG, and range_golem.

Referenced by process_players1().

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

◆ hide()

int hide ( object op,
object skill 
)

Main hide handling.

Parameters
opliving trying to hide.
skillhiding skill.
Returns
experience gained for the skill use (can be 0).

Definition at line 496 of file skills.cpp.

References attempt_hide(), calc_skill_exp(), draw_ext_info(), FLAG_MAKE_INVIS, object::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, object_update(), give::op, PLAYER, QUERY_FLAG, and UP_OBJ_FACE.

Referenced by do_hidden_move(), and do_skill().

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

◆ hideability()

int hideability ( object ob)

Look at the surrounding terrain to determine the hideability of this object. Positive levels indicate greater hideability.

Parameters
obobject that may want to hide.
Returns
the higher the value, the easier to hide here.

Definition at line 3992 of file player.cpp.

References freearr_x, freearr_y, get_map_flags(), has_carried_lights(), level, guildjoin::ob, P_BLOCKSVIEW, P_OUT_OF_MAP, diamondslots::x, and diamondslots::y.

Referenced by attempt_hide(), and do_hidden_move().

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

◆ hiscore_check()

void hiscore_check ( object op,
int  quiet 
)

Checks if player should enter the hiscore, and if so writes her into the list.

Parameters
opplayer to check.
quietIf set, don't print anything out - used for periodic updates during game play or when player unexpected quits - don't need to print anything in those cases

Definition at line 348 of file hiscore.cpp.

References add_score(), BIG_NAME, draw_ext_info(), draw_ext_info_format(), draw_one_high_score(), score::exp, FLAG_WAS_WIZ, FMT64, FOR_INV_FINISH, FOR_INV_PREPARE, get_skill_client_code(), HIGHSCORE_LENGTH, hiscore_tables, make_face_from_files::int, score::killer, llevDebug, LOG(), score::maplevel, MAX_BUF, score::maxgrace, score::maxhp, score::maxsp, diamondslots::message, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, score::name, NDI_UNIQUE, give::op, player_get_title(), score::position, PROFILE_BEGIN, PROFILE_END, QUERY_FLAG, SKILL, score::title, and Ice::tmp.

Referenced by apply_savebed(), emergency_save(), key_confirm_quit(), kill_player_permadeath(), leave(), and process_players1().

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

◆ hiscore_display()

void hiscore_display ( object op,
int  max,
const char *  match 
)

Displays the high score file.

Parameters
opplayer asking for the score file.
maxmaximum number of scores to display.
matchif non-empty, will only print players with name or title containing the string (non case-sensitive). Other options: -s:[name] – show the table for the skill 'name' instead of overall -s – show a short list for each skill

Definition at line 451 of file hiscore.cpp.

References draw_ext_info(), draw_ext_info_format(), draw_one_high_score(), score_table::entry, HIGHSCORE_LENGTH, hiscore_tables, llevDebug, LOG(), push::match, say::max, MAX_BUF, MAX_SKILLS, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, give::name, score::name, NDI_UNIQUE, give::op, and strcasestr_local.

Referenced by command_hiscore().

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

◆ hiscore_init()

void hiscore_init ( void  )

Initializes the module.

Note
There is one table per skill, as well as the "Overall" table, each saved in a file in .../var/crossfire/hiscores/[skill_name] or as configured in config.h.

Definition at line 296 of file hiscore.cpp.

References c, get_skill_client_code(), HIGHSCORE_DIR, hiscore_load(), hiscore_tables, Settings::localdir, MAX_BUF, MAX_SKILLS, give::name, OLD_HIGHSCORE, settings, and skill_names.

Referenced by init().

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

◆ hit_map()

int hit_map ( object op,
int  dir,
uint32_t  type,
int  full_hit 
)

Attack a spot on the map.

Parameters
opobject hitting the map.
dirdirection op is hitting/going.
typeattacktype.
full_hitif set then monster area does not matter, it gets all damage. Else damage is proportional to affected area vs full monster area.
Returns
1 if it hits something, 0 otherwise.

Definition at line 355 of file attack.cpp.

References AT_CHAOS, AT_COUNTERSPELL, AT_MAGIC, counterspell(), FLAG_ALIVE, FLAG_FREED, FLAG_REMOVED, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, hit_player(), llevError, LOG(), disinfect::map, object_update(), object_was_destroyed, give::op, P_OUT_OF_MAP, altar_valkyrie::pl, PLAYER, QUERY_FLAG, save_throw_object(), shuffle_attack(), Ice::tmp, TRANSPORT, is_valid_types_gen::type, UP_OBJ_FACE, diamondslots::x, and diamondslots::y.

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

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

◆ hit_player()

int hit_player ( object op,
int  dam,
object hitter,
uint32_t  type,
int  full_hit 
)

Object is attacked by something.

This isn't used just for players, but in fact most objects.

Oct 95 - altered the following slightly for MULTIPLE_GODS hack which needs new attacktype AT_HOLYWORD to work . b.t.

Parameters
opobject to be hit
dambase damage - protections/vulnerabilities/slaying matches can modify it.
hitterwhat is hitting the object
typeattacktype
full_hitset if monster area does not matter.
Returns
dealt damage.
Todo:
rename to something more meaningful.

Definition at line 1903 of file attack.cpp.

References abort_attack(), AT_CHAOS, AT_DEATH, AT_HOLYWORD, AT_MAGIC, AT_PARALYZE, AT_PHYSICAL, AT_SLOW, ATNR_MAGIC, attack_message(), ATTACKS, change_object(), CLEAR_FLAG, determine_god(), did_make_save(), DOOR, EVENT_ATTACKED, events_execute_object_event(), 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, FOR_INV_FINISH, FOR_INV_PREPARE, friendly_fire(), get_attack_mode(), hit_with_one_attacktype(), death_message::hitter, commongive::inv, kill_object(), llevDebug, LOG(), monster_npc_call_help(), archetype::more, NROFATTACKS, object_find_by_type2(), object_free_drop_inventory(), object_get_owner(), object_remove(), object_set_enemy(), object_was_destroyed, give::op, op_on_battleground(), PLAYER, QUERY_FLAG, RANDOM, remove_friendly_object(), rndm(), RUNE, scare_creature(), SCRIPT_FIX_ALL, SET_FLAG, Settings::set_friendly_fire, settings, spring_trap(), tear_down_wall(), Ice::tmp, TRAP, is_valid_types_gen::type, and undead_name.

Referenced by attack_ob_simple(), cast_destruction(), cast_earth_to_dust(), cast_light(), check_bullet(), check_heal_and_mana(), enter_exit(), gate_type_process(), hit_map(), legacy_ob_process(), monster_check_doors(), monster_check_earthwalls(), move_symptom(), poison_type_apply(), poisoning_type_process(), rune_attack(), spell_effect_type_move_on(), spell_failure(), and START_TEST().

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

◆ hit_with_arrow()

object* hit_with_arrow ( object op,
object victim 
)

hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile.

Parameters
opmissile hitting.
victimwho is hit by op.
Returns
pointer to the reassembled missile, or NULL if the missile isn't available anymore.

Definition at line 979 of file attack.cpp.

References add_refcount(), attack_ob_simple(), object::count, EVENT_ATTACKS, EVENT_CONNECTOR, events_execute_object_event(), fix_stopped_arrow(), FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, free_no_drop(), free_string(), death_message::hitter, INS_NO_MERGE, INS_NO_WALK_ON, object::map, object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_merge(), object_remove(), object_set_owner(), object_was_destroyed, give::op, SCRIPT_FIX_ALL, object::skill, stick_arrow(), reputation::victim, object::x, and object::y.

Referenced by common_process_projectile(), and common_projectile_move_on().

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

◆ identify_object_with_skill()

int identify_object_with_skill ( object tmp,
object pl,
object skill,
int  print_on_success 
)

Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conveniently.

Identification will be attempted as many times as NROF(tmp), and tmp will be split if needed. This is to allow players to maximise experience for identification without having to resort to picking one item, moving, attempting identification of the item, and such.

See https://sourceforge.net/p/crossfire/feature-requests/244/

Parameters
tmpobject to try to identify.
plobject identifying.
skillidentification skill.
print_on_success1 to print a description if the object is identified, 0 to leave it to the calling function
Returns
experience for successful identification.

Definition at line 810 of file skills.cpp.

References calc_skill_exp(), die_roll(), draw_ext_info_format(), object::env, FLAG_NO_SKILL_IDENT, identify(), if(), INS_BELOW_ORIGINATOR, is_identified(), object::level, object::map, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, NROF(), ob_describe(), object_insert_in_map_at(), object_insert_in_ob(), object_merge(), object_split(), altar_valkyrie::pl, PLAYER, PREFER_LOW, QUERY_FLAG, rndm(), SET_FLAG, Ice::tmp, object::x, and object::y.

Referenced by do_skill_ident(), and examine_autoidentify().

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

◆ infect_object()

int infect_object ( object victim,
object disease,
int  force 
)

Try to infect something with a disease. Rules:

  • objects with immunity aren't infectable.
  • objects already infected aren't infectable.
  • dead objects aren't infectable.
  • undead objects are infectible only if specifically named.
Parameters
victimpotential victim to infect.
diseasewhat could infect.
forcedon't do a random check for infection. Other checks (susceptible to disease, not immune, and so on) are still done.
Return values
0victim wasn't infected.
1victim was infected.

Definition at line 317 of file disease.cpp.

References add_refcount(), buf, DISEASE, draw_ext_info(), object::env, FLAG_MONSTER, living::food, dragon_attune::force, free_string(), HEAD, is_susceptible_to_disease(), object::last_grace, object::level, object::map, living::maxgrace, living::maxhp, object::move_block, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, object::name, NDI_RED, NDI_UNIQUE, object_copy(), object_find_by_type_and_name(), object_get_owner(), object_insert_in_ob(), object_new(), object_set_owner(), op_on_battleground(), PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), SIGN, object::skill, object::stats, object::title, Ice::tmp, object::type, object::value, reputation::victim, and living::wc.

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

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

◆ init()

void init ( int  argc,
char **  argv 
)

◆ init_ob_methods()

void init_ob_methods ( void  )

Initializes the ob_method system. This means initializing legacy_type, base_type, and also calling init_ob_types() from ob_types.c

Definition at line 35 of file ob_methods.cpp.

References ob_methods::apply, base_type, ob_methods::describe, init_ob_method_struct(), init_ob_types(), legacy_ob_apply(), legacy_ob_describe(), legacy_ob_process(), legacy_type, ob_methods::move_on, ob_methods::process, and register_all_ob_types().

Referenced by init().

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

◆ init_signals()

void init_signals ( void  )

Setup our signal handlers.

Definition at line 1310 of file init.cpp.

References rec_sighup(), and signal_shutdown().

Referenced by command_unloadplugin(), and init().

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

◆ init_skills()

void init_skills ( void  )

This just sets up the skill_names table above. The index into the array is simply the order the skill is found.

Definition at line 99 of file skill_util.cpp.

References archetypes_for_each(), do_each_skill(), MAX_SKILLS, skill_faces, skill_messages, and skill_names.

Referenced by init().

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

◆ initPlugins()

void initPlugins ( void  )

Plugins initialization. Browses the plugins directory and call plugins_init_plugin() for each file found.

Definition at line 4564 of file plugins.cpp.

References buf, closedir(), Settings::disabled_plugins, banquet::l, llevDebug, llevInfo, LOG(), opendir(), plugins_init_plugin(), readdir(), and settings.

Referenced by server_main().

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

◆ inventory()

void inventory ( object op,
object inv 
)

Prints object's inventory.

Parameters
opwho to print for.
invif NULL then print op's inventory, else print the inventory of inv.

Definition at line 2167 of file c_object.cpp.

References CONTAINER, draw_ext_info(), draw_ext_info_format(), FLAG_APPLIED, FLAG_WIZ, FOR_INV_FINISH, FOR_INV_PREPARE, commongive::inv, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_INVENTORY, give::name, NDI_UNIQUE, give::op, QUERY_FLAG, query_name(), query_weight(), and Ice::tmp.

Referenced by command_inventory(), and look_at().

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

◆ is_true_undead()

int is_true_undead ( object op)

Is the object a true undead?

Parameters
opobject to test.
Returns
1 if undead, 0 else.

Definition at line 3975 of file player.cpp.

References FLAG_UNDEAD, give::op, and QUERY_FLAG.

Referenced by makes_invisible_to(), monster_can_detect_enemy(), and monster_can_see_enemy().

+ Here is the caller graph for this function:

◆ jump()

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

Jump skill handling. This is both a new type of movement for player/monsters and an attack as well. Perhaps we should allow more spaces based on level, eg, level 50 jumper can jump several spaces?

Parameters
plobject jumping.
dirdirection to jump to.
skilljumping skill.
Returns
1 if jump was successful, 0 else

Definition at line 666 of file skills.cpp.

References attempt_jump(), draw_ext_info(), make_face_from_files::int, object::level, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, altar_valkyrie::pl, and make_face_from_files::str.

Referenced by do_skill().

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

◆ key_change_class()

void key_change_class ( object op,
char  key 
)

This function takes the key that is passed, and does the appropriate action with it (change race, or other things). The function name is for historical reasons - now we have separate race and class; this actually changes the RACE, not the class.

Parameters
opplayer.
keykey to handle.

Definition at line 1289 of file player.cpp.

References add_statbonus(), add_string(), allowed_class(), buf, CLEAR_FLAG, create_treasure(), CS_QUERY_SINGLECHAR, draw_ext_info(), draw_ext_info_format(), enter_exit(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, events_execute_global_event(), EXIT_PATH, EXIT_X, EXIT_Y, find_treasurelist(), first_map_ext_path, fix_object(), FLAG_WIZ, free_string(), get_player_archetype(), give_initial_items(), i18n(), castle_read::key, link_player_skills(), llevDebug, Settings::localdir, LOG(), make_path_to_file(), guild_questpoints_apply::mapname, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, give::name, NDI_ALL, NDI_BLUE, NDI_DK_ORANGE, NDI_UNIQUE, object_copy(), object_free_drop_inventory(), object_insert_in_map_at(), object_new(), object_remove(), object_set_msg(), object_update(), give::op, play_again(), player_set_state(), Settings::playerdir, pticks, remove_statbonus(), send_query(), SET_ANIMATION, settings, ST_PLAYING, strlcpy(), Ice::tmp, UP_OBJ_FACE, UPD_FACE, diamondslots::x, and diamondslots::y.

Referenced by reply_cmd().

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

◆ key_confirm_quit()

◆ key_roll_stat()

void key_roll_stat ( object op,
char  key 
)

Player is currently swapping stats.

This code has been greatly reduced, because with set_attr_value and get_attr_value, the stats can be accessed just numeric ids. stat_trans is a table that translate the number entered into the actual stat. It is needed because the order the stats are displayed in the stat window is not the same as how the number's access that stat. The table does that translation.

Parameters
opplayer.
keyreceived key.

Definition at line 1213 of file player.cpp.

References add_statbonus(), CHARISMA, CONSTITUTION, CS_QUERY_SINGLECHAR, DEXTERITY, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, i18n(), INTELLIGENCE, castle_read::key, llevError, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_BLUE, NDI_UNIQUE, give::op, play_again(), player_set_state(), POWER, roll_stats(), send_query(), SET_ANIMATION, SET_FLAG, short_stat_name, ST_CHANGE_CLASS, STRENGTH, swap_stat(), and WISDOM.

Referenced by reply_cmd().

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

◆ kill_player()

void kill_player ( object op,
const object killer 
)

Handle a player's death.

Also deals with lifesaving objects, arena deaths, cleaning disease/poison, death penalties, and removing the player file in case of permadeath.

Parameters
opPlayer to be killed.
killerThe object that's trying to kill op, which can be NULL.

Definition at line 3488 of file player.cpp.

References add_string(), arch_to_object(), buf, draw_ext_info(), EVENT_DEATH, EVENT_PLAYER_DEATH, events_execute_global_event(), events_execute_object_event(), FLESH, kill_player_not_permadeath(), kill_player_permadeath(), reputation::killer, MAX_BUF, MAX_FOOD, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_DIED, NDI_NAVY, NDI_UNIQUE, Settings::not_permadeth, object_insert_in_map_at(), object_set_msg(), give::op, op_on_battleground(), play_sound_player_only(), restore_player(), save_life(), SCRIPT_FIX_ALL, settings, SOUND_TYPE_LIVING, Ice::tmp, transfer_ob(), TRUE, diamondslots::x, and diamondslots::y.

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

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

◆ knowledge_add_probe_monster()

void knowledge_add_probe_monster ( object op,
object mon 
)

Display monster details, then add to a player's knowledge if not already.

Parameters
opplayer asking for details.
monmonster

Definition at line 1528 of file knowledge.cpp.

References buf, describe_item(), draw_ext_info(), mon, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, object::name, NDI_UNIQUE, give::op, rotate-tower::result, stringbuffer_append_printf(), stringbuffer_finish(), and stringbuffer_new().

Referenced by examine_monster().

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

◆ knowledge_first_player_save()

void knowledge_first_player_save ( player pl)

Ensure the knowledge state is correctly saved for the player. This function should only be called once, when the player's save directory is created. All other knowledge functions save the state automatically, but save can only happen when the player directory exists.

Parameters
plwho to save the state for.

Definition at line 1423 of file knowledge.cpp.

References knowledge_global, knowledge_write_player_data(), knowledge_player::next, altar_valkyrie::pl, and knowledge_player::player_name.

Referenced by save_player().

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

◆ knowledge_give()

void knowledge_give ( player pl,
const char *  marker,
const object book 
)

Give a knowledge item from its code.

Parameters
plwho to give the knowldge to.
markerknowledge's code.
bookoptional item containing the knowledge code.

Definition at line 996 of file knowledge.cpp.

References replace::current, draw_ext_info_format(), fatal(), knowledge_find(), knowledge_get_or_create(), knowledge_write_player_data(), llevError, LOG(), MSG_TYPE_CLIENT_NOTICE, MSG_TYPE_MISC, object::name, NDI_UNIQUE, OUT_OF_MEMORY, altar_valkyrie::pl, TAG_END, TAG_START, and is_valid_types_gen::type.

Referenced by cfapi_player_knowledge(), and knowledge_read().

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

◆ knowledge_item_can_be_used_alchemy()

void knowledge_item_can_be_used_alchemy ( object op,
const object item 
)

Displays known alchemy recipes an item can be used in.

Parameters
opwho to display recipes for.
itemwhat to check formulae for.

Definition at line 1334 of file knowledge.cpp.

References buf, draw_ext_info(), knowledge_item::handler, knowledge_item::item, knowledge_player::item_count, knowledge_player::items, knowledge_get_or_create(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, give::name, NDI_UNIQUE, give::op, PLAYER, rotate-tower::result, stringbuffer_append_string(), stringbuffer_finish(), and knowledge_type::use_alchemy.

Referenced by examine().

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

◆ knowledge_player_knows()

int knowledge_player_knows ( const player pl,
const char *  knowledge 
)

Determines whether a player knows a specific knowledge or not.

Parameters
plwho to check knowledge for.
knowledgewhat to check for, in format "type:(type specific value)".
Returns
0 if item is known, 1 else.

Definition at line 1298 of file knowledge.cpp.

References replace::current, giveknowledge::knowledge, knowledge_find(), knowledge_get_or_create(), knowledge_known(), llevError, LOG(), MAX_BUF, altar_valkyrie::pl, strlcpy(), and is_valid_types_gen::type.

Referenced by cfapi_player_knowledge().

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

◆ knowledge_process_incremental()

void knowledge_process_incremental ( void  )

◆ knowledge_read()

void knowledge_read ( player pl,
object book 
)

Player is reading a book, give knowledge if needed, warn player, and such.

Parameters
plwho is reading.
bookwhat is read.

Definition at line 1056 of file knowledge.cpp.

References knowledge_give(), object_get_value(), altar_valkyrie::pl, and sstring.

Referenced by apply_sign(), and book_type_apply().

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

◆ knowledge_send_info()

void knowledge_send_info ( socket_struct ns)

Send the reply_info for 'knowledge_info'.

Parameters
nssocket to send information to.

Definition at line 1374 of file knowledge.cpp.

References knowledge_type::attempt_alchemy, esrv_send_face(), socket_struct::faces_sent, knowledges, give::name, NS_FACESENT_FACE, Face::number, Send_With_Handling(), SockList_AddPrintf(), SockList_AddString(), SockList_Init(), SockList_Term(), try_find_face(), is_valid_types_gen::type, and knowledge_type::type.

Referenced by request_info_cmd().

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

◆ knowledge_send_known()

void knowledge_send_known ( player pl)

Send initial known knowledge to player, if requested.

Parameters
plwho to send knowledge for.

Definition at line 1403 of file knowledge.cpp.

References knowledge_get_or_create(), altar_valkyrie::pl, and knowledge_player::sent_up_to.

Referenced by check_login().

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

◆ learn_skill()

int learn_skill ( object pl,
object scroll 
)

Player is trying to learn a skill. Success is based on Int.

This inserts the requested skill in the player's inventory. The skill field of the scroll should have the exact name of the requested skill.

This one actually teaches the player the skill as something they can equip.

Return values
0player already knows the skill.
1the player learns the skill.
2some failure.

Definition at line 759 of file skill_util.cpp.

References FLAG_CAN_USE_SKILL, FOR_INV_FINISH, FOR_INV_PREPARE, get_learn_spell(), give_skill_by_name(), commongive::inv, link_player_skills(), llevError, LOG(), object::name, altar_valkyrie::pl, PREFER_LOW, QUERY_FLAG, random_roll(), SET_FLAG, SKILL, object::skill, and Ice::tmp.

Referenced by skillscroll_type_apply().

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

◆ leave()

void leave ( player pl,
int  draw_exit 
)

Player logs out, or was disconnected.

Parameters
plplayer.
draw_exitif set, display leaving message to other players.

Definition at line 1305 of file server.cpp.

References DEAD_OBJECT, draw_ext_info_format(), FLAG_REMOVED, FLAG_WIZ, hiscore_check(), llevInfo, LOG(), MAP_IN_MEMORY, MAP_TIMEOUT, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_PLAYER, give::name, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, Ns_Dead, object_remove(), party_leave(), pets_terminate_all(), altar_valkyrie::pl, QUERY_FLAG, query_name(), ST_CONFIRM_PASSWORD, ST_GET_NAME, and ST_GET_PASSWORD.

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

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

◆ legacy_animate_trigger()

void legacy_animate_trigger ( object op)

Definition at line 866 of file time.cpp.

References animate_trigger(), and give::op.

Referenced by legacy_ob_process().

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

◆ legacy_move_hole()

void legacy_move_hole ( object op)

Definition at line 870 of file time.cpp.

References move_hole(), and give::op.

Referenced by legacy_ob_process().

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

◆ legacy_remove_force()

void legacy_remove_force ( object op)

Definition at line 862 of file time.cpp.

References give::op, and remove_force().

Referenced by legacy_ob_process().

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

◆ legal_range()

int legal_range ( object op,
int  r 
)

Check for the validity of a player range.

This function could probably be simplified, eg, everything should index into the ranges[] array.

Parameters
opplayer to check.
rrange to check.
Return values
1range specified is legal - that is, the character has an item that is equipped for that range type.
0no item of that range type that is usable.

Definition at line 247 of file c_range.cpp.

References give::op, ring_occidental_mages::r, range_bow, range_golem, range_magic, range_misc, range_none, and range_skill.

Referenced by change_spell(), and check_login().

+ Here is the caller graph for this function:

◆ list_players()

void list_players ( object op,
region reg,
partylist party 
)

Displays the players in a region or party. If both are NULL, all players are listed.

Parameters
opwho is asking for player list.
regregion to display players of.
partyparty to list.

Definition at line 550 of file c_misc.cpp.

References display_who_entry(), draw_ext_info(), draw_ext_info_format(), find_player(), first_player, FLAG_AFK, FLAG_WIZ, get_region_by_map(), chars_names::login_order, region::longname, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, region::name, name_cmp(), NDI_UNIQUE, give::op, partylist::partyname, altar_valkyrie::pl, QUERY_FLAG, region_is_child_of_region(), settings, ST_GET_PARTY_PASSWORD, ST_PLAYING, Settings::who_format, and Settings::who_wiz_format.

Referenced by command_party(), and command_who().

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

◆ load_races()

void load_races ( BufferReader reader,
const char *   
)

Reads the races file in the lib/ directory, then overwrites old 'race' entries. This routine allow us to quickly re-configure the 'alignment' of monsters, objects. Useful for putting together lists of creatures, etc that belong to gods.

Definition at line 49 of file races.cpp.

References addToRace, buf, bufferreader_next_line(), llevDebug, LOG(), and MAX_BUF.

Referenced by add_server_collect_hooks().

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

◆ lookup_spell_by_name()

object* lookup_spell_by_name ( object op,
const char *  spname 
)

Look at object 'op' and see if they know the spell spname. This is pretty close to check_spell_known above, but it uses a looser matching mechanism.

Parameters
opobject we're searching the inventory.
spnamepartial spell name.
Returns
matching spell object, or NULL. If we match multiple spells but don't get an exact match, we also return NULL.

Definition at line 410 of file spell_util.cpp.

References FOR_INV_FINISH, FOR_INV_PREPARE, llevError, LOG(), give::op, and SPELL.

Referenced by command_cast_spell(), and command_forget_spell().

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

◆ magic_wall()

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

◆ make_visible()

void make_visible ( object op)

Makes an object visible again.

Parameters
opwhat to make visible.

Definition at line 3956 of file player.cpp.

References FREE_AND_CLEAR_STR, object_update(), give::op, PLAYER, and UP_OBJ_FACE.

Referenced by attack_ob_simple(), attempt_steal(), do_hidden_move(), fire(), handle_newcs_player(), hide(), monster_can_detect_enemy(), monster_can_see_enemy(), move_player_attack(), and player_attack_door().

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

◆ makes_invisible_to()

int makes_invisible_to ( object pl,
object mon 
)

This checks to see if 'pl' is invisible to 'mon'. Does race check, undead check, etc Returns TRUE if mon can't see pl, false otherwise. This doesn't check range, walls, etc. It only checks the racial adjustments, and in fact that pl is invisible.

Parameters
plpotentially invisible object.
monwho may see pl.
Return values
0mon can see pl.
1mon can't see pl.

Definition at line 756 of file spell_effect.cpp.

References FLAG_UNDEAD, is_true_undead(), mon, altar_valkyrie::pl, PLAYER, QUERY_FLAG, and object::race.

Referenced by cast_invisible(), and monster_can_see_enemy().

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

◆ map_can_reset()

bool map_can_reset ( const mapstruct map,
long  current_time 
)

Returns whether a map can be reset, including all other maps in the same reset group.

Parameters
mapmap to consider.
current_timecurrent time.
Returns
false if the map can't be reset, true if the map can be reset.

Definition at line 266 of file swap.cpp.

References first_map, disinfect::map, map_can_reset_no_group(), mapstruct::next, and mapstruct::reset_group.

Referenced by flush_old_maps().

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

◆ meditate()

void meditate ( object pl,
object skill 
)

Meditation skill handling.

This skill allows the player to regain a few sp or hp for a brief period of concentration. The amount of time needed to concentrate and the # of points regained is dependant on the level of the user.

Depending on the level, the player can wear armour or not.

Author
b.t. thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du
Parameters
pllivng meditating, should be a player.
skillmeditation skill.

Definition at line 1432 of file skills.cpp.

References ARMOUR, BOOTS, draw_ext_info(), FLAG_APPLIED, FLAG_READY_WEAPON, FOR_INV_FINISH, FOR_INV_PREPARE, GLOVES, HELMET, object::level, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, NDI_UNIQUE, altar_valkyrie::pl, PLAYER, QUERY_FLAG, SHIELD, and Ice::tmp.

Referenced by do_skill().

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

◆ min_casting_level()

int min_casting_level ( const object caster,
const object spell 
)

This function takes a caster and spell and presents the effective level the caster needs to be to cast the spell. Basically, it just adjusts the spell->level with attuned/repelled spellpaths.

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

Definition at line 164 of file spell_util.cpp.

References object::level, MAX, object::path_attuned, object::path_denied, and object::path_repelled.

Referenced by cast_spell(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), and SP_level_wc_adjust().

+ Here is the caller graph for this function:

◆ monster_can_detect_enemy()

int monster_can_detect_enemy ( object op,
object enemy,
rv_vector rv 
)

Determine if we can 'detect' the enemy. Check for walls blocking the los. Also, just because its hidden/invisible, we may be sensitive/smart enough (based on Wis & Int) to figure out where the enemy is. -b.t.

Modified by MSW to use the get_rangevector so that map tiling works properly. I also so odd code in place that checked for x distance OR y distance being within some range - that seemed wrong - both should be within the valid range. MSW 2001-08-05

Parameters
opwho should detect.
enemywhat to detect.
rvif the function returns 1, contains the range vector towards enemy.
Returns
0 if enemy can not be detected, 1 if it is detected

Definition at line 2581 of file monster.cpp.

References object::contr, rv_vector::distance, draw_ext_info_format(), find_skill_by_number(), FLAG_SEE_IN_DARK, FLAG_STEALTH, FLAG_WIZ, get_rangevector(), player::hidden, object::hide, object::invisible, is_true_undead(), object::level, llevError, LOG(), make_visible(), disinfect::map, object::map, MAX, MAX_BUF, MIN_MON_RADIUS, monster_can_see_enemy(), monster_stand_in_light(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, give::name, NDI_UNIQUE, give::op, PLAYER, player_can_view(), QUERY_FLAG, query_name(), RANDOM, SK_HIDING, player::tmp_invis, and object::type.

Referenced by attempt_steal(), get_nearest_criminal(), get_nearest_player(), monster_check_enemy(), and pets_get_enemy().

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

◆ monster_can_see_enemy()

int monster_can_see_enemy ( object op,
object enemy 
)

Assuming no walls/barriers, lets check to see if its possible to see an enemy. Note, "detection" is different from "seeing". See monster_can_detect_enemy() for more details. -b.t.

Parameters
opwho is trying to see enemy.
enemyvictim op is trying to see.
Returns
0 if can't be seen, 1 if can be

Definition at line 2782 of file monster.cpp.

References mapstruct::darkness, draw_ext_info(), FLAG_ALIVE, FLAG_BLIND, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_XRAYS, has_carried_lights(), HEAD, object::hide, object::invisible, is_true_undead(), make_visible(), makes_invisible_to(), object::map, monster_stand_in_light(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, give::op, PLAYER, player_can_view(), QUERY_FLAG, and object::type.

Referenced by adj_attackroll(), attack_ob_simple(), monster_can_detect_enemy(), and pets_get_enemy().

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

◆ monster_check_apply_all()

void monster_check_apply_all ( object monster)

Calls monster_check_apply() for all inventory objects.

Parameters
monsterthe monster to operate on

Definition at line 1999 of file monster.cpp.

References fix_object(), FOR_INV_FINISH, FOR_INV_PREPARE, object::head, commongive::inv, and monster_check_apply().

Referenced by apply_auto_fix(), command_create(), fix_summon_pet(), generate_monster_arch(), generate_monster_inv(), pets_summon_object(), polymorph_living(), and START_TEST().

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

◆ monster_check_doors()

void monster_check_doors ( object op,
mapstruct m,
int  x,
int  y 
)

Living creature attempts to open a door.

Parameters
opcreature to consider.
mmap to consider.
xcoordinate.
ycoordinate.

Definition at line 2278 of file monster.cpp.

References AT_PHYSICAL, DOOR, FOR_MAP_FINISH, FOR_MAP_PREPARE, hit_player(), m, give::op, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by move_ob().

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

◆ monster_check_earthwalls()

void monster_check_earthwalls ( object op,
mapstruct m,
int  x,
int  y 
)

Living creature attempts to hit an earthwall.

Parameters
opcreature to consider.
mmap to consider.
xcoordinate.
ycoordinate.

Definition at line 2262 of file monster.cpp.

References AT_PHYSICAL, EARTHWALL, FOR_MAP_FINISH, FOR_MAP_PREPARE, hit_player(), m, give::op, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by move_ob().

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

◆ monster_check_enemy()

object* monster_check_enemy ( object npc,
rv_vector rv 
)

Checks npc->enemy and returns that enemy if still valid, NULL otherwise. This is map tile aware. If this returns an enemy, the range vector rv should also be set to sane values.

Parameters
npcmonster we're considering
[out]rvwill contain vector to go to enemy if function returns not NULL.
Returns
valid enemy for npc.

Definition at line 72 of file monster.cpp.

References object::enemy, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NEUTRAL, FLAG_REMOVED, GOLEM, HI4, monster_can_detect_enemy(), npc_dialog::npc, object_get_owner(), object_set_enemy(), object_value_set(), on_same_map(), PETMOVE, pets_should_arena_attack(), PLAYER, and QUERY_FLAG.

Referenced by monster_find_enemy(), and pets_get_enemy().

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

◆ monster_communicate()

void monster_communicate ( object op,
const char *  txt 
)

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

The process is such:

  • first, build up information on NPCs reacting to what is said, replies
  • second, figure what the player will be displayed as said
  • third, have the player actually talk
  • fourth, the NPCs talk too
  • fifth: show the player available replies

There is a rare event that the orig_map is used for - basically, if a player says the magic word that gets him teleported off the map, it can result in the new map putting the object count too high, which forces the swap out of some other map. In some cases, the map the player was just on now gets swapped out - thus, the object on that map are no longer in memory. So check to see if the players map changes, and if so, don't process any further. If it does change, most likely we don't care about the results of further conversation. Also, depending on the value of i, the conversation would continue on the new map, which probably isn't what is really wanted either.

Parameters
opwho is saying something.
txtwhat is said.

Definition at line 2374 of file monster.cpp.

References draw_ext_info(), draw_ext_info_format(), ext_info_map_except(), FOR_MAP_FINISH, FOR_MAP_PREPARE, free_string(), freearr_x, freearr_y, get_map_flags(), get_reply_text_other(), get_reply_text_own(), llevDebug, LOG(), MAX_BUF, talk_info::message, talk_info::message_type, monster_do_say(), monster_talk_to_npc(), MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_SAY, NDI_WHITE, npc_dialog::npc, talk_info::npc_msg_count, talk_info::npc_msgs, give::op, P_OUT_OF_MAP, talk_info::replies, talk_info::replies_count, talk_info::replies_words, SIZEOFFREE2, talk_info::text, talk_info::who, diamondslots::x, and diamondslots::y.

Referenced by command_say().

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

◆ monster_compute_path()

int monster_compute_path ( object source,
object target,
int  default_dir 
)

Computes a path from source to target. Takes into account walls, other living things, and such. Only works if both items are on same map.

Computes the path from target to source, so that the last direction is the one we need.

Parameters
sourcewhat wants to move.
targettarget to go to.
default_dirgeneral direction from source to target.
Returns
direction to go into. Will be default_dir if no path found.
Todo:
cache path, smart adjustment and such things to not compute all the time ; try directions randomly.

Also, do a quick check to make sure our source monster is not completely sandwiched Do this before we malloc our distance array since we can check this without needing that array.

Does not do multitile right: I keep seeing two-tile monsters that can only go south not do so because of this code. So skip multitile monsters. – 2018-05-28

It is worth noting that the variables used here are also used later – their info here is irrelevant there, and vice versa. Neila Hawkins 2018-02-12

Definition at line 463 of file monster.cpp.

References absdir(), object::attack_movement, replace::current, path_data::distance, estimate_distance(), fatal(), FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, freearr_x, freearr_y, GET_MAP_OB, mapstruct::height, path_data::heuristic_dist, living::Int, object::map, MAX_EXPLORE, minheap_init_static(), minheap_insert(), minheap_remove(), object::more, object::move_type, MOVE_WALK, path_data::movement_penalty, ob_blocked(), OUT_OF_MEMORY, OUT_OF_REAL_MAP, path_measure_func(), RANDOM, RUSH, object::stats, Ice::tmp, mapstruct::width, living::Wis, diamondslots::x, object::x, path_data::x, diamondslots::y, object::y, and path_data::y.

Referenced by monster_move(), and move_to().

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

◆ monster_do_living()

void monster_do_living ( object op)

For a monster, regenerate hp and sp, potentially clear scared status.

Parameters
opmonster. Must have FLAG_MONSTER set.

Definition at line 719 of file monster.cpp.

References CLEAR_FLAG, FABS, FLAG_MONSTER, FLAG_RUN_AWAY, FLAG_SCARED, make_face_from_files::int, MIN, give::op, QUERY_FLAG, and RANDOM.

Referenced by CRECombatSimulator::fight(), monster_move(), and monsterFight().

+ Here is the caller graph for this function:

◆ monster_do_say()

void monster_do_say ( const mapstruct map,
const char *  message 
)

Output a NPC message on a map.

Parameters
mapwhere to talk to.
messagewhat to say.

Definition at line 2292 of file monster.cpp.

References ext_info_map(), disinfect::map, diamondslots::message, MSG_TYPE_DIALOG, MSG_TYPE_DIALOG_NPC, NDI_NAVY, and NDI_UNIQUE.

Referenced by monster_communicate(), and monster_npc_say().

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

◆ monster_find_nearest_enemy()

object* monster_find_nearest_enemy ( object npc,
object owner 
)

Returns the nearest enemy (monster or generator) which is visible to npc. Directions are randomized so if multiple monsters are at the same distance, the same won't always be selected. This function is map tile aware.

Parameters
npcmonster to consider
ownerif not NULL, then search will:
  • ignore peaceful players if owner is peaceful
  • ignore other monsters with the same owner
Returns
enemy, or NULL if none found.

Definition at line 175 of file monster.cpp.

References can_see_monsterP(), FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_search_arr(), is_enemy(), m, npc_dialog::npc, P_IS_ALIVE, P_OUT_OF_MAP, SIZEOFFREE, and Ice::tmp.

Referenced by monster_find_enemy(), pets_get_enemy(), and START_TEST().

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

◆ monster_find_throw_ob()

object* monster_find_throw_ob ( object op)

Find an item for the monster to throw. Modeled on find_throw_ob(). This is probably overly simplistic as it is now - We want monsters to throw things like chairs and other pieces of furniture, even if they are not good throwable objects. Probably better to have the monster throw a throwable object first, then throw any non equipped weapon.

Parameters
opmonster to find an item to throw for.
Returns
item, NULL if none suitable.

Definition at line 2542 of file monster.cpp.

References FLAG_APPLIED, FLAG_IS_THROWN, FOR_INV_FINISH, FOR_INV_PREPARE, llevDebug, LOG(), MAX_BUF, give::op, QUERY_FLAG, query_name(), and Ice::tmp.

Referenced by skill_throw().

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

◆ monster_move()

int monster_move ( object op)

Main monster processing routine.

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

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

Definition at line 854 of file monster.cpp.

References absdir(), add_refcount(), ALLRUN, animate_object(), object::attacked_by, object::attacked_by_count, CLEAR_FLAG, rv_vector::direction, DISTATT, DISTHIT, do_hidden_move(), FABS, object::face, FLAG_BLIND, FLAG_CAST_SPELL, FLAG_CONFUSED, FLAG_FREED, FLAG_FRIENDLY, FLAG_NO_ATTACK, FLAG_ONLY_ATTACK, FLAG_PARALYZED, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SCROLL, FLAG_READY_SKILL, FLAG_REMOVED, FLAG_RUN_AWAY, FLAG_SCARED, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_SLEEP, FLAG_STAND_STILL, free_string(), get_nearest_player(), get_randomized_dir(), get_rangevector(), HI4, HITRUN, llevDebug, llevMonster, LO4, LOG(), m, object::map, MIN_ACTIVE_SPEED, monster_apply_below(), monster_can_hit(), monster_cast_spell(), monster_check_pickup(), monster_check_wakeup(), monster_compute_path(), monster_dist_att(), monster_disthit_att(), monster_do_living(), monster_find_enemy(), monster_hitrun_att(), monster_move_no_enemy(), monster_move_randomly(), monster_run_att(), monster_use_bow(), monster_use_range(), monster_use_scroll(), monster_use_skill(), monster_wait_att(), monster_wait_att2(), move_object(), object::name, object_free_drop_inventory(), object_get_owner(), object_remove(), object_set_enemy(), on_same_map(), give::op, rv_vector::part, mapstruct::path, PETMOVE, pets_follow_owner(), QUERY_FLAG, RANDOM, remove_friendly_object(), RUNATT, RUSH, skill_attack(), object::stats, WAIT2, WAITATT, living::wc, object::x, and object::y.

Referenced by process_object().

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

◆ monster_npc_call_help()

void monster_npc_call_help ( object op)

A monster calls for help against its enemy.

Parameters
opmonster calling for help.

Definition at line 2012 of file monster.cpp.

References CLEAR_FLAG, FLAG_ALIVE, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), llevDebug, LOG(), m, npc_dialog::npc, object_get_value(), object_set_enemy(), give::op, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, autojail::value, diamondslots::x, and diamondslots::y.

Referenced by alchemy_failure_effect(), attack_ob_simple(), attempt_steal(), hit_player(), and push_ob().

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

◆ monster_npc_say()

void monster_npc_say ( object npc,
const char *  cp 
)

Simple function to have some NPC say something.

Parameters
npcwho should say something.
cpwhat is being said.

Definition at line 2497 of file monster.cpp.

References buf, diamondslots::message, monster_do_say(), monster_format_say(), npc_dialog::npc, and stringbuffer_finish().

Referenced by cfapi_object_say(), and monster_find_enemy().

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

◆ monster_stand_in_light()

int monster_stand_in_light ( object op)

Cache monster_stand_in_light_internal().

Definition at line 2760 of file monster.cpp.

References monster_stand_in_light_internal(), give::op, and pticks.

Referenced by adj_attackroll(), monster_can_detect_enemy(), monster_can_see_enemy(), monster_check_wakeup(), and test_stand_in_light().

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

◆ mood_change()

◆ move_disease()

int move_disease ( object disease)

Ticks the clock for disease: infect, aggravate symptoms, ...

Parameters
diseasedisease to move. Can be removed during processing.
Return values
1if disease was removed.
0disease just moved.

Definition at line 180 of file disease.cpp.

References check_infection(), do_symptoms(), object::env, FLAG_WIZ, living::food, grant_immunity(), is_susceptible_to_disease(), living::maxhp, object_free_drop_inventory(), object_remove(), QUERY_FLAG, remove_symptoms(), object::stats, and object::value.

Referenced by legacy_ob_process().

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

◆ move_firewall()

void move_firewall ( object op)

Move for FIREWALL.

firewalls fire other spells. The direction of the wall is stored in op->direction. walls can have hp, so they can be torn down.

Parameters
opfirewall.

Definition at line 343 of file main.cpp.

References cast_spell(), get_random_dir(), llevError, LOG(), guildjoin::ob, give::op, and nlohmann::detail::void().

Referenced by legacy_ob_process(), and trigger_connected().

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

◆ move_ob()

int move_ob ( object op,
int  dir,
object originator 
)

Op is trying to move in direction dir.

Parameters
opwhat is moving.
dirwhat direction op wants to move.
originatortypically the same as op, but can be different if originator is causing op to move (originator is pushing op).
Return values
0op is not able to move to the desired space.
1op was moved.

Definition at line 58 of file move.cpp.

References blocked_link(), esrv_map_scroll(), FLAG_ALIVE, FLAG_WIZPASS, FOR_INV_FINISH, FOR_INV_PREPARE, freearr_x, freearr_y, get_map_flags(), m, object::map, monster_check_doors(), monster_check_earthwalls(), object::more, MOVE_WALK, object_insert_in_map_at(), object_remove(), object_was_destroyed, give::op, P_OUT_OF_MAP, altar_valkyrie::pl, play_sound_map(), PLAYER, QUERY_FLAG, SOUND_TYPE_GROUND, TRANSPORT, WILL_APPLY_DOOR, WILL_APPLY_EARTHWALL, diamondslots::x, object::x, diamondslots::y, and object::y.

Referenced by cfapi_object_move(), eventListener(), flee_player(), move_object(), move_player_attack(), move_to(), pets_move(), pets_move_golem(), and recursive_roll().

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

◆ move_object()

int move_object ( object op,
int  dir 
)

Try to move op in the direction "dir".

Parameters
opwhat to move.
dirmoving direction.
Return values
0something blocks the passage.
1op was moved..

Definition at line 39 of file move.cpp.

References move_ob(), and give::op.

Referenced by check_spell_knockback(), monster_circ1_move(), monster_circ2_move(), monster_move(), monster_move_randomly(), monster_pace2_moveh(), monster_pace2_movev(), monster_pace_moveh(), monster_pace_movev(), monster_rand_move(), move_player_mover(), and push_ob().

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

◆ move_player()

int move_player ( object op,
int  dir 
)

Move player in the given direction. Can be called by a client through a movement command, or by the server for some other reasons.

Parameters
opplayer.
dirdirection to move/fire.
Returns
0.

Definition at line 2948 of file player.cpp.

References animate_object(), check_pick(), object::contr, do_hidden_move(), fire(), FLAG_CONFUSED, get_randomized_dir(), llevError, LOG(), MAP_IN_MEMORY, move_player_attack(), give::op, QUERY_FLAG, object::speed_left, and turn_transport().

Referenced by cfapi_object_move(), command_fire(), command_run(), handle_newcs_player(), monsterFight(), move_internal(), move_player_mover(), move_towards(), and pray_at_altar().

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

◆ move_player_attack()

void move_player_attack ( object op,
int  dir 
)

The player is also actually going to try and move (not fire weapons).

This function is just part of a breakup from move_player(). It should keep the code cleaner. When this is called, the players direction has been updated (taking into account confusion).

Parameters
opplayer moving.
dirmoving direction.

Definition at line 2623 of file player.cpp.

References action_makes_visible(), object::contr, DOOR, draw_ext_info(), object::enemy, FLAG_ALIVE, FLAG_CAN_ROLL, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_from_coord(), GET_MAP_OB, player::has_hit, HEAD, living::hp, LOCKED_DOOR, living::luck, m, make_visible(), object::map, mon, move_ob(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_NOATTACK, object_get_owner(), give::op, op_on_battleground(), out_of_map(), OUT_OF_REAL_MAP, player::party, play_sound_map(), PLAYER, player_attack_door(), player_map_change_common(), push_ob(), QUERY_FLAG, recursive_roll(), skill_attack(), SOUND_TYPE_LIVING, object::stats, Ice::tmp, object::type, nlohmann::detail::void(), object::x, and object::y.

Referenced by move_player().

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

◆ move_player_mover()

void move_player_mover ( object op)

This function takes a PLAYERMOVER as an argument, and performs the function of a player mover, which is:

a player mover finds any players that are sitting on it. It moves them in the op->stats.sp direction. speed is how often it'll move.

  • If attacktype is nonzero it will paralyze the player. If lifesave is set,
  • it'll dissapear after hp+1 moves. If hp is set and attacktype is set,
  • it'll paralyze the victim for hp*his speed/op->speed
Parameters
opmover.

Definition at line 707 of file time.cpp.

References FABS, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_random_dir(), HEAD, llevError, LOG(), m, move_object(), move_player(), object_free_drop_inventory(), object_remove(), object_update_speed(), give::op, P_OUT_OF_MAP, PLAYER, PLAYERMOVER, QUERY_FLAG, should_director_abort(), and reputation::victim.

Referenced by legacy_ob_process().

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

◆ move_symptom()

void move_symptom ( object symptom)

◆ move_to()

int move_to ( object op,
int  x,
int  y 
)

Move an object one square toward a specified destination on the same map. The move takes into account blocked squares for op, and things like that. No check is done to know if the object has enough speed to move.

Parameters
opobject to move
x
ydestination coordinates
Returns
0 if op is on the specified spot, 1 if it moved towards the goal, 2 if it didn't find any path to the goal.

Definition at line 563 of file move.cpp.

References animate_object(), give::direction, get_map_flags(), GET_MAP_OB, monster_compute_path(), move_ob(), give::op, P_OUT_OF_MAP, diamondslots::x, and diamondslots::y.

Referenced by cfapi_object_transfer().

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

◆ newhash()

char const* newhash ( char const *  password)

Definition at line 101 of file server.cpp.

References crypt_string().

Referenced by account_change_password(), account_new(), create_player_cmd(), and receive_player_password().

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

◆ object_teleport()

int object_teleport ( object op,
mapstruct map,
int  x,
int  y 
)

Move the specified object in a free spot around the map's x & y.

Parameters
opobject to move, may be REMOVED or not.
mapmap to move op to.
xcoordinate to move op to.
ycoordinate to move op to.
Returns
1 if op was moved, 0 else.

Definition at line 597 of file move.cpp.

References FLAG_REMOVED, disinfect::map, map_newmap_cmd(), object_find_first_free_spot(), object_insert_in_map_at(), object_remove(), give::op, out_of_map(), PLAYER, player_update_bg_music(), QUERY_FLAG, diamondslots::x, and diamondslots::y.

Referenced by add_npc_to_point(), add_npc_to_zone(), and cfapi_object_teleport().

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

◆ ok_to_put_more()

int ok_to_put_more ( mapstruct m,
int16_t  x,
int16_t  y,
object op,
uint32_t  immune_stop 
)

Returns true if it is ok to put spell op on the space/may provided.

Parameters
m
x
ycoordinates to test.
opspell to test for.
immune_stopbasically the attacktype of the spell (why passed as a different value, not sure of). If immune_stop has the AT_MAGIC bit set, and there is a counterwall on the space, the object doesn't get placed. if immune_stop does not have AT_MAGIC, then counterwalls do not effect the spell.
Returns
1 if we can add op, 0 else.

Definition at line 530 of file spell_util.cpp.

References ARROW, AT_COUNTERSPELL, AT_MAGIC, BOW, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, GOLEM, m, OB_SPELL_TAG_MATCH, OB_TYPE_MOVE_BLOCK, give::op, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, Statistics::spell_suppressions, SPELL_TAG_SIZE, statistics, Ice::tmp, WEAPON, diamondslots::x, and diamondslots::y.

Referenced by explosion(), and move_cone().

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

◆ op_on_battleground()

int op_on_battleground ( object op,
int *  x,
int *  y,
archetype **  trophy 
)

Check if the given object (usually a player) is standing on a battleground tile. This is used to handle deaths and special attacks in arenas.

A battleground tile must have the following attributes set:

  • name "battleground"
  • type 58 (BATTLEGROUND)
  • is_floor 1 (must be the first tile beneath the player's feet)
  • no_pick 1
  • sp / hp > 0 (non-zero exit coordinates)

If the tile has 'slaying', 'maxhp', and 'maxsp' set, and the player has a matching marker, send the player to those coordinates instead.

If the tile has 'other_arch' set, then create that archetype as the trophy instead of the default ("finger").

Parameters
opObject to check (usually a player).
[out]x
[out]yIf not NULL and standing on a battleground tile, store exit coordinates.
[out]trophyIf not NULL and standing on a battleground tile, store a pointer to the archetype that can be collected by the winner.
Returns
TRUE if op is on a battleground, FALSE if not.

Definition at line 4241 of file player.cpp.

References BATTLEGROUND, EXIT_ALT_X, EXIT_ALT_Y, EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FLAG_IS_FLOOR, FLAG_NO_PICK, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, FORCE, object_find_by_type_and_slaying(), give::op, QUERY_FLAG, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by hit_player(), hit_with_drain(), hit_with_one_attacktype(), infect_object(), kill_object(), kill_player(), move_player_attack(), pets_should_arena_attack(), and spell_find_dir().

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

◆ paralyze_living()

void paralyze_living ( object op,
int  dam 
)

Paralyze a living thing.

Parameters
opvictim.
damdamage to deal.

Definition at line 2398 of file attack.cpp.

References ATNR_PARALYZE, draw_ext_info(), FABS, FLAG_PARALYZED, say::max, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_UNIQUE, give::op, PLAYER, QUERY_FLAG, and SET_FLAG.

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

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

◆ party_confirm_password()

int party_confirm_password ( const partylist party,
const char *  password 
)

Checks whether a given password matches the party's password.

Parameters
partythe party to check
passwordthe password to check for
Returns
whether the password matches

Definition at line 259 of file party.cpp.

References partylist::passwd.

Referenced by check_login(), and confirm_party_password().

+ Here is the caller graph for this function:

◆ party_find()

partylist* party_find ( const char *  partyname)

Find a party by name.

Parameters
partynamethe party's name to find
Returns
the party or NULL if no such party exists

Definition at line 148 of file party.cpp.

References firstparty, partylist::next, and partylist::partyname.

Referenced by check_login(), command_party(), confirm_party_password(), and party_form().

+ Here is the caller graph for this function:

◆ party_form()

partylist* party_form ( object op,
const char *  partyname 
)

Forms the party struct for a party called 'partyname'. it is the responsibility of the caller to ensure that the name is unique. New item is placed on the party list.

Parameters
opparty creator.
partynamethe party name.
Returns
new party or NULL if the name is not unique.

Definition at line 40 of file party.cpp.

References buf, draw_ext_info_format(), firstparty, lastparty, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, partylist::next, give::op, party_find(), party_leave(), partylist::partyleader, partylist::partyname, partylist::passwd, replace_unprintable_chars(), strdup_local, and strlcpy().

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:

◆ party_get_first()

partylist* party_get_first ( void  )

Returns the first party from the list of all parties.

Returns
the first party or NULL if no party exists

Definition at line 196 of file party.cpp.

References firstparty.

Referenced by cfapi_party_get_property(), cfapi_system_get_party_vector(), command_party(), and START_TEST().

+ Here is the caller graph for this function:

◆ party_get_leader()

const char* party_get_leader ( const partylist party)

Returns the name of the party's leader.

Parameters
partythe party to query
Returns
the leader's name

Definition at line 292 of file party.cpp.

References partylist::partyleader.

Referenced by command_party(), and START_TEST().

+ Here is the caller graph for this function:

◆ party_get_next()

partylist* party_get_next ( const partylist party)

Returns the next party from the list of all parties.

Parameters
partythe party to use
Returns
the next party or NULL if party is the last one in list

Definition at line 208 of file party.cpp.

References partylist::next.

Referenced by cfapi_party_get_property(), cfapi_system_get_party_vector(), command_party(), and START_TEST().

+ Here is the caller graph for this function:

◆ party_get_password()

const char* party_get_password ( const partylist party)

Returns the party's password.

Parameters
partythe party to query
Returns
the password or an empty string if the party has no password

Definition at line 232 of file party.cpp.

References partylist::passwd.

Referenced by cfapi_party_get_property(), command_party(), get_party_password(), and save_player().

+ Here is the caller graph for this function:

◆ party_join()

void party_join ( object op,
partylist party 
)

Makes a player join a party. Leaves the former party if necessary. Does nothing if the player already is a member of the party.

Parameters
opthe player
partythe party to join

Definition at line 85 of file party.cpp.

References buf, draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, give::op, party_leave(), party_send_message(), and partylist::partyname.

Referenced by cfapi_object_set_property(), check_login(), command_party(), and receive_party_password().

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

◆ party_leave()

void party_leave ( object op)

Makes a player leave his party. Does nothing if the player is not member of a party.

Parameters
opthe player

Definition at line 123 of file party.cpp.

References buf, draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, give::op, party_send_message(), partylist::partyname, and remove_if_unused().

Referenced by apply_savebed(), command_party(), key_confirm_quit(), kill_player_permadeath(), leave(), party_form(), and party_join().

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

◆ party_obsolete_parties()

void party_obsolete_parties ( void  )

Remove unused parties (no players).

Definition at line 215 of file party.cpp.

References firstparty, partylist::next, give::next, and remove_if_unused().

Referenced by do_specials(), and START_TEST().

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

◆ party_remove()

void party_remove ( partylist party)

Removes and frees a party. Removes all members from the party.

Parameters
partythe party to remove

Definition at line 164 of file party.cpp.

References first_player, firstparty, lastparty, llevError, LOG(), partylist::next, partylist::partyleader, partylist::partyname, and altar_valkyrie::pl.

Referenced by remove_if_unused(), and START_TEST().

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

◆ party_send_message()

void party_send_message ( object op,
const char *  message 
)

Send a message to all party members except the speaker.

Parameters
opplayer talking.
messagemessage to send.
Todo:
should be moved to player.c?

Definition at line 274 of file party.cpp.

References draw_ext_info(), first_player, diamondslots::message, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_WHITE, give::op, and altar_valkyrie::pl.

Referenced by command_party(), party_join(), and party_leave().

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

◆ party_set_password()

void party_set_password ( partylist party,
const char *  password 
)

Sets a party's password.

Parameters
partythe party to change
passwordthe new password to set

Definition at line 244 of file party.cpp.

References partylist::passwd, replace_unprintable_chars(), and strlcpy().

Referenced by check_login(), and command_party().

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

◆ path_to_player()

int path_to_player ( object mon,
object pl,
unsigned  mindiff 
)

Returns the direction to the player, if valid. Returns 0 otherwise.

Modified to verify there is a path to the player. Does this by stepping towards player and if path is blocked then see if blockage is close enough to player that direction to player is changed (ie zig or zag). Continue zig zag until either reach player or path is blocked. Thus, will only return true if there is a free path to player. Though path may not be a straight line. Note that it will find player hiding along a corridor at right angles to the corridor with the monster.

Modified by MSW 2001-08-06 to handle tiled maps. Various notes:

  • With DETOUR_AMOUNT being 2, it should still go and find players hiding down corridors.
  • I think the old code was broken if the first direction the monster should move was blocked - the code would store the first direction without verifying that the player can actually move in that direction. The new code does not store anything in firstdir until we have verified that the monster can in fact move one space in that direction.
  • I'm not sure how good this code will be for moving multipart monsters, since only simple checks to blocked are being called, which could mean the monster is blocking itself.
Parameters
monsource object.
pltarget.
mindiffminimal distance mon and pl should have.
Returns
direction from mon to pl, 0 if can't get there.

Definition at line 651 of file player.cpp.

References absdir(), blocked_link(), DETOUR_AMOUNT, rv_vector::direction, rv_vector::distance, rv_vector::distance_x, rv_vector::distance_y, FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_rangevector(), get_rangevector_from_mapcoord(), m, object::map, MAX, say::max, MAX_SPACES, mon, MOVE_ALL, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, altar_valkyrie::pl, diamondslots::x, object::x, diamondslots::y, and object::y.

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

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

◆ perceive_self()

◆ pets_attempt_follow()

void pets_attempt_follow ( object for_owner,
int  force 
)

Check pets so they try to follow their master around the world.

Parameters
for_ownerif NULL, check all pets, else only pets for this owner.
forceif non zero, then forcibly move the pet close to its owner. If zero then only check pets if they are not on the same map, as computed by on_same_map(), as their owner.

Definition at line 249 of file pets.cpp.

References FABS, FLAG_FRIENDLY, FLAG_REMOVED, dragon_attune::force, free_objectlink(), get_friends_of(), guildoracle::list, llevMonster, LOG(), MIN_ACTIVE_SPEED, object_free_drop_inventory(), object_get_owner(), on_same_map(), pets_follow_owner(), PLAYER, QUERY_FLAG, and remove_friendly_object().

Referenced by enter_map(), swap_map(), teleport(), and transfer_ob().

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

◆ pets_control_golem()

void pets_control_golem ( object op,
int  dir 
)

Makes the golem go in specified direction. This is a really stupid function when you get down and look at it. Keep it here for the time being - makes life easier if we ever decide to do more interesting thing with controlled golems.

Parameters
opgolem.
dirdesired direction.
Todo:
trash.

Definition at line 630 of file pets.cpp.

References give::op.

Referenced by animate_weapon(), and fire().

+ Here is the caller graph for this function:

◆ pets_follow_owner()

void pets_follow_owner ( object ob,
object owner 
)

A pet is trying to follow its owner.

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

Definition at line 284 of file pets.cpp.

References draw_ext_info(), FLAG_REMOVED, freearr_x, freearr_y, mapstruct::in_memory, llevError, llevMonster, LOG(), object::map, MAP_IN_MEMORY, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, NDI_UNIQUE, guildjoin::ob, object_find_free_spot(), object_insert_in_map_at(), object_remove(), PLAYER, QUERY_FLAG, SIZEOFFREE, object::type, object::x, and object::y.

Referenced by monster_move(), pets_attempt_follow(), and pets_move().

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

◆ pets_get_enemy()

object* pets_get_enemy ( object pet,
rv_vector rv 
)

Given that 'pet' is a friendly object, this function returns a monster the pet should attack, NULL if nothing appropriate is found. it basically looks for nasty things around the owner of the pet to attack. This is now tilemap aware.

Parameters
petwho is seeking an enemy.
[out]rvwill contain the path to the enemy.
Returns
enemy, or NULL if nothing suitable.

Definition at line 54 of file pets.cpp.

References object::attack_movement, object::attacked_by, object::attacked_by_count, CLEAR_FLAG, object::contr, object::count, FLAG_ALIVE, FLAG_CONFUSED, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_rangevector(), get_search_arr(), HEAD, object::map, monster_can_detect_enemy(), monster_can_see_enemy(), monster_check_enemy(), monster_find_nearest_enemy(), object_get_owner(), object_set_enemy(), on_same_map(), P_IS_ALIVE, P_OUT_OF_MAP, pet_defend, pet_sad, player::petmode, PETMOVE, pets_should_arena_attack(), PLAYER, QUERY_FLAG, remove_friendly_object(), SIZEOFFREE, Ice::tmp, object::type, diamondslots::x, object::x, diamondslots::y, and object::y.

Referenced by monster_find_enemy().

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

◆ pets_move()

◆ pets_move_golem()

void pets_move_golem ( object op)

◆ pets_should_arena_attack()

int pets_should_arena_attack ( object pet,
object owner,
object target 
)

Determines if checks so pets don't attack players or other pets should be overruled by the arena petmode.

Parameters
petpet considered.
ownerpet's owner.
targetpotential pet target.
Return values
0pet shouldn't attack target.
1target is a suitable victim for the pet.

Definition at line 1086 of file pets.cpp.

References object::contr, get_real_owner(), llevError, LOG(), op_on_battleground(), player::party, pet_arena, player::petmode, PLAYER, and object::type.

Referenced by monster_check_enemy(), and pets_get_enemy().

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

◆ pets_summon_golem()

int pets_summon_golem ( object op,
object caster,
int  dir,
object spob 
)

Summons a monster.

Parameters
opwho is summoning.
casterobject casting the spell.
dirdirection to place the monster.
spobspell object casting. At this stage, all spob is really used for is to adjust some values in the monster.
Return values
0failed to summon something.
1summoned correctly something.

Definition at line 651 of file pets.cpp.

References add_friendly_object(), add_string(), AT_PHYSICAL, object::attacktype, buf, caster_level(), archetype::clone, living::dam, determine_god(), determine_holy_arch(), draw_ext_info(), draw_ext_info_format(), object::duration, FABS, find_god(), fix_summon_pet(), FLAG_FRIENDLY, FLAG_MONSTER, FREE_AND_CLEAR_STR, free_string(), freearr_x, freearr_y, GOLEM, llevError, LOG(), MAX, MAX_BUF, living::maxgrace, MIN, object::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_PET, object::name, NDI_UNIQUE, ob_blocked(), object_find_free_spot(), object_free_drop_inventory(), object_get_owner(), object_insert_in_map_at(), object_remove(), object_set_owner(), give::op, object::other_arch, PETMOVE, PLAYER, QUERY_FLAG, object::race, range_golem, object::resist, SET_FLAG, set_spell_skill(), SIZEOFFREE1, object::slaying, living::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SP_level_wc_adjust(), object::stats, and Ice::tmp.

Referenced by cast_spell().

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

◆ pets_summon_object()

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

◆ pets_terminate_all()

void pets_terminate_all ( object owner)

Removes all pets someone owns.

Parameters
ownerplayer we wish to remove all pets of.

Definition at line 225 of file pets.cpp.

References FLAG_REMOVED, free_objectlink(), get_friends_of(), objectlink::next, guildjoin::ob, object_free_drop_inventory(), object_remove(), QUERY_FLAG, and remove_friendly_object().

Referenced by apply_savebed(), command_kill_pets(), key_confirm_quit(), leave(), and save_player().

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

◆ pick_lock()

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

Lock pick handling.

Implementation by bt. (thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du) monster implementation 7-7-95 by bt.

Parameters
plplayer picking the lock.
dirdirection to pick.
skilllock picking skill.
Returns
experience for picking a lock, 0 if nothing was picked.

Definition at line 391 of file skills.cpp.

References attempt_pick_lock(), calc_skill_exp(), DOOR, draw_ext_info(), EVENT_TRIGGER, events_execute_object_event(), freearr_x, freearr_y, GET_MAP_OB, isqrt(), LOCKED_DOOR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, OUT_OF_REAL_MAP, altar_valkyrie::pl, SCRIPT_FIX_ALL, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pick_up()

void pick_up ( object op,
object alt 
)

Try to pick up an item.

Parameters
opobject trying to pick up.
altoptional object op is trying to pick. If NULL, try to pick first item under op.

Definition at line 519 of file c_object.cpp.

References CONTAINER, disinfect::count, draw_ext_info(), draw_ext_info_format(), FLAG_APPLIED, FLAG_STARTEQUIP, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, INS_NO_MERGE, llevDebug, LOG(), MIMIC, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, object_can_pick(), object_insert_in_map(), give::op, pick_up_object(), PLAYER, QUERY_FLAG, object::race, sack_can_hold(), stop_item(), Ice::tmp, and object::type.

Referenced by attempt_steal(), cast_create_missile(), cfapi_object_pickup(), check_pick(), command_take(), and esrv_move_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ play_again()

void play_again ( object op)

Ask the player whether to play again or disconnect.

Parameters
opplayer.

Definition at line 903 of file player.cpp.

References CS_QUERY_SINGLECHAR, FLAG_REMOVED, i18n(), Ns_Add, object_remove(), give::op, player_set_state(), QUERY_FLAG, receive_play_again(), send_query(), Send_With_Handling(), SockList_AddChar(), SockList_AddInt(), SockList_AddString(), SockList_Init(), SockList_Term(), and ST_PLAY_AGAIN.

Referenced by apply_savebed(), key_change_class(), key_confirm_quit(), key_roll_stat(), kill_player_permadeath(), and receive_play_again().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_arrest()

int player_arrest ( object who)

Put a player into jail, taking into account cursed exits and player's region.

Parameters
whoplayer to put in jail
Return values
0player was moved to jail.
-1no jail found.
-2couldn't move to jail (map loading error, or already at jail's position).
-3op isn't a player.

Definition at line 789 of file c_wiz.cpp.

References enter_exit(), FREE_OBJ_NO_DESTROY_CALLBACK, get_jail_exit(), object_free(), PLAYER, autojail::who, diamondslots::x, and diamondslots::y.

Referenced by attack_ob_simple(), cfapi_object_move(), and command_arrest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_can_find()

bool player_can_find ( object op,
object ob 
)

Return true if player 'op' can see object 'op' for purpose of locating items for partial item matching or searching by tag.

Definition at line 590 of file item.cpp.

References FLAG_WIZ, guildjoin::ob, give::op, and QUERY_FLAG.

Referenced by find_best_apply_object_match(), and ob_if_can_find().

+ Here is the caller graph for this function:

◆ player_can_view()

int player_can_view ( object pl,
object op 
)

Check the player los field for viewability of the object op. This function works fine for monsters, but we dont worry if the object isnt the top one in a pile (say a coin under a table would return "viewable" by this routine). Another question, should we be concerned with the direction the player is looking in? Realistically, most of use cant see stuff behind our backs...on the other hand, does the "facing" direction imply the way your head, or body is facing? Its possible for them to differ. Sigh, this fctn could get a bit more complex. -b.t.

This function is now map tiling safe.

Parameters
plplayer that may see op.
opwhat may be seen by pl.
Return values
-1pl isn't a player
0pl can't see op.
1pl can see op.

Definition at line 4142 of file player.cpp.

References rv_vector::distance_x, rv_vector::distance_y, FABS, get_rangevector(), HEAD, llevError, LOG(), give::op, altar_valkyrie::pl, PLAYER, and guild_entry::x1.

Referenced by adj_attackroll(), monster_can_detect_enemy(), and monster_can_see_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_get_delayed_buffer()

SockList* player_get_delayed_buffer ( player pl)

Get a delayed socket buffer, that will be sent after the player's tick is complete. Will fatal() if memory error.

Parameters
plplayer to get a buffer for.
Returns
buffer, never NULL.

Definition at line 4480 of file player.cpp.

References fatal(), llevError, LOG(), OUT_OF_MEMORY, altar_valkyrie::pl, and SockList_Init().

Referenced by draw_ext_info(), and quest_set_state().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_set_state()

void player_set_state ( player pl,
uint8_t  state 
)

Set the player's state to the specified one.

Parameters
plwho to set state for.
statenew state.

Definition at line 4467 of file player.cpp.

References altar_valkyrie::pl, ST_CHANGE_PASSWORD_CONFIRM, and quest::state.

Referenced by add_player(), check_login(), command_delete(), command_passwd(), confirm_password(), create_player_cmd(), get_name(), get_party_password(), get_password(), get_player(), key_change_class(), key_confirm_quit(), key_roll_stat(), play_again(), receive_party_password(), receive_play_again(), and receive_player_password().

+ Here is the caller graph for this function:

◆ player_unready_range_ob()

void player_unready_range_ob ( player pl,
object ob 
)

Unready an object for a player. This function does nothing if the object was not readied.

Parameters
plplayer.
obobject to unready.

Definition at line 4449 of file player.cpp.

References guildjoin::ob, altar_valkyrie::pl, range_none, and range_size.

Referenced by become_follower(), do_forget_spell(), and remove_special_prayers().

+ Here is the caller graph for this function:

◆ playername_ok()

int playername_ok ( const char *  cp)

Is the player name valid.

Parameters
cpname to test.
Returns
0 if invalid, 1 if valid.

Definition at line 257 of file player.cpp.

Referenced by check_name(), and create_player_cmd().

+ Here is the caller graph for this function:

◆ players_on_map()

int players_on_map ( mapstruct m,
int  show_all 
)

Returns the count of players on a map, calculated from player list.

Parameters
mmap we want the count of players on.
show_allif true, show everyone. If not, don't show hidden players (dms)
Returns
player count.
Todo:
this doesn't take into account transports. Should be removed when mapstruct::players is valid.

Definition at line 234 of file swap.cpp.

References first_player, FLAG_REMOVED, m, altar_valkyrie::pl, and QUERY_FLAG.

Referenced by flush_old_maps().

+ Here is the caller graph for this function:

◆ plugins_display_list()

void plugins_display_list ( object op)

Displays a list of loaded plugins (keystrings and description) in the game log window.

Parameters
opwho to display the list to.

Definition at line 479 of file plugins.cpp.

References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, give::op, and plugins_list.

Referenced by command_listplugins().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plugins_init_plugin()

int plugins_init_plugin ( const char *  libfile)

Try to load the specified plugin. Update plugins_list if successful. Log errors at llevError.

Parameters
libfilefull path to the plugin.
Returns
-1 if an error occurred, 0 if the plugin was loaded.

Definition at line 373 of file plugins.cpp.

References cfapi_get_hooks(), crossfire_plugin::closefunc, events_register_object_handler(), crossfire_plugin::fullname, crossfire_plugin::global_registration, crossfire_plugin::id, Settings::ignore_plugin_compatibility, crossfire_plugin::libptr, LIBPTRTYPE, llevError, LOG(), NR_EVENTS, plugins_dlclose, plugins_dlerror, plugins_dlopen, plugins_dlsym, plugins_list, crossfire_plugin::propfunc, settings, and SVN_REV.

Referenced by command_loadplugin(), and initPlugins().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plugins_remove_plugin()

int plugins_remove_plugin ( const char *  id)

Unload the specified plugin. No logging is done in case of error. Updates plugins_list.

Parameters
idplugin internal identifier.
Returns
0 if the plugin was unloaded, -1 if no such plugin.

Definition at line 454 of file plugins.cpp.

References crossfire_plugin::closefunc, events_unregister_global_handler(), events_unregister_object_handler(), crossfire_plugin::global_registration, crossfire_plugin::id, crossfire_plugin::libptr, NR_EVENTS, plugins_dlclose, and plugins_list.

Referenced by command_unloadplugin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ polymorph()

void polymorph ( object op,
object who,
int  level 
)

Handles polymorphing an object, living or not. Will avoid some specific items (flying arrows and such).

Parameters
opobject being polymorphed.
whospell caster.
levelspell level.

Definition at line 371 of file spell_effect.cpp.

References FABS, FLAG_ALIVE, FLAG_ANIMATE, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_PICK, give::op, PLAYER, polymorph_item(), polymorph_living(), polymorph_melt(), QUERY_FLAG, rndm(), Ice::tmp, TREASURE, and autojail::who.

Referenced by cast_polymorph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pray()

int pray ( object pl,
object skill 
)

Praying skill handling.

When this skill is called from do_skill(), it allows the player to regain lost grace points at a faster rate. -b.t.

This always returns 0 - return value is used by calling function such that if it returns true, player gets exp in that skill. This the effect here can be done on demand, we probably don't want to give infinite exp by returning true in any cases.

Parameters
plobject praying, should be a player.
skillpraying skill.
Returns
0.

Definition at line 1384 of file skills.cpp.

References buf, draw_ext_info(), FOR_BELOW_FINISH, FOR_BELOW_PREPARE, HOLY_ALTAR, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, altar_valkyrie::pl, PLAYER, pray_at_altar(), and Ice::tmp.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pray_at_altar()

void pray_at_altar ( object pl,
object altar,
object skill 
)

Player prays at altar. Checks for god changing, divine intervention, and so on.

Parameters
plplayer praying.
altaraltar player's praying on. Doesn't need to be consecrated.
skillpraying skill.

Definition at line 258 of file gods.cpp.

References absdir(), altar_valkyrie::altar, become_follower(), cast_magic_storm(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), EVENT_APPLY, events_execute_object_event(), find_god(), god_intervention(), object::level, LOOSE_MANA, MAX, move_player(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, object::name, archetype::name, NDI_NAVY, NDI_UNIQUE, object::other_arch, altar_valkyrie::pl, PREFER_LOW, random_roll(), SCRIPT_FIX_ALL, Ice::tmp, and try_leave_cult().

Referenced by pray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ probe()

int probe ( object op,
object caster,
object spell_ob,
int  dir,
int  level 
)

Try to get information about a living thing.

Parameters
opwho is casting.
casterwhat is casting.
spell_obspell object being cast.
dircast direction.
levelprobe level.
Return values
0nothing probed.
1something was probed.

Definition at line 699 of file spell_effect.cpp.

References CAN_PROBE(), draw_ext_info(), examine_monster(), FLAG_WIZCAST, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, give::op, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, QUERY_FLAG, ring_occidental_mages::r, object::range, SP_level_range_adjust(), Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by cast_spell(), check_probe(), and examine_monster().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_events()

◆ process_object()

◆ push_ob()

int push_ob ( object who,
int  dir,
object pusher 
)

Something is pushing some other object.

Parameters
whoobject being pushed.
dirpushing direction.
pusherwhat is pushing who.
Return values
1if pushing invokes a attack
0no attack during pushing.
Todo:
fix return value which is weird for last case.

Definition at line 434 of file move.cpp.

References CLEAR_FLAG, object::contr, draw_ext_info_format(), esrv_map_scroll(), FLAG_FRIENDLY, FLAG_NEUTRAL, FLAG_SLEEP, FLAG_STAND_STILL, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, HEAD, object::level, socket_struct::look_position, m, object::map, monster_npc_call_help(), move_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_PUSHED, object::name, NDI_UNIQUE, object_get_owner(), object_insert_in_map_at(), object_remove(), object_set_enemy(), player::party, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), player::run_on, player::socket, object::stats, living::Str, guildbuy::temp, object::type, socket_struct::update_look, autojail::who, object::x, and object::y.

Referenced by move_player_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ put_object_in_sack()

void put_object_in_sack ( object op,
object sack,
object tmp,
uint32_t  nrof 
)

Something tries to put an object into another.

This function was part of drop(), now is own function.

Note
the 'sack' in question can now be a transport, so this function isn't named very good anymore.
Parameters
opwho is moving the item.
sackwhere to put the object.
tmpwhat to put into sack.
nrofif non zero, then nrof objects is tried to put into sack, else everything is put.

Definition at line 937 of file c_object.cpp.

References AP_NO_MERGE, AP_UNAPPLY, apply_special(), CLEAR_FLAG, CONTAINER, draw_ext_info(), draw_ext_info_format(), object::env, esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_STARTEQUIP, FOR_INV_FINISH, FOR_INV_PREPARE, object::map, MAX_BUF, object::move_off, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, object::nrof, object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_split(), give::op, PLAYER, QUERY_FLAG, query_name(), sack_can_hold(), set_object_face_main(), Ice::tmp, TRANSPORT, transport_can_hold(), object::type, UPD_WEIGHT, object::x, and object::y.

Referenced by drop(), esrv_move_object(), knowledge_alchemy_attempt(), and START_TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_first_player_save()

void quest_first_player_save ( player pl)

Ensure the quest state is correctly saved for a player. This function should only be called once, when the player's save directory is created. All other quest functions save the state automatically, but save can only happen when the player directory exists.

Parameters
plwho to save quests for.

Definition at line 967 of file quest.cpp.

References get_quest(), altar_valkyrie::pl, quest_write_player_data(), and quest_player::quests.

Referenced by save_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_get_player_state()

int quest_get_player_state ( player pl,
sstring  quest_code 
)

Get the quest state for a player.

Parameters
plplayer.
quest_codeinternal quest code.
Returns
QC_COMPLETED if finished and quest can't be replayed, 0 if not started or finished and can be replayed, else quest-specific value.

Definition at line 660 of file quest.cpp.

References get_or_create_quest(), get_state(), altar_valkyrie::pl, item::q, QC_CAN_RESTART, quest_find_by_code(), and quest_state::state.

Referenced by cfapi_player_quest(), do_update(), and evaluate_quest_conditions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_load_definitions()

void quest_load_definitions ( void  )

◆ quest_send_initial_states()

void quest_send_initial_states ( player pl)

Send the current quest states for the specified player, if the client supports those notifications.

Parameters
plwho to send quests for.

Definition at line 909 of file quest.cpp.

References esrv_send_face(), get_or_create_quest(), quest_step_definition::is_completion_step, NS_FACESENT_FACE, altar_valkyrie::pl, quest_get_by_code(), quest_get_step(), quest_player::quests, Send_With_Handling(), SockList_AddChar(), SockList_AddInt(), SockList_AddLen16Data(), SockList_AddShort(), SockList_AddString(), SockList_Avail(), SockList_Init(), SockList_Reset(), SockList_Term(), quest::state, and quest_step_definition::step_description.

Referenced by check_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_set_player_state()

void quest_set_player_state ( player pl,
sstring  quest_code,
int  state 
)

Set the state of a quest for a player.

Parameters
plplayer to set the state for.
quest_codequest internal code.
statenew state for the quest, must be greater than 0 else forced to 100 and a warning is emitted.

Definition at line 716 of file quest.cpp.

References altar_valkyrie::pl, quest_set_state(), and quest::state.

Referenced by cfapi_player_quest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_start()

void quest_start ( player pl,
sstring  quest_code,
int  state 
)

Start a quest for a player. Will notify the player.

Parameters
plplayer.
quest_codeinternal quest code.
stateinitial quest state, must be greater than 0 else forced to 100 and warning emitted.

Definition at line 680 of file quest.cpp.

References draw_ext_info_format(), get_or_create_quest(), get_or_create_state(), llevDebug, llevError, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_QUESTS, NDI_DELAYED, NDI_UNIQUE, altar_valkyrie::pl, item::q, quest_find_by_code(), quest_set_state(), and quest::state.

Referenced by cfapi_player_quest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_was_completed()

int quest_was_completed ( player pl,
sstring  quest_code 
)

Check if a quest was completed once for a player, without taking account the current state.

Parameters
plwho to check for.
quest_codequest internal code.
Returns
1 if the quest was already completed at least once, 0 else.

Definition at line 726 of file quest.cpp.

References get_or_create_quest(), get_state(), altar_valkyrie::pl, and quest::state.

Referenced by cfapi_player_quest(), and evaluate_quest_conditions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ races_get_random_monster()

object* races_get_random_monster ( const char *  race,
int  level 
)

Get a random monster of specified race and level at most the specified one.

Parameters
racerace, must not be NULL. If invalid, then logs as an error.
levelmaximum number, included.
Returns
random monster, NULL if none available for the level.

Definition at line 24 of file races.cpp.

References llevError, LOG(), ring_occidental_mages::r, races, and rndm().

Referenced by choose_cult_monster().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_map_log()

void read_map_log ( void  )

Reads temporary maps information from disk.

Will LOG() in case of error.

Definition at line 71 of file swap.cpp.

References buf, get_linked_map(), llevDebug, Settings::localdir, LOG(), disinfect::map, MAP_MAXRESET, MAP_SWAPPED, MAX_BUF, safe_strncpy, seconds(), settings, split_string(), strdup_local, and Ice::tmp.

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive_party_password()

void receive_party_password ( object op,
const char *  password 
)

Player entered a party password.

Parameters
opplayer.
passwordparty password.

Definition at line 53 of file c_party.cpp.

References confirm_party_password(), draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, party_join(), player_set_state(), and ST_PLAYING.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive_play_again()

void receive_play_again ( object op,
char  key 
)

Player replied to play again / disconnect.

Parameters
opplayer.
keyreceived choice.

Definition at line 956 of file player.cpp.

References add_friendly_object(), add_refcount(), add_string(), draw_ext_info(), FREE_AND_CLEAR_STR, get_name(), get_player(), castle_read::key, leave(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, give::name, NDI_UNIQUE, object_free_drop_inventory(), give::op, altar_valkyrie::pl, play_again(), player_set_state(), remove_friendly_object(), send_account_players(), set_first_map(), and ST_GET_NAME.

Referenced by play_again(), and reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive_player_name()

void receive_player_name ( object op,
const char *  name 
)

A player just entered her name.

Perhaps these should be in player.c, but that file is already a bit big.

Parameters
opplayer we're getting the name of.
namename the player entered.

Definition at line 1935 of file c_misc.cpp.

References check_name(), draw_ext_info(), FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, give::name, NDI_UNIQUE, and give::op.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive_player_password()

void receive_player_password ( object op,
const char *  password 
)

A player just entered her password, including for changing it.

Parameters
opplayer.
passwordpassword used.

Definition at line 1955 of file c_misc.cpp.

References check_login(), check_password(), checkbanned(), CS_QUERY_HIDEINPUT, display_motd(), draw_ext_info(), get_name(), i18n(), llevInfo, LOG(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_RED, NDI_UNIQUE, newhash(), give::op, player_set_state(), roll_again(), safe_strncpy, send_query(), ST_CHANGE_PASSWORD_CONFIRM, ST_CHANGE_PASSWORD_NEW, ST_CHANGE_PASSWORD_OLD, ST_CONFIRM_PASSWORD, ST_PLAYING, and ST_ROLL_STAT.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recharge()

int recharge ( object op,
object caster,
object spell_ob 
)

Recharge wands.

Parameters
opwho is casting.
casterwhat is casting.
spell_obspell object.
Return values
0nothing happened.
1wand was recharged, or destroyed.

Definition at line 84 of file spell_effect.cpp.

References object::arch, archetype::clone, create_archetype(), living::dam, draw_ext_info(), draw_ext_info_format(), find_marked_object(), FLAG_ANIMATE, living::food, object::inv, object::level, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, give::name, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_remove(), object_update_speed(), give::op, play_sound_map(), PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, SOUND_TYPE_ITEM, SP_level_dam_adjust(), object::speed, object::stats, Ice::tmp, object::type, and WAND.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recursive_roll()

void recursive_roll ( object op,
int  dir,
object pusher 
)

An object is pushed by another which is trying to take its place.

Parameters
opwhat is being pushed.
dirpushing direction.
pusherwhat is pushing op.

Definition at line 293 of file move.cpp.

References draw_ext_info_format(), MAX_BUF, move_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, give::name, NDI_BLACK, NDI_UNIQUE, give::op, query_name(), roll_ob(), and nlohmann::detail::void().

Referenced by move_player_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reflwall()

int reflwall ( mapstruct m,
int  x,
int  y,
object sp_op 
)

Decides weither the (spell-)object sp_op will be reflected from the given mapsquare. Returns 1 if true.

(Note that for living creatures there is a small chance that reflect_spell fails.)

Caller should be sure it passes us valid map coordinates eg, updated for tiled maps.

Parameters
m
x
yposition of the object to test.
sp_opspell object to test.
Returns
1 if reflected, 0 else.

Definition at line 470 of file spell_util.cpp.

References FLAG_ALIVE, FLAG_REFL_SPELL, FOR_MAP_FINISH, FOR_MAP_PREPARE, object::level, m, give::op, OUT_OF_REAL_MAP, QUERY_FLAG, rndm(), diamondslots::x, and diamondslots::y.

Referenced by move_bolt(), and move_bullet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ regenerate_rod()

void regenerate_rod ( object rod)

Regenerates a rod's charges.

Parameters
rodrod to regenerate.

Definition at line 761 of file spell_util.cpp.

References living::hp, living::maxhp, and object::stats.

Referenced by legacy_ob_process().

+ Here is the caller graph for this function:

◆ register_all_ob_types()

void register_all_ob_types ( void  )

Calls the intialization functions for all individual types.

Todo:
this should probably be moved to a file in the types/ directory, to separate types and server.

Definition at line 31 of file ob_types.cpp.

References init_type_altar(), init_type_armour_improver(), init_type_arrow(), init_type_blindness(), init_type_book(), init_type_button(), init_type_cf_handle(), init_type_check_inv(), init_type_clock(), init_type_container(), init_type_converter(), init_type_creator(), init_type_deep_swamp(), init_type_detector(), init_type_director(), init_type_dragon_focus(), init_type_duplicator(), init_type_exit(), init_type_food(), init_type_gate(), init_type_hole(), init_type_identify_altar(), init_type_lamp(), init_type_lightable(), init_type_lighter(), init_type_marker(), init_type_mimic(), init_type_mood_floor(), init_type_peacemaker(), init_type_pedestal(), init_type_player_changer(), init_type_player_mover(), init_type_poison(), init_type_poisoning(), init_type_potion(), init_type_power_crystal(), init_type_rune(), init_type_savebed(), init_type_scroll(), init_type_shop_inventory(), init_type_shop_mat(), init_type_sign(), init_type_skillscroll(), init_type_spell_effect(), init_type_spellbook(), init_type_spinner(), init_type_teleporter(), init_type_thrown_object(), init_type_transport(), init_type_trap(), init_type_trapdoor(), init_type_treasure(), init_type_trigger(), init_type_trigger_altar(), init_type_trigger_button(), init_type_trigger_pedestal(), and init_type_weapon_improver().

Referenced by init_ob_methods().

+ Here is the caller graph for this function:

◆ remove_curse()

int remove_curse ( object op,
object caster,
object spell 
)

This function removes the cursed/damned status on equipped items.

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
Returns
how many items were affected.
Todo:
why is the value set to 0?

Definition at line 2404 of file spell_effect.cpp.

References caster_level(), CLEAR_FLAG, draw_ext_info(), esrv_update_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FOR_INV_FINISH, FOR_INV_PREPARE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, give::op, PLAYER, QUERY_FLAG, Ice::tmp, and UPD_FLAGS.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_door()

void remove_door ( object op)

Remove non locked doors. The functions check to see if similar doors are next to the one that is being removed, and if so, set it so those will be removed shortly (in a cascade like fashion.)

See also
remove_locked_door().
Parameters
opdoor to remove.

Definition at line 38 of file time.cpp.

References arch_to_object(), DOOR, freearr_x, freearr_y, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), give::op, and Ice::tmp.

Referenced by attempt_pick_lock(), legacy_ob_process(), and player_attack_door().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_locked_door()

void remove_locked_door ( object op)

Same as remove_door() but for locked doors.

Parameters
opdoor to remove.

Definition at line 64 of file time.cpp.

References arch_to_object(), freearr_x, freearr_y, LOCKED_DOOR, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), give::op, and Ice::tmp.

Referenced by legacy_ob_process(), and player_attack_door().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_trap()

int remove_trap ( object op,
object skill 
)

This skill will disarm any previously discovered trap. the algorithm is based (almost totally) on the old command_disarm() - b.t.

Parameters
opplayer disarming. Must be on a map.
skilldisarming skill.
Returns
experience gained to disarm.

Definition at line 1311 of file skills.cpp.

References calc_skill_exp(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, object_get_owner(), give::op, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, Ice::tmp, TRAP, trap_disarm(), trap_show(), object::type, diamondslots::x, and diamondslots::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_unpaid_objects()

void remove_unpaid_objects ( object op,
object env,
int  free_items 
)

This goes throws the inventory and removes unpaid objects, and puts them back in the map (location and map determined by values of env) or frees them. This function will descend into containers.

Parameters
opobject to start the search from.
envtop-level container, should be in a map if free_items is 0, unused if free_items is 1.
free_itemsif set, unpaid items are freed, else they are inserted in the same map as env.

Definition at line 3207 of file player.cpp.

References env, FLAG_UNPAID, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), give::op, and QUERY_FLAG.

Referenced by check_login(), execute_word_of_recall(), and kill_player_not_permadeath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rod_adjust()

void rod_adjust ( object rod)

Adjusts rod attributes. This function must be called after a new rod has been created.

Parameters
rodthe rod to update

Definition at line 390 of file main.cpp.

References living::hp, object::inv, object::level, MAX, living::maxhp, SP_level_spellpoint_cost(), SPELL_HIGHEST, object::stats, object::value, and nlohmann::detail::void().

Referenced by fix_generated_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roll_again()

void roll_again ( object op)

Ask the player what to do with the statistics.

Parameters
opplayer.

Definition at line 1141 of file player.cpp.

References CS_QUERY_SINGLECHAR, esrv_new_player(), i18n(), give::op, and send_query().

Referenced by add_player(), and receive_player_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roll_stat()

int roll_stat ( void  )

This rolls four 1-6 rolls and sums the best 3 of the 4.

Returns
sum of rolls.

Definition at line 1038 of file player.cpp.

References RANDOM.

Referenced by roll_stats().

+ Here is the caller graph for this function:

◆ roll_stats()

void roll_stats ( object op)

Roll the initial player's statistics.

Parameters
opplayer to roll for.

Definition at line 1062 of file player.cpp.

References fix_object(), give::op, roll_stat(), Settings::roll_stat_points, and settings.

Referenced by get_player(), and key_roll_stat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sack_can_hold()

int sack_can_hold ( const object pl,
const object sack,
const object op,
uint32_t  nrof 
)

Check if an item op can be put into a sack. If pl exists then tell a player the reason of failure.

Parameters
plplayer.
sackcontainer to try to put into.
opwhat to put in the sack.
nrofnumber of objects (op) we want to put in. We specify it separately instead of using op->nrof because often times, a player may have specified a certain number of objects to drop, so we can pass that number, and not need to use split_ob() and stuff.
Returns
1 if it will fit, 0 if it will not.

Definition at line 317 of file c_object.cpp.

References object::carrying, CONTAINER, draw_ext_info_format(), FLAG_APPLIED, living::food, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, give::name, NDI_UNIQUE, give::op, altar_valkyrie::pl, QUERY_FLAG, query_name(), object::race, object::slaying, SPECIAL_KEY, object::stats, living::Str, and object::weight_limit.

Referenced by esrv_move_object(), pick_up(), and put_object_in_sack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_player()

int save_player ( object op,
int  flag 
)

Saves a player to disk.

Parameters
opplayer to save.
flagif is set, it's only backup, ie dont remove objects from inventory. If BACKUP_SAVE_AT_HOME is set, and the flag is set, then the player will be saved at the emergency save location.
Returns
non zero if successful.

Definition at line 230 of file login.cpp.

References account_char_add(), account_char_save(), account_get_account_for_char(), account_link(), checksum(), CLEAR_FLAG, copy_file(), destroy_object(), draw_ext_info(), draw_ext_info_format(), Settings::emergency_mapname, esrv_send_inventory(), npc_dialog::filename, FLAG_NO_FIX_PLAYER, FLAG_WIZ, i18n_get_language_code(), key_inventory, keyrings, knowledge_first_player_save(), llevDebug, llevError, Settings::localdir, LOG(), make_path_to_file(), MAX_BUF, MAX_SKILLS, MIN, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, NDI_ALL_DMS, NDI_RED, NDI_UNIQUE, of_close(), of_open(), give::op, party_get_password(), pets_terminate_all(), altar_valkyrie::pl, PLAYER, player_get_own_title(), player_has_own_title(), Settings::playerdir, PROFILE_BEGIN, PROFILE_END, QUERY_FLAG, quest_first_player_save(), range_none, SAVE_ERROR_OK, SAVE_FLAG_NO_REMOVE, SAVE_FLAG_SAVE_UNPAID, SAVE_MODE, save_object(), SET_FLAG, Settings::set_title, settings, ST_GET_PARTY_PASSWORD, ST_PLAYING, tempnam_secure(), Settings::tmpdir, TRUE, unapply_never, and unapply_nochoice.

Referenced by account_play_cmd(), apply_savebed(), check_login(), command_save(), do_server(), drop_object(), emergency_save(), enter_exit(), kill_player_not_permadeath(), kill_player_permadeath(), player_changer_type_process(), process_players1(), and save_and_kick_all_players().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_throw_object()

void save_throw_object ( object op,
uint32_t  type,
object originator 
)

◆ scroll_failure()

void scroll_failure ( object op,
int  failure,
int  power 
)

op made some mistake with a scroll, this takes care of punishment. scroll_failure()- hacked directly from spell_failure

If settings.spell_failure_effects is FALSE, the only nasty things that can happen are weird spell cast, or mana drain.

Parameters
opwho failed.
failurewhat kind of nasty things happen.
powerthe higher the value, the worse the thing that happens.

Definition at line 1601 of file apply.cpp.

References blind_living(), cast_magic_storm(), cast_wonder(), confuse_living(), create_archetype(), draw_ext_info(), FREE_OBJ_NO_DESTROY_CALLBACK, LOOSE_MANA, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, NDI_UNIQUE, object_free(), give::op, paralyze_living(), PREFER_LOW, random_roll(), settings, Settings::spell_failure_effects, SPELL_WONDER, Ice::tmp, and TRUE.

Referenced by scroll_type_apply(), and spellbook_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_news()

void send_news ( const object op)

Send the news to a player.

Parameters
opplayer to send to.

Definition at line 206 of file player.cpp.

References buf, Settings::confdir, draw_ext_info_format(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, NDI_GREEN, NDI_UNIQUE, Settings::news, give::op, safe_strcat(), safe_strncpy, settings, and strip_endline().

Referenced by add_player(), and command_news().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_rules()

void send_rules ( const object op)

Send the rules to a player.

Parameters
opplayer to send rules to.

Definition at line 170 of file player.cpp.

References buf, Settings::confdir, draw_ext_info(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_RULES, NDI_GREEN, NDI_UNIQUE, give::op, Settings::rules, safe_strcat(), and settings.

Referenced by add_player(), and command_rules().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ server_main()

void server_main ( int  argc,
char *  argv[] 
)

Server main function.

Parameters
argclength of argv.
argvcommand-line options.

Definition at line 1581 of file server.cpp.

References bRunning, cftimer_process_timers(), check_active_maps(), do_server(), do_specials(), EVENT_CLOCK, events_execute_global_event(), init(), initPlugins(), llevInfo, LOG(), nroferrors, process_events(), PROFILE_BEGIN, PROFILE_END, tick_game_time(), TRUE, and update_players().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_darkness_map()

void set_darkness_map ( mapstruct m)

Set the darkness level for a map, based on the time of the day.

Parameters
mmap to alter.

Definition at line 371 of file main.cpp.

References change_map_light(), get_tod(), timeofday_t::hour, HOURS_PER_DAY, m, timeofday_t::season, season_timechange, and nlohmann::detail::void().

Referenced by generate_random_map(), and ready_map_name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_first_map()

void set_first_map ( object op)

This loads the first map an puts the player on it.

Parameters
opplayer to put on map.

Definition at line 394 of file player.cpp.

References enter_player_maplevel(), first_map_path, and give::op.

Referenced by add_player(), and receive_play_again().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_map_timeout()

void set_map_timeout ( mapstruct oldmap)

Applies the map timeout.

Parameters
oldmapmap to process.

Definition at line 304 of file main.cpp.

References MAP_MAXTIMEOUT, MAP_MINTIMEOUT, MAP_TIMEOUT, swap_map(), mapstruct::timeout, and nlohmann::detail::void().

Referenced by flush_old_maps(), place_exits(), and player_map_change_common().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_object_face_main()

int set_object_face_main ( object op)

Makes an object's face the main face, which is supposed to be the "closed" one.

Sets an object's face to the 'face' in the archetype. Meant for showing containers opening and closing.

Parameters
opObject to set face on
Returns
TRUE if face changed

Definition at line 146 of file apply.cpp.

References FALSE, object_get_value(), give::op, sstring, TRUE, and try_find_face().

Referenced by apply_container(), and put_object_in_sack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_player_socket()

void set_player_socket ( player p,
socket_struct ns 
)

This copies the data from the socket into the player structure. Originally written to separate this logic from add_player() so new character method could use it, but that did not work out, but still a good thing to have this separate.

Parameters
pThe target player object to copy the data into
nsthe socket structure to copy.

Definition at line 413 of file player.cpp.

References account_char_free(), socket_struct::account_chars, socket_struct::account_name, socket_struct::faces_sent, fatal(), socket_struct::host, socket_struct::inbuf, OUT_OF_MEMORY, player::socket, SockList_ResetRead(), and strdup_local.

Referenced by account_play_cmd(), and add_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_spell_skill()

void set_spell_skill ( object op,
object caster,
object spob,
object dest 
)

Utility function to assign the correct skill when casting.

Relatively simple function that gets used a lot. Basically, it sets up the skill pointer for the spell being cast. If op is really casting the spell, then the skill is whatever skill the spell requires. if instead caster (rod, horn, wand, etc) is casting the skill, then they get exp for the skill that you need to use for that object (use magic device).

Parameters
opobject casting the spell.
casterobject used to cast the spell (rod, wand, ...).
spobspell object.
destobject to set the skill for.

Definition at line 94 of file spell_util.cpp.

References add_refcount(), convert::dest, FREE_AND_CLEAR_STR, give::op, and object::skill.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_smite_spell(), create_aura(), create_bomb(), fire_arch_from_position(), fire_bolt(), fire_swarm(), magic_wall(), mood_change(), pets_summon_golem(), pets_summon_object(), and write_rune().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ should_director_abort()

int should_director_abort ( const object op,
const object victim 
)

Check if op should abort moving victim because of it's race or slaying.

Parameters
opdetector or equivalent we're testing. Note that its type is not checked.
victimobject trying to move on op.
Returns
1 if it should abort, 0 if it should continue.

Definition at line 68 of file apply.cpp.

References DOOR, give::op, and reputation::victim.

Referenced by director_type_move_on(), move_player_mover(), and player_mover_type_move_on().

+ Here is the caller graph for this function:

◆ show_skills()

void show_skills ( object op,
const char *  parms 
)

Displays a player's skill list, and some other non skill related info (god, max weapon improvements, item power).

This shows the amount of exp they have in the skills.

Note this function is a bit more complicated because we we want ot sort the skills before printing them. If we just dumped this as we found it, this would be a bit simpler.

Parameters
opplayer wanting to examine skills.
parmsoptional parameters, usually a string to restrict skills to show.

Definition at line 860 of file skill_util.cpp.

References clipped_percent(), determine_god(), digits_in_long(), draw_ext_info(), draw_ext_info_format(), exp_level(), FMT64, FOR_INV_FINISH, FOR_INV_PREPARE, level_exp(), MAX_BUF, MAX_SKILLS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_LIST, NDI_RED, NDI_UNIQUE, give::op, give::parms, PERM_EXP, Settings::permanent_exp_ratio, settings, SKILL, and Ice::tmp.

Referenced by command_skills().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shuffle_attack()

void shuffle_attack ( object op)

This routine shuffles the attack of op to one of the ones in the list. It does this at random. It also chooses a face appropriate to the attack that is being committed by that square at the moment.

It's being used by color spray and create pool of chaos.

Note
This could really be a better implementation - the faces and attacktypes above are hardcoded, which is never good. The faces refer to faces in the animation sequence. Not sure how to do better - but not having it hardcoded would be nice.
Parameters
opobject to change.

Definition at line 1033 of file spell_util.cpp.

References AT_MAGIC, ATTACKS, Chaos_Attacks::attacktype, give::op, rndm(), and SET_ANIMATION.

Referenced by hit_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singing()

int singing ( object pl,
int  dir,
object skill 
)

Singing skill handling. This skill allows the player to pacify nearby creatures. There are few limitations on who/what kind of non-player creatures that may be pacified. Right now, a player may pacify creatures which have Int == 0. In this routine, once successfully pacified the creature gets Int=1. Thus, a player may only pacify a creature once. BTW, I appologize for the naming of the skill, I couldnt think of anything better! -b.t.

Parameters
plplayer singing.
dirdirection to sing in.
skillsinging skill object.
Returns
experience gained for singing.

Definition at line 1149 of file skills.cpp.

References calc_skill_exp(), draw_ext_info_format(), FLAG_FRIENDLY, FLAG_HITBACK, FLAG_MONSTER, FLAG_NO_STEAL, FLAG_SPLITTING, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, object::level, m, MAX_BUF, MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, give::name, NDI_UNIQUE, object_value_set(), P_IS_ALIVE, P_OUT_OF_MAP, altar_valkyrie::pl, PLAYER, PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, SIZEOFFREE, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skill_attack()

void skill_attack ( object tmp,
object pl,
int  dir,
const char *  string,
object skill 
)

Core routine for use when we attack using a skills system. In essence, this code handles all skill-based attacks, ie hth, missile and melee weapons should be treated here. If an opponent is already supplied by move_player(), we move right onto do_skill_attack(), otherwise we find if an appropriate opponent exists.

This is called by move_player() and attack_hth()

Initial implementation by -bt thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du

Parameters
tmpvictim. Can be NULL.
plwho is attacking.
dirdirection to attack.
stringdescribes the damage ("claw", "punch", ...).
skillattack skill.

Definition at line 1270 of file skill_util.cpp.

References do_skill_attack(), draw_ext_info(), FLAG_ALIVE, FLAG_CAN_ROLL, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, LOCKED_DOOR, m, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, altar_valkyrie::pl, PLAYER, QUERY_FLAG, and Ice::tmp.

Referenced by attack_hth(), attack_melee_weapon(), attempt_jump(), monster_move(), and move_player_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skill_ident()

int skill_ident ( object pl,
object skill 
)

Main identification skill handling.

Parameters
plplayer identifying.
skillidentification skill.
Returns
experience gained for identification.

Definition at line 927 of file skills.cpp.

References do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), draw_ext_info(), draw_ext_info_format(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, llevError, LOG(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, object::name, NDI_UNIQUE, OBJECT_TYPE_MAX, altar_valkyrie::pl, PLAYER, SK_DET_CURSE, SK_DET_MAGIC, and object::subtype.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skill_throw()

int skill_throw ( object op,
object part,
int  dir,
object skill 
)

Throwing skill handling.

Parameters
opobject throwing.
partactual part of op throwing.
dirdirection to throw into.
skillthrowing skill.
Return values
0skill use failed.
1skill was successfully used.

Definition at line 2277 of file skills.cpp.

References do_throw(), find_string(), find_throw_ob(), monster_find_throw_ob(), give::op, and PLAYER.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ slow_living_by()

int slow_living_by ( object op,
const int  speed_penalty 
)

Definition at line 2227 of file attack.cpp.

References arch_present_in_ob(), arch_to_object(), find_archetype(), fix_object(), FLAG_APPLIED, object_insert_in_ob(), give::op, SET_FLAG, and Ice::tmp.

Referenced by eat_common(), and slow_living().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_dam_adjust()

int SP_level_dam_adjust ( const object caster,
const object spob 
)

Returns adjusted damage based on the caster.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted damage.

Definition at line 287 of file spell_util.cpp.

References caster_level(), object::dam_modifier, and min_casting_level().

Referenced by alchemy(), animate_weapon(), append_spell(), cast_cause_disease(), cast_change_ability(), cast_cone(), cast_create_missile(), cast_destruction(), cast_identify(), cast_light(), cast_smite_spell(), cast_transfer(), create_aura(), create_bomb(), esrv_update_spells(), fire_arch_from_position(), fire_bolt(), magic_wall(), pets_summon_golem(), pets_summon_object(), and recharge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_duration_adjust()

int SP_level_duration_adjust ( const object caster,
const object spob 
)

Adjust the duration of the spell based on level. This is basically the same as SP_level_dam_adjust() above, but instead looks at the level_modifier value.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted duration.

Definition at line 312 of file spell_util.cpp.

References caster_level(), object::duration_modifier, and min_casting_level().

Referenced by alchemy(), animate_weapon(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_cone(), cast_create_food(), cast_create_missile(), cast_curse(), cast_destruction(), cast_invisible(), cast_light(), cast_word_of_recall(), create_aura(), create_bomb(), fire_arch_from_position(), fire_bolt(), fire_swarm(), magic_wall(), and pets_summon_golem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_range_adjust()

int SP_level_range_adjust ( const object caster,
const object spob 
)

Adjust the range of the spell based on level. This is basically the same as SP_level_dam_adjust() above, but instead looks at the level_modifier value.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted range.

Definition at line 338 of file spell_util.cpp.

References caster_level(), min_casting_level(), and object::range_modifier.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_light(), cast_polymorph(), cast_smite_spell(), create_aura(), create_bomb(), dimension_door(), fire_arch_from_position(), fire_bolt(), magic_wall(), mood_change(), pets_summon_golem(), and probe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_spellpoint_cost()

int16_t SP_level_spellpoint_cost ( object caster,
object spell,
int  flags 
)

Scales the spellpoint cost of a spell by it's increased effectiveness. Some of the lower level spells become incredibly vicious at high levels. Very cheap mass destruction. This function is intended to keep the sp cost related to the effectiveness.

Note that it is now possible for a spell to cost both grace and mana. In that case, we return which ever value is higher.

Parameters
casterwhat is casting the spell.
spellspell object.
flagsone of Spell/grace points.
Returns
sp/mana points cost.

Definition at line 236 of file spell_util.cpp.

References caster_level(), flags, living::grace, make_face_from_files::int, object::level, llevError, LOG(), MAX, living::maxgrace, living::maxsp, PATH_SP_MULT, settings, living::sp, SPELL_GRACE, SPELL_HIGHEST, SPELL_MANA, Settings::spellpoint_level_depend, object::stats, and TRUE.

Referenced by append_spell(), cast_spell(), drain_rod_charge(), esrv_update_spells(), examine_rod_charge_level(), fire_misc_object(), monster_cast_spell(), rod_adjust(), show_matching_spells(), write_rune(), and write_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_wc_adjust()

int SP_level_wc_adjust ( const object caster,
const object spob 
)

Returns adjusted wc based on the caster and the spell.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted wc (positive is best).

Definition at line 362 of file spell_util.cpp.

References caster_level(), min_casting_level(), object_get_value(), and sstring.

Referenced by pets_summon_golem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spell_effect()

void spell_effect ( object spob,
int  x,
int  y,
mapstruct map,
object originator 
)

Inserts into map a spell effect based on other_arch.

Parameters
spobspell object to insert object from.
x
y
mapcoordinates to put the effect at.
originatorwhat causes the effect to be inserted. Can be NULL.

Definition at line 144 of file spell_util.cpp.

References arch_to_object(), disinfect::map, object_insert_in_map_at(), object::other_arch, diamondslots::x, and diamondslots::y.

Referenced by cast_identify(), and cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spell_failure()

void spell_failure ( object op,
int  failure,
int  power,
object skill 
)

Handles the various effects for differing degrees of failure badness.

Parameters
opplayer that failed.
failurerandom value of how badly you failed.
powerhow many spellpoints you'd normally need for the spell.
skillskill needed to cast the spell.

Definition at line 1103 of file spell_util.cpp.

References AT_INTERNAL, cast_cone(), confuse_living(), create_archetype(), draw_ext_info(), FALSE, get_map_flags(), hit_player(), isqrt(), object::level, LOOSE_MANA, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), give::op, P_NO_MAGIC, paralyze_living(), settings, Settings::spell_failure_effects, SPELL_WONDER, and Ice::tmp.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spell_find_dir()

int spell_find_dir ( mapstruct m,
int  x,
int  y,
object exclude 
)

Search what direction a spell should go in, first the center square then some close squares in the given map at the given coordinates for live objects.

It will not consider the object given as exclude (= caster) among possible live objects. If the caster is a player, the spell will go after monsters/generators only. If not, the spell will hunt players only.

Exception is player on a battleground, who will be targeted unless excluded.

Parameters
m
x
ywhere to search from.
excludewhat object to avoid. Can be NULL, in which case all bets are off.
Returns
direction toward the first/closest live object if it finds any, otherwise -1.

Definition at line 887 of file spell_util.cpp.

References can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, freedir, get_map_flags(), GET_MAP_OB, get_search_arr(), HEAD, m, op_on_battleground(), P_BLOCKSVIEW, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, SIZEOFFREE, Ice::tmp, object::type, diamondslots::x, and diamondslots::y.

Referenced by move_ball_spell(), and move_missile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spring_trap()

void spring_trap ( object trap,
object victim 
)

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 214 of file rune.cpp.

References arch_to_object(), cast_spell(), archetype::clone, object::count, object::direction, rv_vector::distance, draw_ext_info(), env, FLAG_ALIVE, FLAG_IS_LINKED, FLAG_IS_USED_UP, FLAG_LIFESAVE, living::food, get_rangevector(), living::hp, object::inv, MAX, living::maxhp, object::msg, MSG_TYPE_APPLY, MSG_TYPE_APPLY_TRAP, NDI_UNIQUE, object_free_drop_inventory(), object_get_env_recursive(), object_insert_in_map_at(), object_remove(), object_was_destroyed, object::other_arch, PLAYER, QUERY_FLAG, rune_attack(), SET_FLAG, SIGN, SPELL, object::stats, trap_show(), object::type, use_trigger(), and reputation::victim.

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:

◆ stand_near_hostile()

int stand_near_hostile ( object who)

Determine if who is standing near a hostile creature.

Parameters
whoobject to check.
Returns
1 if near a monster, 0 else.

Definition at line 4074 of file player.cpp.

References FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, m, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, Ice::tmp, autojail::who, diamondslots::x, and diamondslots::y.

Referenced by attempt_hide().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ steal()

int steal ( object op,
int  dir,
object skill 
)

Main stealing function.

Parameters
opthief.
dirdirection to steal from.
skillstealing skill.
Returns
experience gained for stealing, 0 if nothing was stolen.

Definition at line 279 of file skills.cpp.

References attempt_steal(), calc_skill_exp(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_WIZ, FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, HEAD, m, OB_TYPE_MOVE_BLOCK, object_get_owner(), give::op, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, QUERY_FLAG, Ice::tmp, object::type, diamondslots::x, and diamondslots::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop_item()

object* stop_item ( object op)

An item (ARROW or such) stops moving.

stop_item() returns a pointer to the stopped object. The stopped object may or may not have been removed from maps or inventories. It will not have been merged with other items.

This function assumes that only items on maps need special treatment.

If the object can't be stopped, or it was destroyed while trying to stop it, NULL is returned.

fix_stopped_item() should be used if the stopped item should be put on the map.

Parameters
opobject to check.
Returns
pointer to stopped object, NULL if destroyed or can't be stopped.

Definition at line 455 of file time.cpp.

References ARROW, fix_stopped_arrow(), free_no_drop(), MIN_ACTIVE_SPEED, object_free_drop_inventory(), object_remove(), give::op, and THROWN_OBJ.

Referenced by pick_up(), put_in_icecube(), and save_throw_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store_spell_expiry()

void store_spell_expiry ( object spell)

Stores in the spell when to warn player of expiration.

Parameters
spellspell we're considering.

Definition at line 1981 of file spell_util.cpp.

References object::duration, and object_set_value().

Referenced by cast_bless(), cast_change_ability(), create_aura(), and potion_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ summon_hostile_monsters()

int summon_hostile_monsters ( object op,
int  n,
const char *  monstername 
)

Summons hostile monsters and places them in nearby squares.

Note
this is not used by any spells (summon evil monsters use to call this, but best I can tell, that spell/ability was never used. This is however used by various failures on the players part (alchemy, reincarnation, etc)
Parameters
opthe summoner.
nnumber of monsters.
monsternamename of the monster to summon, should be a valid archetype.
Returns
number of monsters actually put on the map.

Definition at line 1005 of file spell_util.cpp.

References give::op, and put_a_monster().

Referenced by alchemy_failure_effect(), and cast_raise_dead_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swap_map()

int swap_map ( mapstruct map)

Swaps a map to disk.

After calling this function, the map will be:

  • swapped to disk
  • kept in memory in case of save error
Parameters
mapmap to swap.
Returns
one of SAVE_ERROR_xxx.

Definition at line 136 of file swap.cpp.

References delete_map(), draw_ext_info_format(), EVENT_MAPRESET, events_execute_global_event(), first_player, FLAG_REMOVED, free_map(), llevDebug, llevError, LOG(), disinfect::map, MAP_IN_MEMORY, maps_swapped_total, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, NDI_ALL_DMS, NDI_RED, NDI_UNIQUE, pets_attempt_follow(), altar_valkyrie::pl, QUERY_FLAG, Settings::recycle_tmp_maps, altar_valkyrie::res, rndm(), SAVE_ERROR_NOT_IN_MEMORY, SAVE_ERROR_OK, SAVE_ERROR_PLAYER, save_map(), SAVE_MODE_NORMAL, seconds(), set_map_reset_time(), settings, TRUE, and write_map_log().

Referenced by check_active_maps(), clean_tmp_files(), command_reset(), and set_map_timeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tailor_god_spell()

int tailor_god_spell ( object spellop,
object caster 
)

Changes the attributes of cone, smite, and ball spells as needed by the code.

Parameters
spellopspell object to change.
casterwhat is casting spellop (player, spell, ...).
Returns
0 if there was no race to assign to the slaying field of the spell, but the spell attacktype contains AT_HOLYWORD, 1 else.

Definition at line 1222 of file gods.cpp.

References add_string(), AT_GODPOWER, AT_HOLYWORD, object::attacktype, buf, determine_god(), draw_ext_info(), find_god(), FREE_AND_COPY, free_string(), llevError, LOG(), MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, object::name, object::name_pl, NDI_UNIQUE, object_free_drop_inventory(), object_get_owner(), object::race, object::slaying, SPELL, SPELL_EFFECT, object::title, and object::type.

Referenced by cast_cone(), cast_smite_spell(), explode_bullet(), fire_arch_from_position(), and fire_swarm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ teleport()

int teleport ( object teleporter,
uint8_t  tele_type,
object user 
)

Teleport an item around a nearby random teleporter of specified type.

It is basically used so that shop_mats and normal teleporters can be used close to each other and not have the player put to the one of another type.

Parameters
teleporterwhat is teleporting user.
tele_typewhat object type user can be put on. this is either set to SHOP_MAT or TELEPORTER.
userwhat object to teleport.
Return values
1user was destroyed.
0user is still valid, but may have moved or not.
Todo:
fix weird return values.

Definition at line 204 of file move.cpp.

References object::contr, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, HEAD, llevError, LOG(), m, object::map, map_newmap_cmd(), object::name, OB_TYPE_MOVE_BLOCK, object_find_free_spot(), object_insert_in_map_at(), object_remove(), OUT_OF_REAL_MAP, P_OUT_OF_MAP, pets_attempt_follow(), PLAYER, player_update_bg_music(), RANDOM, SHOP_MAT, player::socket, Ice::tmp, object::type, object::x, and object::y.

Referenced by initteleport(), move_teleporter(), runteleport(), and shop_mat_type_move_on().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tick_the_clock()

void tick_the_clock ( void  )

This performs the basic function of advancing the clock one tick forward. Every 20 ticks, the clock is saved to disk. It is also saved on shutdown. Any time dependant functions should be called from this function, and probably be passed tod as an argument. Please don't modify tod in the dependant function.

Definition at line 94 of file weather.cpp.

References dawn_to_dusk(), get_tod(), todtick, and write_todclock().

Referenced by block_until_new_connection(), and do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transfer_ob()

int transfer_ob ( object op,
int  x,
int  y,
int  randomly,
object originator 
)

Move an object (even linked objects) to another spot on the same map.

Does nothing if there is no free spot.

Parameters
opwhat to move.
x
ynew coordinates.
randomlyif true, use object_find_free_spot() to find the destination, otherwise use object_find_first_free_spot().
originatorwhat is causing op to move.
Return values
1op was destroyed.
0op was moved.

Definition at line 163 of file move.cpp.

References freearr_x, freearr_y, HEAD, map_newmap_cmd(), object_find_first_free_spot(), object_find_free_spot(), object_insert_in_map_at(), object_remove(), give::op, pets_attempt_follow(), PLAYER, player_update_bg_music(), SIZEOFFREE, diamondslots::x, and diamondslots::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:

◆ transport_can_hold()

int transport_can_hold ( const object transport,
const object op,
int  nrof 
)

Can transport hold object op? This is a pretty trivial function, but in the future, possible transport may have more restrictions or weight reduction like containers

Parameters
transporttransport to check.
opobject we're trying to insert.
nrofnumber of op.
Returns
1 if can hold, 0 else.

Definition at line 54 of file apply.cpp.

References object::carrying, give::op, and object::weight_limit.

Referenced by esrv_move_object(), put_object_in_sack(), and transport_type_apply().

+ Here is the caller graph for this function:

◆ trap_disarm()

int trap_disarm ( object disarmer,
object trap,
int  risk,
object skill 
)

Try to disarm a trap/rune.

Parameters
disarmerobject disarming the trap/rune.
traptrap to disarm.
riskif 0, trap/rune won't spring if disarm failure. Else it will spring.
skillspell used to disarm.
Returns
experience to award, 0 for failure.

Definition at line 442 of file rune.cpp.

References living::dam, destroy_object(), living::Dex, mapstruct::difficulty, draw_ext_info(), draw_ext_info_format(), object::inv, object::level, object::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_UNIQUE, object_get_owner(), PLAYER, PREFER_LOW, random_roll(), spring_trap(), sqr, object::stats, and object::type.

Referenced by dispel_rune(), and remove_trap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trap_see()

int trap_see ( object op,
object trap 
)

Should op see trap?

Parameters
opliving that could spot the trap.
traptrap that is invisible.
Return values
0trap wasn't spotted.
1trap was spotted.

Definition at line 385 of file rune.cpp.

References living::Cha, draw_ext_info_format(), object::level, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_UNIQUE, give::op, PREFER_HIGH, random_roll(), and object::stats.

Referenced by find_traps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trap_show()

int trap_show ( object trap,
object where 
)

Handles showing a trap/rune detonation.

Parameters
traptrap that detonates.
whereobject at the location to detonate.
Return values
0no animation inserted.
1animation inserted.

Definition at line 412 of file rune.cpp.

References object::animation, create_archetype(), object::face, GET_ANIMATION, object_insert_in_map_at(), object::temp_animation, and python_pickup::where.

Referenced by find_traps(), remove_trap(), and spring_trap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use_alchemy()

int use_alchemy ( object op)

Handle use_skill for alchemy-like items.

Parameters
opplayer trying to do alchemy.
Returns
1 if any recipe was attempted, 0 else.
Note
Will inform player if attempting to use unpaid cauldron or ingredient.
Todo:
check if no superflous message when 2 cauldrons on same spot, one unpaid? (shouldn't happen, but well).

Definition at line 1057 of file alchemy.cpp.

References attempt_do_alchemy(), draw_ext_info(), draw_ext_info_format(), esrv_send_inventory(), FLAG_APPLIED, FLAG_IS_CAULDRON, FLAG_UNPAID, FLAG_WIZ, FOR_MAP_FINISH, FOR_MAP_PREPARE, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, give::name, NDI_UNIQUE, object_find_by_flag(), give::op, query_base_name(), QUERY_FLAG, and Ice::tmp.

Referenced by do_skill(), and knowledge_alchemy_attempt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use_oratory()

int use_oratory ( object pl,
int  dir,
object skill 
)

Oratory skill handling. Players using this skill can 'charm' a monster – into working for them. It can only be used on non-special (see below) 'neutral' creatures. -b.t. (thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du)

Parameters
plplayer trying to convince a monster.
dirdirection to orate in.
skilloratory skill object.
Returns
experience gained for oratoring.
Todo:
check if can't be simplified, code looks duplicated.

Definition at line 996 of file skills.cpp.

References add_friendly_object(), calc_skill_exp(), CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, FREE_AND_COPY, freearr_x, freearr_y, get_map_flags(), HEAD, object::level, m, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, give::name, NDI_UNIQUE, object_get_owner(), object_set_owner(), object_value_set(), P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, altar_valkyrie::pl, PLAYER, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), remove_friendly_object(), SET_FLAG, object::skill, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use_skill()

int use_skill ( object op,
const char *  string 
)

Similar to invoke command, it executes the skill in the direction that the user is facing.

This is tricky because skills can have spaces. We basically roll our own find_skill_by_name so we can try to do better string matching.

Parameters
opplayer trying to use a skill.
stringparameter for the skill to use.
Return values
0unable to change to the requested skill, or unable to use the skill properly.
1skill correctly used.

Definition at line 964 of file skill_util.cpp.

References do_skill(), draw_ext_info_format(), FLAG_CAN_USE_SKILL, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, llevDebug, LOG(), MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, give::name, NDI_UNIQUE, give::op, QUERY_FLAG, SKILL, object::skill, SKILL_TOOL, and Ice::tmp.

Referenced by command_uskill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_player()

int verify_player ( const char *  name,
char *  password 
)

This verify that a character of name exits, and that it matches password.

Parameters
nameplayer name.
passwordplayer's password, not encrypted.
Return values
0there is match.
1no such player.
2incorrect password.

Definition at line 111 of file login.cpp.

References buf, check_password(), first_player, llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, give::name, object::name, player::next, player::ob, Settings::playerdir, and settings.

Referenced by account_add_player_cmd(), and create_player_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_mark()

int write_mark ( object op,
object spell,
const char *  msg 
)

This writes a rune that contains the appropriate message. There really aren't any adjustments we make.

Parameters
opwho is casting.
spellactual spell cast.
msgmessage to write.
Return values
0failure.
1success.

Definition at line 3411 of file spell_effect.cpp.

References add_string(), arch_to_object(), draw_ext_info(), HUGE_BUF, INS_BELOW_ORIGINATOR, llevInfo, LOG(), navar-midane_pickup::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object_insert_in_map_at(), object_set_msg(), give::op, object::other_arch, strcasestr_local, and Ice::tmp.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_on_item()

int write_on_item ( object pl,
const char *  params,
object skill 
)

Implement the 'inscription' skill, which checks for the required skills and marked items before running either write_note() or write_scroll().

Parameters
plPlayer attempting to write
paramsMessage to write, blank to write a spell
skillWriting skill
Returns
Experience gained from using the skill

Definition at line 1762 of file skills.cpp.

References BOOK, archetype::clone, draw_ext_info(), draw_ext_info_format(), find_marked_object(), find_skill_by_name(), FLAG_BLIND, FLAG_UNPAID, FLAG_WIZ, get_archetype_by_type_subtype(), say::item, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, roll-o-matic::params, altar_valkyrie::pl, PLAYER, QUERY_FLAG, SCROLL, SK_LITERACY, SKILL, object::skill, write_note(), and write_scroll().

Referenced by do_skill(), and inscribe_scroll_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_rune()

int write_rune ( object op,
object caster,
object spell,
int  dir,
const char *  runename 
)

Player is attempting to write a magical rune. This function does all checks for paths, sp/gr, ...

Parameters
oprune writer.
casterobject used for casting this rune.
spellwriting spell.
dirorientation of rune, direction rune's contained spell will be cast in, if applicable
runenamename of the rune or message displayed by the rune for a rune of marking.
Return values
0no rune was written.
1rune written.

Definition at line 50 of file rune.cpp.

References object::animation, arch_to_object(), buf, caster_level(), living::Cha, create_archetype(), object::direction, draw_ext_info(), draw_ext_info_format(), object::face, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, GENERIC_RUNE, get_map_flags(), object::level, m, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, NDI_UNIQUE, object_copy(), object_insert_in_map_at(), object_insert_in_ob(), object_matches_string(), object_new(), object_set_msg(), object_set_owner(), give::op, object::other_arch, object::path_attuned, object::path_denied, RUNE, set_spell_skill(), object::skill, SP_level_spellpoint_cost(), SPELL, SPELL_GRACE, SPELL_MANA, object::stats, Ice::tmp, try_find_animation(), try_find_face(), and object::type.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: