Crossfire Server, Trunk
|
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_Chars * | account_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_char * | account_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) |
player * | add_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) |
object * | check_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_swap (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) |
archetype * | determine_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) |
object * | drop_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) |
object * | find_applied_skill_by_name (const object *op, const char *name) |
object * | find_key (object *pl, object *container, object *door) |
object * | find_marked_object (object *op) |
player * | find_player (const char *plname) |
player * | find_player_options (const char *plname, int options, const mapstruct *map) |
player * | find_player_partial_name (const char *plname) |
player * | find_player_socket (const socket_struct *ns) |
object * | find_random_spell_in_ob (object *ob, const char *skill) |
object * | find_skill_by_name (object *who, const char *name) |
object * | find_skill_by_number (object *who, int skillno) |
object * | find_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) |
object * | fix_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) |
object * | get_nearest_criminal (object *mon) |
object * | get_nearest_player (object *mon) |
int | get_party_password (object *op, partylist *party) |
void | get_password (object *op) |
player * | get_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) |
object * | hit_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) |
object * | lookup_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) |
object * | monster_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) |
object * | monster_find_nearest_enemy (object *npc, object *owner) |
object * | monster_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) |
partylist * | party_find (const char *partyname) |
partylist * | party_form (object *op, const char *partyname) |
partylist * | party_get_first (void) |
const char * | party_get_leader (const partylist *party) |
partylist * | party_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) |
object * | pets_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) |
SockList * | player_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) |
object * | races_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) |
object * | stop_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) |
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.
account_name | account name we are changing |
current_password | current 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_password | new password to set, unencrypted. |
0 | password changed successfully. |
1 | account name, old or new password has invalid character. |
2 | account does not exist. |
3 | current 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().
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.
chars | Existing list of characters for account. May be NULL. |
pl | Player 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().
void account_char_free | ( | Account_Chars * | chars | ) |
This frees all data associated with the character information.
chars | Data 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().
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.
account_name | Name of the account. The name should be validated before this routine is called (eg, passed checks for legitimate characters and logged in) |
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().
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
chars | Existing list of characters for account. |
pl_name | The name of the character |
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.
void account_char_save | ( | Account_Chars * | chars | ) |
Saves the character information for the given account.
chars | previously 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().
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.
str | string to check |
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().
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)
account_name | account name we are looking for. |
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().
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.
charname | character name to check for. |
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().
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.
account_name | account name. | |
chars | known character names. | |
[out] | count | will be incremented by the number of items returned. Not initialized before 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().
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.
account_name | name of the account to get the players for. |
Definition at line 520 of file account.cpp.
References curse_on_apply::ac, accounts, and strcasecmp().
Referenced by account_play_cmd(), and START_TEST().
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.)
name | name to look for. |
Definition at line 605 of file account.cpp.
References accounts_logged_in, and give::name.
Referenced by account_add_player_cmd().
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.
account_name | name of the account we are adding this player to. |
player_name | name of this player. |
0 | player name added successfully. |
1 | could 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().
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.
account_name | account name we are looking for. |
account_password | password for the account. This is the unencrypted password (password as entered by user) |
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().
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().
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.
account_name | account name we are adding |
account_password | password for the account. This is the unencrypted password (password as entered by user) |
0 | account added successfully. |
1 | name or password has invalid character. |
2 | account 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().
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.
account_name | name of the account we are removing this player from. |
player_name | name of this player. |
0 | player name removed successfully. |
1 | could not find account of that name. |
2 | player 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().
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().
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().
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().
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.
ns | connection. |
flags | flag 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. |
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().
void add_server_collect_hooks | ( | ) |
Definition at line 1075 of file init.cpp.
References Settings::add_hook(), load_materials(), load_races(), and settings.
Referenced by init(), and ResourcesManager::load().
Change items to gold nuggets. Only works for players.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | op isn't a player. |
1 | op 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().
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
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
0 | spell failure. |
1 | spell 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().
int apply_auto | ( | object * | op | ) |
Map was just loaded, handle op's initialization.
Generates shop floor's item, and treasures.
op | object to initialize. |
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().
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.
m | map 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, 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().
void apply_builder_remove | ( | object * | pl, |
int | dir | ||
) |
Item remover.
Removes first buildable item, either under or above the floor
pl | player removing an item. |
dir | direction 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().
Living thing is applying an object.
pl | object causing op to be applied. |
op | object being applied. |
aflag | special (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special(). |
quiet | if 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. |
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().
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.
pl | player. |
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().
Checks to see if 'who' can apply object 'op'.
who | living thing trying to apply op. |
op | object applied. |
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().
Applies (race) changes to a player.
pl | object to change. |
change | what kind of changes to apply. Should be of type CLASS. |
limit_stats | uses 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().
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
who | living to check |
improves | improvement level. |
Definition at line 1131 of file apply.cpp.
References autojail::who.
Referenced by apply_special(), and improve_weapon().
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)
op | player. |
sack | container the player is opening or closing. |
aflags | combination of Flags for apply_special(). flags. |
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().
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.
tmp | item 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().
Main apply handler.
Checks for unpaid items before applying.
op | object causing tmp to be applied. |
tmp | object being applied. |
aflag | special (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special(). |
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().
void apply_map_builder | ( | object * | pl, |
int | dir | ||
) |
Global building function
This is the general map building function. Called when the player 'fires' a builder or remover object.
pl | player building or removing. |
dir | building direction. |
Definition at line 960 of file build_map.cpp.
References apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), create-tower::builder, can_build_over(), draw_ext_info(), find_archetype(), find_marked_object(), FLAG_IS_BUILDABLE, FLAG_UNPAID, FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, freearr_x, freearr_y, GET_MAP_OB, IS_PLAYER(), llevError, LOG(), MAP_HEIGHT, MAP_WIDTH, MATERIAL, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, NDI_UNIQUE, object_create_arch(), object_decrease_nrof_by_one, altar_valkyrie::pl, QUERY_FLAG, range_builder, SET_FLAG, SIGN, object::slaying, ST_BD_BUILD, ST_BD_REMOVE, ST_MAT_FLOOR, ST_MAT_ITEM, ST_MAT_WALL, ST_MAT_WINDOW, object::subtype, Ice::tmp, object::type, diamondslots::x, and diamondslots::y.
Referenced by fire().
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.)
op | Player object |
race | race to use - caller should do sanity checking that this is a valid race. |
opclass | class to use - like race, caller should do sanity checking. |
stats | If 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. |
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().
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)
who | object using op. It can be a monster. |
op | object 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. |
aflags | combination of AP_xxx flags. |
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().
Simple wrapper for attack_ob_simple(), will use hitter's values.
op | victim. |
hitter | attacker. |
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().
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.
op | player switching cults. |
new_god | new god to worship. |
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().
Blind a living thing.
op | victim. |
hitter | who is attacking. |
dam | damage 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 sword_of_souls::victim.
Referenced by hit_with_one_attacktype(), and scroll_failure().
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.
who | player/creature that used the skill. |
op | object that was 'defeated'. |
skill | used skill. If none, it should just point back to who or be NULL. |
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().
Definition at line 2796 of file c_wiz.cpp.
References object::contr, player::ob, give::op, and player::party.
Referenced by command_follow().
Improve statistics of some living object.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
dir | casting direction. |
0 | spell failed. |
1 | spell was successful. |
Definition at line 2048 of file spell_effect.cpp.
References living::ac, add_refcount(), add_string(), arch_to_object(), AT_PHYSICAL, ATNR_GODPOWER, object::attacktype, change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), object::duration, find_god(), find_target_for_friendly_spell(), FLAG_APPLIED, FOR_INV_FINISH, FOR_INV_PREPARE, dragon_attune::force, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), INS_ON_TOP, MIN, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_SPELL_TARGET, object::name, NDI_UNIQUE, NROFATTACKS, object_insert_in_map_at(), object_insert_in_ob(), give::op, object::other_arch, object::path_attuned, object::race, object::resist, SET_FLAG, object::slaying, SP_level_duration_adjust(), object::stats, store_spell_expiry(), Ice::tmp, and living::wc.
Referenced by cast_spell().
Let's try to infect something.
op | who is casting. |
caster | what object is casting. |
spell | spell object to cast. |
dir | cast direction. |
0 | no one caught anything. |
1 | at least one living was affected. |
Definition at line 1207 of file spell_attack.cpp.
References living::ac, ARCH_DETECT_MAGIC, arch_to_object(), caster_level(), create_archetype(), living::dam, draw_ext_info(), draw_ext_info_format(), living::exp, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, HEAD, living::hp, infect_object(), object::last_eat, object::last_sp, object::level, m, object::magic, object::map, living::maxgrace, living::maxhp, living::maxsp, MOVE_FLY_LOW, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), object_set_owner(), give::op, object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, set_spell_skill(), living::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, object::type, living::wc, diamondslots::x, and diamondslots::y.
Referenced by cast_spell().
Cast some stat-improving spell.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
dir | casting direction. |
silent | if non zero, don't say when the spell is already is effect. |
0 | spell failed. |
1 | spell was successful. |
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().
This changes the light level for the entire map.
op | who is casting. |
spell | actual spell object. |
0 | light not affected. |
1 | light 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().
Casts a cone spell.
op | person firing the object. |
caster | object casting the spell. |
dir | direction to fire in. |
spell | spell that is being fired. It uses other_arch for the archetype to fire. |
0 | couldn't cast. |
1 | successful 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().
A spell to make an altar your god's.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
0 | no consecration happened. |
1 | an 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().
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
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
dir | casting direction. |
stringarg | optional parameter specifying what kind of items to create. |
0 | no food created. |
food | was 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().
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...
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
stringarg | optional parameter specifying what kind of items to create. |
0 | no missile created. |
missiles | were 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().
Creates object new_op in direction dir or if that is blocked, beneath the player (op). This is really just a simple wrapper function .
op | who is casting. |
new_op | object to insert. |
dir | direction to insert into. Can be 0 to insert below. |
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().
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) .del becq@ usa. net
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
0 | spell was insuccessful for some reason. |
1 | spell 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, LOG(), map_path_unique(), MAP_PLAYER_UNIQUE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, object::name_pl, NDI_NAVY, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_msg(), 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().
Curse an object, reducing its statistics.
op | who is casting. |
caster | what object is casting. |
spell_ob | spell object to cast. |
dir | cast direction. |
0 | curse had no effect. |
1 | something was cursed. |
Definition at line 800 of file spell_attack.cpp.
References living::ac, add_refcount(), arch_to_object(), change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), object::duration, find_god(), fix_object(), FLAG_APPLIED, FOR_INV_FINISH, FOR_INV_PREPARE, dragon_attune::force, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_pointed_target(), INS_ON_TOP, commongive::inv, object::last_grace, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_SPELL, object::name, NDI_UNIQUE, object_insert_in_map_at(), object_insert_in_ob(), give::op, object::other_arch, object::path_denied, object::path_repelled, PLAYER, object::race, object::range, SET_FLAG, SP_level_duration_adjust(), SPELL_GRACE, object::stats, Ice::tmp, and living::wc.
Referenced by cast_spell().
Hit all monsters around the caster.
op | who is casting. |
caster | what object is casting. |
spell_ob | spell object to cast. |
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().
Detect magic or invisible items.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
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().
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.
op | object throwing. |
throw_ob | what to throw. |
dir | direction to throw into. |
Definition at line 3931 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().
Basically destroys earthwalls in the area.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | op isn't a player. |
1 | op 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().
Heals something.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
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().
Identifies objects in the players inventory/on the ground.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
0 | nothing was identified. |
1 | at 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().
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.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | invisibility was already in action. |
1 | op 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().
This alters player's marked item's cursed or blessed status, based on the spell_ob's fields.
op | player casting the spell. |
spell_ob | spell itself. |
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().
Illuminates something on a map, or try to blind a living thing.
See the spells documentation file for why this is its own function.
op | who is casting. |
caster | what object is casting. |
spell | spell object to cast. |
dir | cast direction. |
0 | no effect. |
1 | lighting 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().
This is really used mostly for spell fumbles and the like.
op | what is casting this. |
tmp | object to propagate. |
lvl | how 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().
Polymorph spell casting.
op | who is casting the spell. |
caster | object used to cast spell. |
spell_ob | spell itself. |
dir | casting direction. 0 won't have any effect. |
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().
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.
op | who is doing the resurrecting. |
caster | what is casting the spell (op or a scroll/rod). |
spell | spell object. |
dir | direction the spell is cast. |
arg | name of the player to revive. |
0 | spell had no effect, or player couldn't revive. |
1 | player 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().
The priest points to a creature and causes a 'godly curse' to descend.
op | who is casting. |
caster | what object is casting. |
dir | cast direction. |
spell | spell object to cast. |
0 | spell had no effect. |
1 | something was affected by the spell. |
Definition at line 546 of file spell_attack.cpp.
References arch_to_object(), AT_DEATH, AT_GODPOWER, AT_HOLYWORD, object::attacktype, caster_level(), object::count, living::dam, determine_god(), draw_ext_info(), draw_ext_info_format(), object::duration, find_god(), FLAG_REFL_SPELL, FLAG_UNDEAD, get_pointed_target(), living::grace, living::hp, HUGE_BUF, object::level, object::map, living::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), object_set_owner(), give::op, object::other_arch, PREFER_LOW, QUERY_FLAG, query_name(), object::race, random_roll(), object::range, set_spell_skill(), SP_EXPLOSION, SP_level_dam_adjust(), SP_level_range_adjust(), SPELL_EFFECT, SPELL_GRACE, SPELL_MANA, object::stats, object::subtype, tailor_god_spell(), object::title, object::type, object::x, and object::y.
Referenced by cast_spell().
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.
op | creature that is owner of the object that is casting the spell - eg, the player or monster. |
caster | actual object (wand, potion) casting the spell. can be same as op. |
dir | direction to cast in. Note in some cases, if the spell is self only, dir really doesn't make a difference. |
spell_ob | spell object that is being cast. From that, we can determine what to do. * |
stringarg | any 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. |
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().
This spell transfers sp from the player to another person. We let the target go above their normal maximum SP.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
0 | no transfer happened. |
1 | transfer 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().
wonder is really just a spell that will likely cast another spell.
op | who is casting. |
caster | what is casting. |
dir | casting direction. |
spell_ob | actual spell object. |
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().
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.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | op isn't a player. |
1 | word 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().
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
caster | person casting the spell. |
spell | spell object. |
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().
int cftimer_create | ( | int | id, |
long | delay, | ||
object * | ob, | ||
int | mode | ||
) |
Creates a new timer.
id | desired timer identifier. |
delay | desired timer delay. |
ob | object that will be linked to this timer. Should have an EVENT_TIMER handler. |
mode | unit for delay, should be TIMER_MODE_SECONDS or TIMER_MODE_CYCLES. See timers.h. |
TIMER_ERR_NONE | timer was successfully created. |
TIMER_ERR_ID | invalid ID. |
TIMER_ERR_MODE | invalid mode. |
TIMER_ERR_OBJ | ob 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().
int cftimer_destroy | ( | int | id | ) |
Destroys an existing timer.
id | identifier of the timer to destroy. |
TIMER_ERR_NONE | no problem encountered. |
TIMER_ERR_ID | unknown 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().
int cftimer_find_free_id | ( | void | ) |
Finds a free ID for a new timer.
TIMER_ERR_ID | no free ID available. |
>=0 | an 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().
void cftimer_init | ( | void | ) |
Initialize timers.
Definition at line 157 of file timers.cpp.
References MAX_TIMERS, and timers_table.
Referenced by init().
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().
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.
op | object to change. Will be removed and replaced. |
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().
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.
who | living to change skill for. |
new_skill | skill to use. If NULL, this just unapplies the current skill. |
flag | has the current meaning:
|
0 | change failure. |
1 | success |
Definition at line 359 of file skill_util.cpp.
References AP_APPLY, AP_NOPRINT, AP_UNAPPLY, apply_special(), PLAYER, range_skill, object::skill, and autojail::who.
Referenced by apply_special(), cast_destruction(), cast_spell(), command_rskill(), do_skill_attack(), and fire_bow().
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().
void check_bullet | ( | object * | op | ) |
Checks to see what op should do, given the space it is on (eg, explode, damage player, etc).
op | object 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().
void check_login | ( | object * | op, |
const char * | password | ||
) |
Actually login a player, load from disk and such.
op | player. |
password | if not NULL, the uncrypted password the user entered. If NULL, no password check is done, coming from the account code which already does authentication. |
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().
int check_name | ( | player * | me, |
const char * | name | ||
) |
Ensure player's name is valid.
me | player to report to. |
name | name to check. |
0 | invalid name. |
1 | valid 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().
bool check_password | ( | const char * | typed, |
const char * | crypted | ||
) |
Hash a password and compare it to the stored version.
typed | Password entered by the user (not hashed). |
crypted | Stored password to check against (hashed). |
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().
Possibly infect due to direct physical contact i.e., AT_PHYSICAL.
victim | potential victim. |
hitter | who is hitting. |
Definition at line 663 of file disease.cpp.
References DISEASE, FOR_INV_FINISH, FOR_INV_PREPARE, death_message::hitter, infect_object(), and sword_of_souls::victim.
Referenced by hit_with_one_attacktype().
int check_pick | ( | object * | op | ) |
Sees if there is stuff to be picked up/picks up stuff, for players only.
op | player to check for. |
1 | player should keep on moving. |
0 | player should stop. |
Definition at line 1717 of file player.cpp.
References draw_ext_info(), draw_ext_info_format(), FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FLAG_UNPAID, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, is_valid_types_gen::found, GEM, m, MAX, MONEY, MOVE_FLYING, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, object_can_pick(), object_matches_pickup_mode(), object_matches_string(), object_was_destroyed, give::op, pick_up(), price_base(), PU_ARMOUR, PU_ARROW, PU_BOOTS, PU_BOW, PU_CLOAK, PU_CONTAINER, PU_CURSED, PU_DEBUG, PU_DRINK, PU_FLESH, PU_FOOD, PU_GLOVES, PU_HELMET, PU_INHIBIT, PU_JEWELS, PU_KEY, PU_MAGIC_DEVICE, PU_MAGICAL, PU_MELEEWEAPON, PU_MISSILEWEAPON, PU_NEWMODE, PU_NOT_CURSED, PU_NOTHING, PU_POTION, PU_RATIO, PU_READABLES, PU_SHIELD, PU_SKILLSCROLL, PU_SPELLBOOK, PU_STOP, PU_VALUABLES, QUERY_FLAG, Settings::search_items, settings, roll-o-matic::stop(), Ice::tmp, and TRUE.
Referenced by move_player(), and stop_jump().
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.
stats | The statistics to modify - this data is modified, so the caller can use it on the next update. |
race | The race to try and apply. It can be NULL, in which case no race will be applied. |
opclass | The class to apply. It can be NULL, in which case no class will be applied. |
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().
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.
spell | force 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().
Checks to see if player knows the spell. If the name is the same as an existing spell, we presume they know it.
op | object we're looking into. |
name | spell name. Doesn't need to be a shared string. |
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().
int checkbanned | ( | const char * | login, |
const char * | host | ||
) |
Check if a player and/or host is banned. Wildcards can be used.
login | player name to check; NULL to check only the host name. |
host | host name to check. |
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().
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().
void cleanup | ( | void | ) |
Clean up everything and exit.
Definition at line 1252 of file server.cpp.
References accounts_save(), clean_tmp_files(), cleanupPlugins(), close_modules(), commands_clear(), free_all_artifacts(), free_all_god(), free_all_maps(), free_all_newserver(), free_all_readable(), free_all_recipes(), free_globals(), free_knowledge(), free_loader(), free_quest(), free_quest_definitions(), free_server(), free_style_maps(), i18n_free(), llevInfo, LOG(), metaserver2_exit(), object_free_all_data(), and write_book_archive().
Referenced by CREMainWindow::closeEvent(), do_shutdown(), init_beforeplay(), make_doors(), parse_args(), server_dump_animations(), and server_dump_faces().
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().
void clear_skill | ( | object * | who | ) |
This function just clears the chosen_skill and range_skill values in the player.
who | living 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().
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().
void command_abil | ( | object * | op, |
const char * | params | ||
) |
Changes an object's statistics.
op | wizard. |
params | parameters, should be "player statistic new_value". |
Definition at line 1819 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().
void command_accountpasswd | ( | object * | op, |
const char * | params | ||
) |
Definition at line 1638 of file c_wiz.cpp.
References account_change_password(), draw_ext_info(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_accuse | ( | object * | op, |
const char * | params | ||
) |
'accuse' command.
op | player. |
params | message. |
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().
void command_addexp | ( | object * | op, |
const char * | params | ||
) |
This adds exp to a player. We now allow adding to a specific skill.
op | wizard. |
params | should be "player quantity [skill]". |
Definition at line 1676 of file c_wiz.cpp.
References buf, calc_perm_exp(), check_exp_adjust(), draw_ext_info(), draw_ext_info_format(), living::exp, FALSE, find_skill_by_name(), first_player, FLAG_WAS_WIZ, MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 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().
void command_afk | ( | object * | op, |
const char * | params | ||
) |
Toggles the afk status of a player. 'afk' command.
op | player to toggle status for. |
params | unused. |
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().
void command_apply | ( | object * | op, |
const char * | params | ||
) |
'apply' command.
op | player. |
params | what 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().
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.
op | player asking for change. |
params | new 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().
void command_archs | ( | object * | op, |
const char * | params | ||
) |
void command_arrest | ( | object * | op, |
const char * | params | ||
) |
Wizard jails player.
op | wizard. |
params | player 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().
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
op | DM banishing. |
params | player to banish. Must be a complete name match. |
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().
void command_beg | ( | object * | op, |
const char * | params | ||
) |
'beg' command.
op | player. |
params | message. |
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().
void command_bleed | ( | object * | op, |
const char * | params | ||
) |
'bleed' command.
op | player. |
params | message. |
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().
void command_blush | ( | object * | op, |
const char * | params | ||
) |
'blush' command.
op | player. |
params | message. |
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().
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.
op | player to display body info for. |
params | unused |
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().
void command_bounce | ( | object * | op, |
const char * | params | ||
) |
'bounce' command.
op | player. |
params | message. |
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().
void command_bow | ( | object * | op, |
const char * | params | ||
) |
'bow' command.
op | player. |
params | message. |
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().
void command_bowmode | ( | object * | op, |
const char * | params | ||
) |
Player wants to change the bowmode, how arrows are fired.
op | player asking for change. |
params | new 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().
void command_brace | ( | object * | op, |
const char * | params | ||
) |
Player toggles her braced status.
op | player. |
params | brace 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().
void command_burp | ( | object * | op, |
const char * | params | ||
) |
'burp' command.
op | player. |
params | message. |
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().
void command_cackle | ( | object * | op, |
const char * | params | ||
) |
'cackle' command.
op | player. |
params | message. |
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().
void command_cast | ( | object * | op, |
const char * | params | ||
) |
'cast' command, prepares a spell for laster casting.
op | player. |
params | spell. |
Definition at line 50 of file c_range.cpp.
References command_cast_spell(), give::op, and roll-o-matic::params.
Referenced by commands_init().
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.
op | caster. |
params | spell name. |
cast_now | 0 to ready the spell, 1 to cast it immediately |
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().
void command_chat | ( | object * | op, |
const char * | params | ||
) |
'chat' command.
op | player. |
params | message. |
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().
void command_chuckle | ( | object * | op, |
const char * | params | ||
) |
'chuckle' command.
op | player. |
params | message. |
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().
void command_clap | ( | object * | op, |
const char * | params | ||
) |
'clap' command.
op | player. |
params | message. |
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().
void command_cointoss | ( | object * | op, |
const char * | params | ||
) |
'cointoss' command.
op | player. |
params | message. |
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().
void command_cough | ( | object * | op, |
const char * | params | ||
) |
'cough' command.
op | player. |
params | message. |
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().
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:
which is much easier to parse than dragon name "big nasty creature" hp 5 sp 30 for example.
op | wizard. |
params | object description. |
Definition at line 999 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().
void command_cringe | ( | object * | op, |
const char * | params | ||
) |
'cringe' command.
op | player. |
params | message. |
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().
void command_cry | ( | object * | op, |
const char * | params | ||
) |
'cry' command.
op | player. |
params | message. |
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().
void command_dance | ( | object * | op, |
const char * | params | ||
) |
'dance' command.
op | player. |
params | message. |
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().
void command_debug | ( | object * | op, |
const char * | params | ||
) |
Player wants to see/change the debug level.
op | player asking for information. |
params | new 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().
void command_delete | ( | object * | op, |
const char * | params | ||
) |
Player wants to totally delete her character.
op | player wanting to delete her character. |
params | unused. |
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().
void command_diff | ( | object * | op, |
const char * | params | ||
) |
Get a diff of specified items. Second item is compared to first, and differences displayed.
Ryo, august 2004
op | wizard. |
params | object specifier. |
Definition at line 2622 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().
void command_disarm | ( | object * | op, |
const char * | params | ||
) |
'disarm' command.
op | player. |
params | unused. |
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().
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
op | player wishing to become wizard. |
params | password. |
Definition at line 2214 of file c_wiz.cpp.
References do_wizard_dm(), give::op, and roll-o-matic::params.
Referenced by commands_init().
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.
op | wizard. |
params | password. |
Definition at line 2519 of file c_wiz.cpp.
References do_wizard_dm(), do_wizard_hide(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_dmtell | ( | object * | op, |
const char * | params | ||
) |
Private communication, by a DM (can't be ignored by player).
op | player trying to tell something to someone. |
params | who 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().
void command_drop | ( | object * | op, |
const char * | params | ||
) |
'drop' command.
op | player. |
params | what 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().
void command_dropall | ( | object * | op, |
const char * | params | ||
) |
Command to drop all items that have not been locked.
op | player. |
params | optional 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().
void command_dump | ( | object * | op, |
const char * | params | ||
) |
Dumps the difference between an object and its archetype.
op | wiard. |
params | object to dump. |
Definition at line 1377 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().
void command_dumpabove | ( | object * | op, |
const char * | params | ||
) |
Player wants to dump object above her.
op | player asking for information. |
params | unused. |
Definition at line 2902 of file c_wiz.cpp.
References do_dump(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_dumpallarchetypes | ( | object * | op, |
const char * | params | ||
) |
Various archetypes-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_dumpallmaps | ( | object * | op, |
const char * | params | ||
) |
Various map-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_dumpallobjects | ( | object * | op, |
const char * | params | ||
) |
Various object-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_dumpbelow | ( | object * | op, |
const char * | params | ||
) |
Player wants to dump object below her.
op | player asking for information. |
params | unused. |
Definition at line 2887 of file c_wiz.cpp.
References do_dump(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_dumpfriendlyobjects | ( | object * | op, |
const char * | params | ||
) |
Various friendly object-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_dumpmap | ( | object * | op, |
const char * | params | ||
) |
Various map-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_east | ( | object * | op, |
const char * | params | ||
) |
'east' command.
op | player. |
params | optional 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().
void command_empty | ( | object * | op, |
const char * | params | ||
) |
'empty' command.
op | player. |
params | item 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().
void command_examine | ( | object * | op, |
const char * | params | ||
) |
'examine' command.
op | player. |
params | optional 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().
void command_execute | ( | object * | pl, |
char * | command | ||
) |
Handle a player-issued command.
pl | player who is issuing the command |
command | the actual command with its arguments. Will be modified in-place. |
Definition at line 456 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().
void command_face | ( | object * | op, |
const char * | params | ||
) |
Player wants to face a given direction.
op | player. |
params | additional 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().
void command_fire | ( | object * | op, |
const char * | params | ||
) |
Player wants to start furing.
op | player. |
params | additional 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().
void command_fire_stop | ( | object * | op, |
const char * | params | ||
) |
Player wants to stop firing.
op | player. |
params | ignored. |
Definition at line 98 of file c_new.cpp.
References give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_fix_me | ( | object * | op, |
const char * | params | ||
) |
Wrapper to fix a player.
op | player asking to be fixed. |
params | unused. |
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().
void command_flip | ( | object * | op, |
const char * | params | ||
) |
'flip' command.
op | player. |
params | message. |
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().
void command_follow | ( | object * | op, |
const char * | params | ||
) |
Follow a player, or stop following a player.
op | Player follower |
params | player to follow. If NULL, stop following player. |
Definition at line 2809 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().
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.
op | player |
params | spell name to forget. |
Definition at line 2415 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().
void command_free | ( | object * | op, |
const char * | params | ||
) |
Totally free an object.
op | wizard. |
params | object to free. |
Definition at line 1612 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().
void command_freeze | ( | object * | op, |
const char * | params | ||
) |
Freezes a player for a specified tick count, 100 by default.
op | wizard freezing the player. |
params | optional tick count, followed by player name. |
Definition at line 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().
void command_frown | ( | object * | op, |
const char * | params | ||
) |
'frown' command.
op | player. |
params | message. |
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().
void command_gasp | ( | object * | op, |
const char * | params | ||
) |
'gasp' command.
op | player. |
params | message. |
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().
void command_giggle | ( | object * | op, |
const char * | params | ||
) |
'giggle' command.
op | player. |
params | message. |
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().
void command_glare | ( | object * | op, |
const char * | params | ||
) |
'glare' command.
op | player. |
params | message. |
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().
void command_goto | ( | object * | op, |
const char * | params | ||
) |
Wizard teleports to a map.
op | wizard teleporting. |
params | map 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().
void command_grin | ( | object * | op, |
const char * | params | ||
) |
'grin' command.
op | player. |
params | message. |
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().
void command_groan | ( | object * | op, |
const char * | params | ||
) |
'groan' command.
op | player. |
params | message. |
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().
void command_growl | ( | object * | op, |
const char * | params | ||
) |
'growl' command.
op | player. |
params | message. |
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().
void command_gsay | ( | object * | op, |
const char * | params | ||
) |
'gsay' command, talks to party.
op | player. |
params | message. |
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().
void command_help | ( | object * | op, |
const char * | params | ||
) |
Player is asking for some help.
op | player asking for information. |
params | what 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().
void command_hiccup | ( | object * | op, |
const char * | params | ||
) |
'hiccup' command.
op | player. |
params | message. |
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().
void command_hide | ( | object * | op, |
const char * | params | ||
) |
Wizard 'hide' command.
op | DM wanting to hide. |
params | ignored. |
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().
void command_hiscore | ( | object * | op, |
const char * | params | ||
) |
Player is asking for the hiscore.
op | player asking for information. |
params | options 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().
void command_hug | ( | object * | op, |
const char * | params | ||
) |
'hug' command.
op | player. |
params | message. |
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().
void command_insert_into | ( | object * | op, |
const char * | params | ||
) |
Puts an object into another.
op | wizard. |
params | object specifier. |
Definition at line 2686 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().
void command_inventory | ( | object * | op, |
const char * | params | ||
) |
Shows the inventory or some item.
op | player. |
params | object count to get the inventory of. If NULL then defaults to op. |
Definition at line 1335 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().
void command_invisible | ( | object * | op, |
const char * | params | ||
) |
Wizard wants to become invisible.
op | wizard. |
params | ignored. |
Definition at line 2226 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().
void command_invoke | ( | object * | op, |
const char * | params | ||
) |
'invoke' command, fires a spell immediately.
op | player. |
params | spell. |
Definition at line 38 of file c_range.cpp.
References command_cast_spell(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_kick | ( | object * | op, |
const char * | params | ||
) |
Kicks a player from the server.
op | DM kicking. |
params | player to kick. Must be a full name match. |
Definition at line 556 of file c_wiz.cpp.
References command_kick2(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_kill_pets | ( | object * | op, |
const char * | params | ||
) |
Player wants to get rid of pets.
op | player. |
params | unused. |
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().
void command_kiss | ( | object * | op, |
const char * | params | ||
) |
'kiss' command.
op | player. |
params | message. |
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().
void command_knowledge | ( | object * | pl, |
const char * | params | ||
) |
Handle the 'knowledge' for a player.
pl | who is using the command. |
params | additional 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().
void command_language | ( | object * | op, |
const char * | params | ||
) |
This is the 'language' command.
op | player requesting the information. |
params | optional 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().
void command_laugh | ( | object * | op, |
const char * | params | ||
) |
'laugh' command.
op | player. |
params | message. |
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().
void command_learn_special_prayer | ( | object * | op, |
const char * | params | ||
) |
Wizard wants to learn a god-given spell.
op | wizard. |
params | spell name. |
Definition at line 2402 of file c_wiz.cpp.
References command_learn_spell_or_prayer(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_learn_spell | ( | object * | op, |
const char * | params | ||
) |
Wizard wants to learn a regular spell.
op | wizard. |
params | spell name. |
Definition at line 2390 of file c_wiz.cpp.
References command_learn_spell_or_prayer(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_lick | ( | object * | op, |
const char * | params | ||
) |
'lick' command.
op | player. |
params | message. |
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().
void command_list | ( | object * | pl, |
bool | is_dm | ||
) |
Display the list of commands to a player.
pl | player asking for commands. |
is_dm | true if the player is a DM, false else. |
Definition at line 390 of file commands.cpp.
References COMMAND_TYPE_COMMUNICATION, COMMAND_TYPE_NORMAL, COMMAND_TYPE_WIZARD, draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, altar_valkyrie::pl, and show_commands().
Referenced by command_help().
void command_listen | ( | object * | op, |
const char * | params | ||
) |
Change the player's listen level.
op | player asking for information. |
params | unused. |
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().
void command_listplugins | ( | object * | op, |
const char * | params | ||
) |
Lists all plugins currently loaded with their IDs and full names.
op | wizard. |
params | ignored. |
Definition at line 2443 of file c_wiz.cpp.
References give::op, roll-o-matic::params, plugins_display_list(), and nlohmann::detail::void().
Referenced by commands_init().
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.
op | DM loading a plugin. |
params | should be the plugin's name, eg cfpython.so |
Definition at line 2458 of file c_wiz.cpp.
References buf, draw_ext_info(), draw_ext_info_format(), llevDebug, llevInfo, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, and plugins_init_plugin().
Referenced by commands_init().
void command_loadtest | ( | object * | op, |
const char * | params | ||
) |
This command will stress server.
It will basically load all world maps (so 900 maps).
op | DM wanting to test the server. |
params | option, must be "TRUE" for the test to happen. |
Definition at line 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().
void command_lock_item | ( | object * | op, |
const char * | params | ||
) |
Alternate way to lock/unlock items (command line).
op | player |
params | sent 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().
void command_malloc | ( | object * | op, |
const char * | params | ||
) |
Display memory information.
op | player requesting information. |
params | unused. |
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().
void command_mapinfo | ( | object * | op, |
const char * | params | ||
) |
'mapinfo' command.
op | player requesting the information. |
params | unused. |
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().
void command_maps | ( | object * | op, |
const char * | params | ||
) |
'maps' command.
op | player requesting the information. |
params | region 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().
void command_mark | ( | object * | op, |
const char * | params | ||
) |
'mark' command, to mark an item for some effects (enchant armor, ...).
op | player. |
params | If 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().
void command_me | ( | object * | op, |
const char * | params | ||
) |
'me' command.
op | player. |
params | message. |
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().
void command_mon_aggr | ( | object * | op, |
const char * | params | ||
) |
When DM is possessing a monster, flip aggression on and off, to allow better motion.
op | wiard. |
params | ignored. |
Definition at line 1405 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().
void command_motd | ( | object * | op, |
const char * | params | ||
) |
Display the message of the day.
op | player requesting the motd. |
params | unused. |
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().
void command_news | ( | object * | op, |
const char * | params | ||
) |
Display the server news.
op | player requesting the news. |
params | unused. |
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().
void command_nod | ( | object * | op, |
const char * | params | ||
) |
'nod' command.
op | player. |
params | message. |
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().
void command_north | ( | object * | op, |
const char * | params | ||
) |
'north' command.
op | player. |
params | optional 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().
void command_northeast | ( | object * | op, |
const char * | params | ||
) |
'northeast' command.
op | player. |
params | optional 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().
void command_northwest | ( | object * | op, |
const char * | params | ||
) |
'northwest' command.
op | player. |
params | optional 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().
void command_nowiz | ( | object * | op, |
const char * | params | ||
) |
Steps down from wizard mode.
op | wizard. |
params | ignored. |
Definition at line 2080 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().
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.
op | player who plays. |
params | string sent by the player. Ignored. |
Definition at line 108 of file c_chat.cpp.
Referenced by commands_init().
void command_overlay_reset | ( | object * | op, |
const char * | params | ||
) |
Removes the overlay for op's current map.
op | DM acting. |
params | ignored. |
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().
void command_overlay_save | ( | object * | op, |
const char * | params | ||
) |
Saves the op's map as an overlay - objects are persisted.
op | DM wanting to save. |
params | ignored. |
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().
void command_party | ( | object * | op, |
const char * | params | ||
) |
'party' command, subdivided in different sub commands.
op | player. |
params | additional parameters. 1. |
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().
void command_party_rejoin | ( | object * | op, |
const char * | params | ||
) |
Handles the 'party_rejoin' command.
op | player. |
params | optional 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().
void command_passwd | ( | object * | pl, |
const char * | params | ||
) |
Player is asking to change password.
pl | player. |
params | unused. |
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().
void command_patch | ( | object * | op, |
const char * | params | ||
) |
Wizard wants to altar an object.
op | wizard. |
params | object and what to patch. |
Definition at line 1493 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().
void command_peaceful | ( | object * | op, |
const char * | params | ||
) |
Player toggles her peaceful status.
op | player. |
params | unused. |
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().
void command_petmode | ( | object * | op, |
const char * | params | ||
) |
Player wants to change how her pets behave.
op | player asking for change. |
params | new 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().
void command_pickup | ( | object * | op, |
const char * | params | ||
) |
'pickup' command.
op | player. |
params | pickup mode. Can be empty to display the current mode. |
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().
void command_players | ( | object * | op, |
const char * | params | ||
) |
Display all known players.
op | player asking for information. |
params | unused. |
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().
void command_poke | ( | object * | op, |
const char * | params | ||
) |
'poke' command.
op | player. |
params | message. |
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().
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,
op | wizard wanting to possess something. |
params | monster to possess. |
Definition at line 1432 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 sword_of_souls::victim.
void command_pout | ( | object * | op, |
const char * | params | ||
) |
'pout' command.
op | player. |
params | message. |
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().
void command_printlos | ( | object * | op, |
const char * | params | ||
) |
Various LOS-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_puke | ( | object * | op, |
const char * | params | ||
) |
'puke' command.
op | player. |
params | message. |
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().
void command_purge_quest | ( | object * | op, |
const char * | param | ||
) |
Definition at line 2853 of file c_wiz.cpp.
References draw_ext_info(), free_quest(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_UNIQUE, give::op, and nlohmann::detail::void().
Referenced by commands_init().
void command_purge_quest_definitions | ( | object * | op, |
const char * | param | ||
) |
Definition at line 2859 of file c_wiz.cpp.
References assets_collect(), ASSETS_QUESTS, Settings::datadir, draw_ext_info(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_UNIQUE, give::op, settings, and nlohmann::detail::void().
Referenced by commands_init().
void command_quest | ( | object * | op, |
const char * | params | ||
) |
Command handler for 'quest'.
op | player asking for information, warning emitted if not a player. |
params | extra 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, dragon::state, and autojail::who.
Referenced by commands_init().
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().
void command_recollect | ( | object * | op, |
const char * | params | ||
) |
Definition at line 1531 of file c_wiz.cpp.
References Socket_Info::allocated_sockets, assets_finish_archetypes_for_play(), first_player, load_assets(), give::next, give::op, roll-o-matic::params, altar_valkyrie::pl, reset_faces_sent(), socket_info, and nlohmann::detail::void().
Referenced by commands_init().
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.
name | command name. |
type | type of the command, one of COMMAND_TYPE_xxx. |
func | function to call for the command. |
time | how long the command takes. |
Definition at line 102 of file commands.cpp.
References do_register(), give::name, and is_valid_types_gen::type.
Referenced by cfapi_register_command().
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.
name | command name. |
extra | extra data to give the command, must not be null. |
type | type of the command, one of COMMAND_TYPE_xxx. |
func | function to call for the command. |
time | how long the command takes. |
Definition at line 526 of file commands.cpp.
References do_register(), give::name, and is_valid_types_gen::type.
Referenced by cfapi_register_command().
void command_remove | ( | object * | op, |
const char * | params | ||
) |
Remove an object from its position.
op | wizard. |
params | object to remove. |
Definition at line 1565 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().
void command_rename_item | ( | object * | op, |
const char * | params | ||
) |
Changing the custom name of an item
Syntax is: rename <what object> to <new name>
Names are considered for all purpose having a length <=127 (max length sent to client by server).
op | player. |
params | how 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().
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.
op | who is telling. |
params | message to say. |
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().
void command_reset | ( | object * | op, |
const char * | params | ||
) |
Resets a map.
op | wizard. |
params | map to reset. Can be "." for current op's map, or a map path. |
Definition at line 1885 of file c_wiz.cpp.
References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, first_player, flush_old_maps(), FREE_AND_CLEAR_STR_IF, FREE_OBJ_NO_DESTROY_CALLBACK, has_been_loaded(), HUGE_BUF, llevDebug, llevError, LOG(), m, object::map, MAP_IN_MEMORY, map_remove_unique_files(), MAP_SWAPPED, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_RED, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_new(), object_remove(), give::op, roll-o-matic::params, python_init::path, path_combine_and_normalize(), altar_valkyrie::pl, castle_read::playercount, altar_valkyrie::res, SAVE_ERROR_PLAYER, SAVE_ERROR_UCREATION, sstring, strlcpy(), swap_map(), and Ice::tmp.
Referenced by commands_init().
void command_resistances | ( | object * | op, |
const char * | params | ||
) |
Players wants to know her resistances.
op | player asking for information. |
params | unused. |
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().
void command_rotateshoottype | ( | object * | op, |
const char * | params | ||
) |
'rotateshoottype' command, switch range attack.
op | player. |
params | arguments 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().
void command_rskill | ( | object * | pl, |
const char * | params | ||
) |
'ready_skill' command.
pl | player. |
params | skill 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().
void command_rules | ( | object * | op, |
const char * | params | ||
) |
Display the server rules.
op | player requesting the rules. |
params | unused. |
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().
void command_run | ( | object * | op, |
const char * | params | ||
) |
Player wants to start running.
op | player. |
params | additional 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().
void command_run_stop | ( | object * | op, |
const char * | params | ||
) |
Player wants to stop running.
op | player. |
params | ignored. |
Definition at line 64 of file c_new.cpp.
References give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_save | ( | object * | op, |
const char * | params | ||
) |
Player wants to get saved.
op | player. |
params | unused. |
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().
void command_say | ( | object * | op, |
const char * | params | ||
) |
'say' command.
op | player. |
params | message. |
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().
void command_scream | ( | object * | op, |
const char * | params | ||
) |
'scream' command.
op | player. |
params | message. |
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().
void command_search | ( | object * | op, |
const char * | params | ||
) |
'search' command.
op | player. |
params | unused. |
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().
void command_search_items | ( | object * | op, |
const char * | params | ||
) |
'search-items' command.
op | player. |
params | options. |
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().
void command_setgod | ( | object * | op, |
const char * | params | ||
) |
Sets the god for some objects.
op | DM wanting to change an object. |
params | command options. Should contain two values, first the object to change, followed by the god to change it to. |
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().
void command_settings | ( | object * | op, |
const char * | ignored | ||
) |
Wizard wants to know some server settings, so display.
op | wizard asking for settings. |
ignored | ignored additional text. |
Definition at line 2914 of file c_wiz.cpp.
References Settings::allow_denied_spells_writing, Settings::casting_time, Settings::create_home_portals, Settings::death_penalty_level, Settings::death_penalty_ratio, draw_ext_info(), draw_ext_info_format(), Settings::item_power_factor, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_UNIQUE, Settings::no_player_stealing, Settings::not_permadeth, give::op, Settings::permanent_exp_ratio, Settings::resurrection, Settings::set_friendly_fire, Settings::set_title, settings, Settings::spell_encumbrance, Settings::spell_failure_effects, and nlohmann::detail::void().
Referenced by commands_init().
void command_shake | ( | object * | op, |
const char * | params | ||
) |
'shake' command.
op | player. |
params | message. |
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().
void command_shiver | ( | object * | op, |
const char * | params | ||
) |
'shiver' command.
op | player. |
params | message. |
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().
void command_shout | ( | object * | op, |
const char * | params | ||
) |
'shout' command.
op | player. |
params | message. |
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().
void command_showpets | ( | object * | op, |
const char * | params | ||
) |
Players wants to know her pets.
op | player asking for information. |
params | unused. |
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().
void command_shrug | ( | object * | op, |
const char * | params | ||
) |
'shrug' command.
op | player. |
params | message. |
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().
void command_shutdown | ( | object * | op, |
const char * | params | ||
) |
Totally shutdowns the server.
op | wizard shutting down the server. |
params | When 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().
void command_sigh | ( | object * | op, |
const char * | params | ||
) |
'sigh' command.
op | player. |
params | message. |
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().
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.
op | player. |
params | optional skill restriction. |
Definition at line 1365 of file c_wiz.cpp.
References give::op, roll-o-matic::params, and show_skills().
Referenced by commands_init().
void command_slap | ( | object * | op, |
const char * | params | ||
) |
'slap' command.
op | player. |
params | message. |
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().
void command_smile | ( | object * | op, |
const char * | params | ||
) |
'smile' command.
op | player. |
params | message. |
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().
void command_smirk | ( | object * | op, |
const char * | params | ||
) |
'smirk' command.
op | player. |
params | message. |
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().
void command_snap | ( | object * | op, |
const char * | params | ||
) |
'snap' command.
op | player. |
params | message. |
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().
void command_sneeze | ( | object * | op, |
const char * | params | ||
) |
'sneeze' command.
op | player. |
params | message. |
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().
void command_snicker | ( | object * | op, |
const char * | params | ||
) |
'snicker' command.
op | player. |
params | message. |
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().
void command_sniff | ( | object * | op, |
const char * | params | ||
) |
'sniff' command.
op | player. |
params | message. |
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().
void command_snore | ( | object * | op, |
const char * | params | ||
) |
'snore' command.
op | player. |
params | message. |
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().
void command_sound | ( | object * | op, |
const char * | params | ||
) |
Player wants to change sound status.
op | player asking for change. |
params | unused. |
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().
void command_south | ( | object * | op, |
const char * | params | ||
) |
'south' command.
op | player. |
params | optional 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().
void command_southeast | ( | object * | op, |
const char * | params | ||
) |
'southeast' command.
op | player. |
params | optional 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().
void command_southwest | ( | object * | op, |
const char * | params | ||
) |
'southwest' command.
op | player. |
params | optional 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().
void command_speed | ( | object * | op, |
const char * | params | ||
) |
Changes the server speed.
op | wizard. |
params | new speed, or NULL to see the speed. |
Definition at line 1732 of file c_wiz.cpp.
References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, give::op, roll-o-matic::params, reset_sleep(), set_tick_duration(), and tick_duration.
Referenced by commands_init().
void command_spit | ( | object * | op, |
const char * | params | ||
) |
'spit' command.
op | player. |
params | message. |
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().
void command_ssdumptable | ( | object * | op, |
const char * | params | ||
) |
Various string-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_stack_clear | ( | object * | op, |
const char * | params | ||
) |
Empty DM item stack.
op | wizard. |
params | ignored. |
Definition at line 2596 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().
void command_stack_list | ( | object * | op, |
const char * | params | ||
) |
Displays stack contents.
op | wizard. |
params | ignored. |
Definition at line 2565 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().
void command_stack_pop | ( | object * | op, |
const char * | params | ||
) |
Pop the stack top.
op | wizard. |
params | ignored. |
Definition at line 2534 of file c_wiz.cpp.
References dm_stack_pop(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_stack_push | ( | object * | op, |
const char * | params | ||
) |
Push specified item on stack.
op | wizard. |
params | object specifier. |
Definition at line 2547 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().
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.
pl | player asking for information. |
params | unused. |
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().
void command_stats | ( | object * | op, |
const char * | params | ||
) |
Displays the statistics of a player.
op | wizard. |
params | player's name. |
Definition at line 1762 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().
void command_stay | ( | object * | op, |
const char * | params | ||
) |
'stay' command. Used to specify to fire under oneself.
op | player. |
params | optional 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().
void command_strings | ( | object * | op, |
const char * | params | ||
) |
Various string-related statistics.
op | player asking for information. |
params | unused. |
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().
void command_strut | ( | object * | op, |
const char * | params | ||
) |
'strut' command.
op | player. |
params | message. |
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().
void command_style_map_info | ( | object * | op, |
const char * | params | ||
) |
Displays information about styles loaded for random maps.
op | wizard. |
params | ignored. |
Definition at line 2763 of file c_wiz.cpp.
References draw_ext_info(), draw_ext_info_format(), FOR_MAP_FINISH, FOR_MAP_PREPARE, MAP_HEIGHT, map_size(), MAP_WIDTH, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapstruct::next, give::op, roll-o-matic::params, styles, Ice::tmp, nlohmann::detail::void(), diamondslots::x, and diamondslots::y.
Referenced by commands_init().
void command_sulk | ( | object * | op, |
const char * | params | ||
) |
'sulk' command.
op | player. |
params | message. |
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().
void command_summon | ( | object * | op, |
const char * | params | ||
) |
Summons player near DM.
op | DM. |
params | player 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().
void command_swap | ( | object * | op, |
const char * | params | ||
) |
Mark a map as ready for swapping.
Definition at line 907 of file c_wiz.cpp.
References draw_ext_info(), has_been_loaded(), HUGE_BUF, m, MAP_IN_MEMORY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, give::op, roll-o-matic::params, python_init::path, and path_combine_and_normalize().
Referenced by commands_init().
void command_take | ( | object * | op, |
const char * | params | ||
) |
This takes (picks up) an item.
op | player who issued the command. |
params | string 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().
void command_teleport | ( | object * | op, |
const char * | params | ||
) |
Teleport next to target player.
op | DM teleporting. |
params | options sent by player. |
Definition at line 933 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().
void command_tell | ( | object * | op, |
const char * | params | ||
) |
Private communication.
op | player trying to tell something to someone. |
params | who 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().
void command_thank | ( | object * | op, |
const char * | params | ||
) |
'thank' command.
op | player. |
params | message. |
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().
void command_think | ( | object * | op, |
const char * | params | ||
) |
'think' command.
op | player. |
params | message. |
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().
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.
op | player. |
params | what 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().
void command_time | ( | object * | op, |
const char * | params | ||
) |
Players asks for the time.
op | player asking for information. |
params | unused. |
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().
void command_title | ( | object * | op, |
const char * | params | ||
) |
Player wishes to change her title.
op | player asking for change. |
params | new title. |
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().
void command_toggle_shout | ( | object * | op, |
const char * | params | ||
) |
A simple toggle for the no_shout field. AKA the MUZZLE command.
op | wizard toggling. |
params | player to mute/unmute. |
Definition at line 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().
void command_twiddle | ( | object * | op, |
const char * | params | ||
) |
'twiddle' command.
op | player. |
params | message. |
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().
void command_unarmed_skill | ( | object * | op, |
const char * | params | ||
) |
Player wants to change prefered unarmed skill
op | player asking for change. |
params | new 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().
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.
op | DM unloading a plugin. |
params | should be the plugin's internal name, eg Python |
Definition at line 2490 of file c_wiz.cpp.
References draw_ext_info(), draw_ext_info_format(), init_signals(), llevInfo, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, give::op, roll-o-matic::params, and plugins_remove_plugin().
Referenced by commands_init().
void command_unregister | ( | command_registration | command | ) |
Unregister a previously registered command.
command | identifier returned by command_register() or command_register_extra(). |
Definition at line 535 of file commands.cpp.
References devourers::command, and registered_commands.
Referenced by cfapi_unregister_command().
void command_use | ( | object * | op, |
const char * | params | ||
) |
Try to use an item on another. Items are checked for key/values matching.
op | player. |
params | sent string, with all parameters. |
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().
void command_usekeys | ( | object * | op, |
const char * | params | ||
) |
Player wants to change how keys are used.
op | player asking for information. |
params | unused. |
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().
void command_uskill | ( | object * | pl, |
const char * | params | ||
) |
'use_skill' command.
pl | player. |
params | skill 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().
void command_version | ( | object * | op, |
const char * | params | ||
) |
Server version.
op | player asking for information. |
params | unused. |
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().
void command_wave | ( | object * | op, |
const char * | params | ||
) |
'wave' command.
op | player. |
params | message. |
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().
void command_west | ( | object * | op, |
const char * | params | ||
) |
'west' command.
op | player. |
params | optional 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().
void command_whereabouts | ( | object * | op, |
const char * | params | ||
) |
'whereabouts' command.
Displays how many players are in which regions.
op | player requesting information. |
params | unused. |
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().
void command_whereami | ( | object * | op, |
const char * | params | ||
) |
'whereami' command.
op | player requesting the information. |
params | unused. |
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().
void command_whistle | ( | object * | op, |
const char * | params | ||
) |
'whistle' command.
op | player. |
params | message. |
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().
void command_who | ( | object * | op, |
const char * | params | ||
) |
'who' command.
op | player requesting the information. |
params | optional 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().
void command_wimpy | ( | object * | op, |
const char * | params | ||
) |
Player wants to change how soon she'll flee.
op | player. |
params | new 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().
void command_wink | ( | object * | op, |
const char * | params | ||
) |
'wink' command.
op | player. |
params | message. |
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().
void command_wizcast | ( | object * | op, |
const char * | params | ||
) |
Wizard toggling "cast everywhere" ability.
op | player asking for information. |
params | unused. |
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().
void command_wizpass | ( | object * | op, |
const char * | params | ||
) |
Wizard toggling wall-crossing.
op | player asking for information. |
params | unused. |
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().
void command_yawn | ( | object * | op, |
const char * | params | ||
) |
'yawn' command.
op | player. |
params | message. |
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().
void commands_clear | ( | ) |
Clear all registered commands.
Definition at line 346 of file commands.cpp.
References next_registration, and registered_commands.
Referenced by cleanup().
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_swap(), command_take(), command_teleport(), command_tell(), command_thank(), command_think(), command_throw(), command_time(), command_title(), command_toggle_shout(), command_twiddle(), command_unarmed_skill(), command_unloadplugin(), command_use(), command_usekeys(), command_uskill(), command_version(), command_wave(), command_west(), command_whereabouts(), command_whereami(), command_whistle(), command_who(), command_wimpy(), command_wink(), command_wizcast(), command_wizpass(), command_yawn(), RC, RN, and RW.
Referenced by init().
void cone_drop | ( | object * | op | ) |
Drops an object based on what is in the cone's "other_arch".
op | what 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().
void confirm_password | ( | object * | op | ) |
Ask the player to confirm her password during creation.
op | player. |
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().
Confuse a living thing.
op | victim. |
hitter | who is attacking, unused. |
dam | damage to deal, unused. |
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().
void counterspell | ( | object * | op, |
int | dir | ||
) |
Nullifies spell effects. Basically, if the object has a magic attacktype, this may nullify it.
op | counterspell object. |
dir | direction 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().
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.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
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().
Create a bomb.
op | who is casting. |
caster | what object is casting. |
dir | cast direction. |
spell | spell object to cast. |
0 | no bomb was placed. |
1 | bomb 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().
Do the cure disease stuff, from the spell "cure disease".
sufferer | who is getting cured. |
caster | spell object used for curing. If NULL all diseases are removed, else only those of lower level than caster or randomly chosen. |
skill | skill to give experience to, can be NULL. |
0 | no disease was cured. |
1 | at 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().
void dead_player | ( | object * | op | ) |
Kill a player on a permanent death server with resurrection.
op | player 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().
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.
name | player 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().
void destroy_object | ( | object * | op | ) |
Recursively object_free_drop_inventory() op and its inventory.
op | object to totally object_free_drop_inventory(). |
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().
Runs a 'detect curse' check on a given item
pl | player detecting a curse. |
tmp | object to check for curse |
skill | detect skill object. |
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().
Runs a 'detect magic' check on a given item
pl | player detecting magic. |
tmp | object to check for magic |
skill | detect skill object. |
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().
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.
op | object to get name of. |
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().
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.
god | god for which we want something. |
type | what the summon type is. Must be a shared string. |
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().
Teleport through some doors and space.
op | who is casting. |
caster | what is casting. |
spob | actual spell object. |
dir | casting direction. |
0 | spell failure. |
1 | spell 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().
Someone is trying to disarm a rune. The actual attempt is done in trap_disarm().
op | object trying to disarm. |
skill | skill to disarm runes. |
dir | direction to disarm. |
0 | rune wasn't disarmed. |
1 | a 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().
void display_motd | ( | const object * | op | ) |
Sends the message of the day to the player.
op | player 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().
Definition at line 2865 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().
void do_forget_spell | ( | object * | op, |
const char * | spell | ||
) |
Erases spell from player's inventory. Will inform player of loss.
op | player. |
spell | spell 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().
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().
Player is trying to harvest something.
pl | player trying to harvest. |
dir | direction. |
skill | skill 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().
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.
op | object moving. |
Definition at line 4037 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().
Actually makes op learn spell. Informs player of new spell and binding.
op | player who'll learn the spell. |
spell | spell to learn. |
special_prayer | 1 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().
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.
op | The object actually using the skill |
part | actual part using the skill, used by throwing for monsters |
skill | The skill used by op |
dir | The direction in which the skill is used |
string | A parameter string, necessary to use some skills |
0 | skill failure. |
1 | use 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().
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.
op | player to regenerate for. |
Definition at line 3276 of file player.cpp.
References give::op, and ST_PLAYING.
Referenced by command_possess(), monsterFight(), and process_players1().
void dragon_ability_gain | ( | object * | who, |
int | atnr, | ||
int | level | ||
) |
When a dragon-player gains a new stage of evolution, he gets some treasure.
who | the dragon player. |
atnr | the attack-number of the ability focus. |
level | ability level. |
Definition at line 365 of file main.cpp.
References animate_object(), arch_to_object(), AT_PHYSICAL, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_POISON, object::attacktype, buf, check_spell_known(), archetype::clone, do_learn_spell(), draw_ext_info(), draw_ext_info_format(), esrv_send_item(), object::face, find_skill_by_name(), find_treasurelist(), FLAG_SEE_IN_DARK, FLAG_STEALTH, FLAG_XRAYS, FORCE, HUGE_BUF, treasure::item, say::item, treasurelist::items, llevDebug, LOG(), treasure::magic, MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_RACE, MSG_TYPE_ITEM, MSG_TYPE_ITEM_ADD, give::name, NDI_BLUE, NDI_UNIQUE, treasure::next, NRSPELLPATHS, guildjoin::ob, object_find_by_arch_name(), object_insert_in_ob(), object::path_attuned, PLAYER, QUERY_FLAG, query_short_name(), SET_FLAG, SK_CLAWING, SKILL_TOOL, SPELL, SPELLBOOK, spellpathnames, Ice::tmp, nlohmann::detail::void(), autojail::who, diamondslots::x, and diamondslots::y.
Referenced by dragon_level_gain().
void drain_rod_charge | ( | object * | rod | ) |
Drain charges from a rod.
rod | rod 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().
void drain_wand_charge | ( | object * | wand | ) |
Drains a charge from a wand. Handles animation fix, and player update if required.
wand | wand 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().
Drop an item, either on the floor or in a container.
op | who is dropping an item. |
tmp | what 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().
Try to drop an object on the floor.
This function was part of drop, now is own function.
op | who is dropping the item. |
tmp | item to drop. |
nrof | if is non zero, then nrof objects is tried to be dropped. |
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().
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().
void dump_races | ( | void | ) |
Dumps all race information to stderr.
Definition at line 83 of file races.cpp.
Referenced by init_beforeplay().
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().
void emergency_save | ( | int | flag | ) |
Save all players.
flag | if 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().
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.
op | character or monster that is using the exit. |
exit_ob | exit object (boat, door, teleporter, etc.) |
Definition at line 727 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, LOG(), object::map, MAP_ENTER_X, MAP_ENTER_Y, map_path_unique(), MAP_PLAYER_UNIQUE, MAX_BUF, object::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, object::name, NDI_UNIQUE, ob_apply(), ob_describe(), object_copy(), object_find_by_type_and_slaying(), object_free(), object_new(), object_remove(), object_update_speed(), give::op, mapstruct::path, path_combine_and_normalize(), PLAYER, PORTAL_DESTINATION_NAME, QUERY_FLAG, ready_map_name(), save_player(), 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().
void enter_player_maplevel | ( | object * | op | ) |
Move a player to its stored map level. This function is used to place the player just after logging in. Since the map may no longer exist, dump the player to an alternative 'emergency' location if that's the case.
Definition at line 682 of file server.cpp.
References 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().
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.
op | player. |
Definition at line 142 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().
Player examines some object. The item may be identified automatically if the player has the correct skill for that.
op | player. |
tmp | object to examine. |
Definition at line 1985 of file c_object.cpp.
References body_locations, BOOK, buf, CLOSE_CON, CONTAINER, cost_approx_str(), cost_str(), CUSTOM_NAME_FIELD, draw_ext_info(), draw_ext_info_format(), EX_ID_ABORT, EX_ID_FAILED, EX_ID_NO_SKILL, examine_autoidentify(), examine_fluff(), examine_monster(), examine_rod_charge_level(), examine_wand_charge_level(), examine_weight_and_material(), FLAG_IS_BUILDABLE, FLAG_IS_LINKED, FLAG_MONSTER, FLAG_NO_PICK, FLAG_STARTEQUIP, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, FORCE, get_button_value(), is_identified(), knowledge_item_can_be_used_alchemy(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, NDI_UNIQUE, body_locations_struct::nonuse_name, NUM_BODY_LOCATIONS, ob_describe(), object_get_value(), give::op, castle_read::prefix, QUERY_FLAG, ROD, shop_contains(), shop_price_buy(), shop_price_sell(), sstring, Ice::tmp, body_locations_struct::use_name, autojail::value, VERY_BIG_BUF, and WAND.
Referenced by command_examine(), examine_cmd(), and knowledge_alchemy_attempt().
Player examine a monster.
op | player. |
tmp | monster being examined. |
level | level 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().
void explode_bullet | ( | object * | op | ) |
Causes an object to explode, eg, a firebullet, poison cloud ball, etc.
op | the 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().
int face_player | ( | object * | op, |
int | dir | ||
) |
Face player in the given direction.
op | player. |
dir | direction to face |
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().
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 1928 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().
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.
pl | player. |
container | inventory to searched for keys. |
door | door we are trying to match against. |
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().
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.
op | object. Should be a player. |
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().
player* find_player | ( | const char * | plname | ) |
Find a player by her full name.
plname | name to find. |
Definition at line 59 of file player.cpp.
References find_player_options().
Referenced by command_reply(), and list_players().
Find a player.
plname | name of the player to search for. Can be partial. |
options | combination of FIND_PLAYER_xxx flags. |
map | optional map the player must be on (adjacent maps are ok too). |
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().
player* find_player_partial_name | ( | const char * | plname | ) |
Find a player by a partial name.
plname | name to match. |
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().
player* find_player_socket | ( | const socket_struct * | ns | ) |
Return a player for a socket structure.
ns | socket to search for. |
Definition at line 123 of file player.cpp.
References first_player, and altar_valkyrie::pl.
Referenced by add_me_cmd(), and set_up_cmd().
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.
ob | object to find spells in. |
skill | skill the spell should match, NULL if can match any spell. |
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().
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.
who | Player to get skill. |
name | skill 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. |
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().
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.
who | player applying a skill. |
skillno | skill subtype. |
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().
This function is commonly used to find a friendly target for spells such as heal or protection or armour
op | what is looking for the target (which can be a player). |
dir | direction we are looking in. |
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().
Checks for traps on the spaces around the player or in certain objects.
pl | player searching. |
skill | find trap skill object. |
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().
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().
void fire | ( | object * | op, |
int | dir | ||
) |
Received a fire command for the player - go and do it.
op | player. |
dir | direction 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().
int fire_arch_from_position | ( | object * | op, |
object * | caster, | ||
int16_t | x, | ||
int16_t | y, | ||
int | dir, | ||
object * | spell | ||
) |
Fires an archetype.
op | person firing the object. |
caster | object casting the spell. |
x | |
y | where to fire the spell. |
dir | direction to fire in. |
spell | spell that is being fired. It uses other_arch for the archetype to fire. |
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().
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.
op | who is casting the spell. |
caster | what object is casting the spell (rod, ...). |
dir | firing direction. |
spob | spell object for the bolt. |
0 | no bolt could be fired. |
1 | bolt 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().
Creature (monster or player) fires a bow.
op | object firing the bow. |
arrow | object to fire. |
dir | direction of fire. |
wc_mod | any special modifier to give (used in special player fire modes) |
sx | |
sy | coordinates to fire arrow from - also used in some of the special player fire 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().
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.
op | who is casting. |
caster | what object is casting. |
spell | spell object to cast. |
dir | cast direction. |
0 | nothing happened. |
1 | swarm 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().
void fix_luck | ( | void | ) |
Fixes luck of players, slowly move it towards 0.
Definition at line 3910 of file player.cpp.
References change_luck(), first_player, and altar_valkyrie::pl.
Referenced by do_specials().
An ARROW stops moving.
op | arrow stopping. |
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().
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.
op | object to stop. |
map | must be the value of op->map before stop_item() was called. |
originator | what 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().
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.
Definition at line 3894 of file player.cpp.
References first_player, fix_object(), llevDebug, LOG(), object_sum_weight(), and altar_valkyrie::pl.
Referenced by do_specials().
void flush_old_maps | ( | void | ) |
Reset maps that need to, remove their swap file. This is very useful if the tmp-disk is very full.
Definition at line 291 of file swap.cpp.
References clean_tmp_map(), delete_map(), EVENT_MAPRESET, events_execute_global_event(), first_map, llevDebug, LOG(), m, map_can_reset(), MAP_IN_MEMORY, MAP_SWAPPED, players_on_map(), seconds(), set_map_timeout(), and TRUE.
Referenced by command_reset(), do_specials(), and START_TEST().
int forbid_play | ( | void | ) |
Checks if server should be started.
Definition at line 1359 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().
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().
int free_no_drop | ( | object * | op | ) |
Check whether the given object is FLAG_NO_DROP. If so, (optionally) remove and free it.
op | the object to check |
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().
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().
void free_quest_definitions | ( | void | ) |
void free_races | ( | void | ) |
void free_server | ( | void | ) |
Frees all memory allocated around here:
Definition at line 1127 of file init.cpp.
References Settings::disabled_plugins, free_materials(), free_quest(), free_races(), and settings.
Referenced by cleanup().
Find out if this is friendly fire (PVP and attacker is peaceful) or not
op | victim. |
hitter | attacker. |
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().
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.
dam | damage done. | |
atm_type | one Attack types of type ATM_xxx. | |
victim_name | name of the victim of the attack. | |
[out] | buf1 | where to write the message for the one doing the attack, must be at least MAX_BUF long. |
[out] | buf2 | where 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().
void get_name | ( | object * | op | ) |
Waiting for the player's name.
op | player. |
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().
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().
Finds the nearest visible player or player-friendly for some object.
mon | what object is searching a player. |
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().
Ask the player for the password of the party she wants to join.
op | player. |
party | party op wishes to join. |
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().
void get_password | ( | object * | op | ) |
Waiting for the player's password.
op | player. |
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().
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.
p | if NULL, a new player structure is created, else p is recycled. |
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().
const char* get_reply_text_own | ( | reply_type | rt | ) |
Return the verb for the player's dialog type.
rt | dialog type. |
Definition at line 2318 of file monster.cpp.
References rt_question, rt_reply, and rt_say.
Referenced by convertType(), CREMessageTypeDelegate::createEditor(), and monster_communicate().
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.
pl | player. |
items | treasure 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().
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.
op | player to handle. |
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().
Main hide handling.
op | living trying to hide. |
skill | hiding skill. |
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().
int hideability | ( | object * | ob | ) |
Look at the surrounding terrain to determine the hideability of this object. Positive levels indicate greater hideability.
ob | object that may want to hide. |
Definition at line 3996 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().
void hiscore_check | ( | object * | op, |
int | quiet | ||
) |
Checks if player should enter the hiscore, and if so writes her into the list.
op | player to check. |
quiet | If 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().
void hiscore_display | ( | object * | op, |
int | max, | ||
const char * | match | ||
) |
Displays the high score file.
op | player asking for the score file. |
max | maximum number of scores to display. |
match | if 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().
void hiscore_init | ( | void | ) |
Initializes the module.
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().
int hit_map | ( | object * | op, |
int | dir, | ||
uint32_t | type, | ||
int | full_hit | ||
) |
Attack a spot on the map.
op | object hitting the map. |
dir | direction op is hitting/going. |
type | attacktype. |
full_hit | if set then monster area does not matter, it gets all damage. Else damage is proportional to affected area vs full monster area. |
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().
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.
op | object to be hit |
dam | base damage - protections/vulnerabilities/slaying matches can modify it. |
hitter | what is hitting the object |
type | attacktype |
full_hit | set if monster area does not matter. |
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_REMOVED, FLAG_RUN_AWAY, FLAG_SPLITTING, FLAG_TEAR_DOWN, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, FLAG_WIZ, FOR_INV_FINISH, FOR_INV_PREPARE, friendly_fire(), get_attack_mode(), 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().
hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile.
op | missile hitting. |
victim | who is hit by op. |
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(), sword_of_souls::victim, object::x, and object::y.
Referenced by common_process_projectile(), and common_projectile_move_on().
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/
tmp | object to try to identify. |
pl | object identifying. |
skill | identification skill. |
print_on_success | 1 to print a description if the object is identified, 0 to leave it to the calling function |
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().
Try to infect something with a disease. Rules:
victim | potential victim to infect. |
disease | what could infect. |
force | don't do a random check for infection. Other checks (susceptible to disease, not immune, and so on) are still done. |
0 | victim wasn't infected. |
1 | victim 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, sword_of_souls::victim, and living::wc.
Referenced by cast_cause_disease(), check_infection(), check_physically_infect(), and rune_attack().
void init | ( | int | argc, |
char ** | argv | ||
) |
This is the main server initialization function.
Called only once, when starting the program.
argc | argument count. |
argv | arguments on the command line. |
Definition at line 1087 of file init.cpp.
References accounts_load(), add_server_collect_hooks(), cftimer_init(), commands_init(), FULL_VERSION, hiscore_init(), init_beforeplay(), init_library(), init_modules(), init_ob_methods(), init_server(), init_signals(), init_skills(), init_startup(), llevInfo, load_settings(), LOG(), logfile, metaserver2_init(), parse_args(), read_map_log(), reset_sleep(), and SRANDOM.
Referenced by nlohmann::basic_json::basic_json(), nlohmann::basic_json::binary(), main(), nlohmann::basic_json::operator+=(), nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >::ordered_map(), nlohmann::basic_json::push_back(), server_main(), setup(), and START_TEST().
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().
void init_signals | ( | void | ) |
Setup our signal handlers.
Definition at line 1314 of file init.cpp.
References rec_sighup(), and signal_shutdown().
Referenced by command_unloadplugin(), and init().
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().
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().
Prints object's inventory.
op | who to print for. |
inv | if 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().
int is_true_undead | ( | object * | op | ) |
Is the object a true undead?
op | object to test. |
Definition at line 3979 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().
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?
pl | object jumping. |
dir | direction to jump to. |
skill | jumping skill. |
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().
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.
op | player. |
key | key 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().
void key_confirm_quit | ( | object * | op, |
char | key | ||
) |
We receive the reply to the 'quit confirmation' message.
op | player. |
key | reply. |
Definition at line 1592 of file player.cpp.
References account_char_free(), account_char_remove(), account_char_save(), account_remove_player(), buf, delete_character(), delete_map(), draw_ext_info(), draw_ext_info_format(), EVENT_REMOVE, events_execute_global_event(), first_map, FLAG_WIZ, hiscore_check(), castle_read::key, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, give::next, mapstruct::next, object_remove(), give::op, party_leave(), mapstruct::path, pets_terminate_all(), play_again(), player_set_own_title(), player_set_state(), Settings::playerdir, QUERY_FLAG, send_account_players(), Settings::set_title, settings, ST_PLAYING, and TRUE.
Referenced by reply_cmd().
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.
op | player. |
key | received 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().
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.
op | Player to be killed. |
killer | The object that's trying to kill op, which can be NULL. |
Definition at line 3492 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(), sword_of_souls::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, starving(), Ice::tmp, transfer_ob(), TRUE, diamondslots::x, and diamondslots::y.
Referenced by check_login(), deep_swamp_type_process(), kill_object(), and save_throw_object().
Display monster details, then add to a player's knowledge if not already.
op | player asking for details. |
mon | monster |
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().
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.
pl | who 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().
Give a knowledge item from its code.
pl | who to give the knowldge to. |
marker | knowledge's code. |
book | optional 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().
Displays known alchemy recipes an item can be used in.
op | who to display recipes for. |
item | what 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().
int knowledge_player_knows | ( | const player * | pl, |
const char * | knowledge | ||
) |
Determines whether a player knows a specific knowledge or not.
pl | who to check knowledge for. |
knowledge | what to check for, in format "type:(type specific value)". |
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().
void knowledge_process_incremental | ( | void | ) |
Incrementally send knowledge information to players, and remove information for players who left.
Definition at line 1439 of file knowledge.cpp.
References buf, esrv_send_face(), first_player, free_knowledge_player(), say::item, knowledge_player::item_count, knowledge_player::items, knowledge_global, MIN, knowledge_player::next, NS_FACESENT_FACE, Face::number, altar_valkyrie::pl, knowledge_player::player_name, Send_With_Handling(), knowledge_player::sent_up_to, SockList_AddInt(), SockList_AddLen16Data(), SockList_AddString(), SockList_Avail(), SockList_Init(), SockList_Reset(), SockList_Term(), ST_PLAYING, stringbuffer_finish(), stringbuffer_new(), and try_find_face().
Referenced by do_specials().
Player is reading a book, give knowledge if needed, warn player, and such.
pl | who is reading. |
book | what 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().
void knowledge_send_info | ( | socket_struct * | ns | ) |
Send the reply_info for 'knowledge_info'.
ns | socket 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().
void knowledge_send_known | ( | player * | pl | ) |
Send initial known knowledge to player, if requested.
pl | who 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().
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.
0 | player already knows the skill. |
1 | the player learns the skill. |
2 | some 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().
void leave | ( | player * | pl, |
int | draw_exit | ||
) |
Player logs out, or was disconnected.
pl | player. |
draw_exit | if set, display leaving message to other players. |
Definition at line 1298 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().
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().
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().
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().
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.
op | player to check. |
r | range to check. |
1 | range specified is legal - that is, the character has an item that is equipped for that range type. |
0 | no 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().
Displays the players in a region or party. If both are NULL, all players are listed.
op | who is asking for player list. |
reg | region to display players of. |
party | party 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().
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().
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.
op | object we're searching the inventory. |
spname | partial spell name. |
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().
This creates magic walls. Really, it can create most any object, within some reason.
op | who is casting. |
caster | what is casting. |
dir | casting direction. |
spell_ob | actual spell object. |
0 | spell failed. |
1 | spell was successful. |
Definition at line 1456 of file spell_effect.cpp.
References arch_to_object(), object::attacktype, caster_level(), archetype::clone, living::dam, draw_ext_info(), draw_ext_info_format(), object::duration, FLAG_ALIVE, FLAG_BLOCKSVIEW, FLAG_IS_USED_UP, FLAG_TEAR_DOWN, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, llevError, LOG(), m, MAX_BUF, object::move_block, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, give::name, object::name, NDI_UNIQUE, object_copy(), object_insert_in_map_at(), object_insert_in_ob(), object_new(), object_set_owner(), give::op, object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, object::race, object::range, SET_FLAG, set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SPELL, SPELL_EFFECT, object::stats, Ice::tmp, try_find_archetype(), object::type, update_all_los(), diamondslots::x, and diamondslots::y.
Referenced by cast_spell().
void make_visible | ( | object * | op | ) |
Makes an object visible again.
op | what to make visible. |
Definition at line 3960 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().
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.
pl | potentially invisible object. |
mon | who may see pl. |
0 | mon can see pl. |
1 | mon 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().
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.
map | map to consider. |
current_time | current time. |
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().
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.
pl | livng meditating, should be a player. |
skill | meditation 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().
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.
caster | person casting the spell. |
spell | spell object. |
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().
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
op | who should detect. |
enemy | what to detect. |
rv | if the function returns 1, contains the range vector towards enemy. |
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().
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.
op | who is trying to see enemy. |
enemy | victim op is trying to see. |
Definition at line 2778 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().
void monster_check_apply_all | ( | object * | monster | ) |
Calls monster_check_apply() for all inventory objects.
monster | the 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().
Living creature attempts to open a door.
op | creature to consider. |
m | map to consider. |
x | coordinate. |
y | coordinate. |
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().
Living creature attempts to hit an earthwall.
op | creature to consider. |
m | map to consider. |
x | coordinate. |
y | coordinate. |
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().
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.
npc | monster we're considering | |
[out] | rv | will contain vector to go to enemy if function returns not NULL. |
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().
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:
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.
op | who is saying something. |
txt | what 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().
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.
source | what wants to move. |
target | target to go to. |
default_dir | general direction from source to target. |
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().
void monster_do_living | ( | object * | op | ) |
For a monster, regenerate hp and sp, potentially clear scared status.
op | monster. 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().
void monster_do_say | ( | const mapstruct * | map, |
const char * | message | ||
) |
Output a NPC message on a map.
map | where to talk to. |
message | what 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().
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.
npc | monster to consider |
owner | if not NULL, then search will:
|
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().
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.
op | monster to find an item to throw for. |
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().
int monster_move | ( | object * | op | ) |
Main monster processing routine.
Will regenerate spell points, hit points. Moves the monster, handle attack, item applying, pickup, ...
op | monster to process. |
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().
void monster_npc_call_help | ( | object * | op | ) |
A monster calls for help against its enemy.
op | monster 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().
void monster_npc_say | ( | object * | npc, |
const char * | cp | ||
) |
Simple function to have some NPC say something.
npc | who should say something. |
cp | what 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().
int monster_stand_in_light | ( | object * | op | ) |
Cache monster_stand_in_light_internal().
Definition at line 2756 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().
This covers the various spells that change the moods of monsters - makes them angry, peaceful, friendly, etc.
op | who is casting. |
caster | what object is casting. |
spell | spell object to cast. |
Definition at line 904 of file spell_attack.cpp.
References add_friendly_object(), object::arch, arch_to_object(), object::attack_movement, object::attacktype, caster_level(), CLEAR_FLAG, determine_god(), did_make_save(), living::exp, find_god(), FLAG_BERSERK, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_ATTACK, FLAG_SLEEP, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, get_map_flags(), object::level, level, llevError, LOG(), m, map_find_by_flag(), MIN, archetype::name, NROFATTACKS, object_get_value(), object_insert_in_map_at(), object_set_enemy(), object_set_owner(), object_set_value(), object_value_set(), give::op, object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, object::race, random_roll(), object::range, remove_friendly_object(), object::resist, SET_FLAG, set_spell_skill(), share_exp(), SK_EXP_ADD_SKILL, object::skill, object::slaying, SP_level_range_adjust(), object::stats, Ice::tmp, object::type, diamondslots::x, and diamondslots::y.
Referenced by cast_spell().
int move_disease | ( | object * | disease | ) |
Ticks the clock for disease: infect, aggravate symptoms, ...
disease | disease to move. Can be removed during processing. |
1 | if disease was removed. |
0 | disease 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().
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.
op | firewall. |
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().
Op is trying to move in direction dir.
op | what is moving. |
dir | what direction op wants to move. |
originator | typically the same as op, but can be different if originator is causing op to move (originator is pushing op). |
0 | op is not able to move to the desired space. |
1 | op 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().
int move_object | ( | object * | op, |
int | dir | ||
) |
Try to move op in the direction "dir".
op | what to move. |
dir | moving direction. |
0 | something blocks the passage. |
1 | op 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().
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.
op | player. |
dir | direction to move/fire. |
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().
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).
op | player moving. |
dir | moving 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().
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.
op | mover. |
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 sword_of_souls::victim.
Referenced by legacy_ob_process().
void move_symptom | ( | object * | symptom | ) |
Make the symptom do the nasty things it does.
symptom | symptom to move. |
Definition at line 592 of file disease.cpp.
References arch_to_object(), object::attacktype, object::count, living::dam, draw_ext_info(), object::env, FLAG_FREED, FREE_AND_COPY, HEAD, hit_player(), llevError, LOG(), MAX, MAX_BUF, living::maxsp, object::msg, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, give::name, object::name, object::name_pl, NDI_RED, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_was_destroyed, object::other_arch, QUERY_FLAG, object::stats, CFweardisguise::tag, Ice::tmp, and sword_of_souls::victim.
Referenced by legacy_ob_process().
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.
op | object to move |
x | |
y | destination coordinates |
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().
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().
Move the specified object in a free spot around the map's x & y.
op | object to move, may be REMOVED or not. |
map | map to move op to. |
x | coordinate to move op to. |
y | coordinate to move op to. |
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().
Returns true if it is ok to put spell op on the space/may provided.
m | |
x | |
y | coordinates to test. |
op | spell to test for. |
immune_stop | basically 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. |
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().
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:
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").
op | Object to check (usually a player). | |
[out] | x | |
[out] | y | If not NULL and standing on a battleground tile, store exit coordinates. |
[out] | trophy | If not NULL and standing on a battleground tile, store a pointer to the archetype that can be collected by the winner. |
Definition at line 4245 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().
void paralyze_living | ( | object * | op, |
int | dam | ||
) |
Paralyze a living thing.
op | victim. |
dam | damage 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().
int party_confirm_password | ( | const partylist * | party, |
const char * | password | ||
) |
Checks whether a given password matches the party's password.
party | the party to check |
password | the password to check for |
Definition at line 259 of file party.cpp.
References partylist::passwd.
Referenced by check_login(), and confirm_party_password().
partylist* party_find | ( | const char * | partyname | ) |
Find a party by name.
partyname | the party's name to find |
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().
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.
op | party creator. |
partyname | the party name. |
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().
partylist* party_get_first | ( | void | ) |
Returns the first party from the list of all parties.
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().
const char* party_get_leader | ( | const partylist * | party | ) |
Returns the name of the party's leader.
party | the party to query |
Definition at line 292 of file party.cpp.
References partylist::partyleader.
Referenced by command_party(), and START_TEST().
Returns the next party from the list of all parties.
party | the party to use |
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().
const char* party_get_password | ( | const partylist * | party | ) |
Returns the party's password.
party | the party to query |
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().
Makes a player join a party. Leaves the former party if necessary. Does nothing if the player already is a member of the party.
op | the player |
party | the 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().
void party_leave | ( | object * | op | ) |
Makes a player leave his party. Does nothing if the player is not member of a party.
op | the 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().
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().
void party_remove | ( | partylist * | party | ) |
Removes and frees a party. Removes all members from the party.
party | the 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().
void party_send_message | ( | object * | op, |
const char * | message | ||
) |
Send a message to all party members except the speaker.
op | player talking. |
message | message to send. |
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().
void party_set_password | ( | partylist * | party, |
const char * | password | ||
) |
Sets a party's password.
party | the party to change |
password | the 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().
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:
mon | source object. |
pl | target. |
mindiff | minimal distance mon and pl should have. |
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().
int perceive_self | ( | object * | op | ) |
Living thing wants to know information.
op | who wants information. |
Definition at line 1002 of file spell_effect.cpp.
References ARCH_DEPLETION, arch_present_in_ob(), atnr_is_dragon_enabled(), buf, change_resist_msg, describe_item(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_god(), FORCE, get_attr_value(), is_dragon_pl(), levels, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PERCEIVE_SELF, object::name, NDI_UNIQUE, NROFATTACKS, NUM_STATS, object_find_by_type_and_arch_name(), give::op, SIGN, statname, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_finish(), stringbuffer_new(), Ice::tmp, and try_find_archetype().
Referenced by cast_spell().
void pets_attempt_follow | ( | object * | for_owner, |
int | force | ||
) |
Check pets so they try to follow their master around the world.
for_owner | if NULL, check all pets, else only pets for this owner. |
force | if 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().
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.
op | golem. |
dir | desired direction. |
Definition at line 630 of file pets.cpp.
References give::op.
Referenced by animate_weapon(), and fire().
A pet is trying to follow its owner.
ob | pet trying to follow. Will be object_remove()'d if can't follow. |
owner | owner 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().
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.
pet | who is seeking an enemy. | |
[out] | rv | will contain the path to the enemy. |
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().
void pets_move | ( | object * | ob | ) |
Handles a pet's movement.
ob | pet to move. |
Definition at line 317 of file pets.cpp.
References absdir(), object::contr, rv_vector::direction, draw_ext_info(), object::enemy, FLAG_ALIVE, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_map_from_coord(), GET_MAP_MOVE_BLOCK, get_random_dir(), get_rangevector(), HEAD, llevMonster, LOG(), m, object::map, object::more, move_ob(), MSG_SUBTYPE_NONE, MSG_TYPE_MISC, NDI_UNIQUE, guildjoin::ob, guildbuy::ob2, OB_TYPE_MOVE_BLOCK, object_free_drop_inventory(), object_get_owner(), object_remove(), object_set_enemy(), object_was_destroyed, on_same_map(), P_OUT_OF_MAP, pet_sad, player::petmode, pets_follow_owner(), PLAYER, QUERY_FLAG, RANDOM, remove_friendly_object(), CFweardisguise::tag, object::type, nlohmann::detail::void(), object::x, and object::y.
Referenced by monster_move_no_enemy().
void pets_move_golem | ( | object * | op | ) |
Handles a golem's movement.
Updated this to allow more than the golem 'head' to attack.
op | golem to be moved. |
Definition at line 519 of file pets.cpp.
References attack_ob(), object::contr, DIRX, DIRY, draw_ext_info(), draw_ext_info_format(), FLAG_ALIVE, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), player::golem_count, llevDebug, LOG(), m, move_ob(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, NDI_UNIQUE, object_free_drop_inventory(), object_get_owner(), object_remove(), object_update(), object_was_destroyed, give::op, P_OUT_OF_MAP, QUERY_FLAG, range_golem, player::ranges, remove_friendly_object(), CFweardisguise::tag, Ice::tmp, UP_OBJ_FACE, sword_of_souls::victim, diamondslots::x, and diamondslots::y.
Referenced by legacy_ob_process().
Determines if checks so pets don't attack players or other pets should be overruled by the arena petmode.
pet | pet considered. |
owner | pet's owner. |
target | potential pet target. |
0 | pet shouldn't attack target. |
1 | target 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().
Summons a monster.
op | who is summoning. |
caster | object casting the spell. |
dir | direction to place the monster. |
spob | spell object casting. At this stage, all spob is really used for is to adjust some values in the monster. |
0 | failed to summon something. |
1 | summoned 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().
int pets_summon_object | ( | object * | op, |
object * | caster, | ||
object * | spell_ob, | ||
int | dir, | ||
const char * | stringarg | ||
) |
General purpose summoning function.
op | who is summoning. |
caster | what object did cast the summoning spell. |
spell_ob | actual spell object for summoning. |
dir | direction to summon in. |
stringarg | additional parameters. |
0 | nothing was summoned. |
1 | something was summoned. |
Definition at line 872 of file pets.cpp.
References absdir(), add_friendly_object(), object::arch, arch_to_object(), object::attack_movement, caster_level(), choose_cult_monster(), CLEAR_FLAG, archetype::clone, create_treasure(), living::dam, determine_god(), die_roll(), draw_ext_info(), draw_ext_info_format(), find_god(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_SLEEP, freearr_x, freearr_y, freedir, GT_STARTEQUIP, treasure::item, treasurelist::items, object::level, llevError, LOG(), mark_inventory_as_no_drop(), MIN_ACTIVE_SPEED, mon, monster_check_apply_all(), object::more, archetype::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, treasurelist::name, object::name, archetype::name, NDI_UNIQUE, treasure::next, treasure::nrof, ob_blocked(), object_find_free_spot(), object_get_owner(), object_insert_in_map_at(), object_set_enemy(), object_set_owner(), give::op, object::other_arch, PLAYER, PREFER_HIGH, QUERY_FLAG, object::race, RANDOM, random_roll(), object::randomitems, SET_FLAG, set_spell_skill(), SIZEOFFREE, SP_level_dam_adjust(), object::stats, Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by cast_spell().
void pets_terminate_all | ( | object * | owner | ) |
Removes all pets someone owns.
owner | player 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().
Lock pick handling.
Implementation by bt. (thoma) monster implementation 7-7-95 by bt. s@as tro.p su.e du
pl | player picking the lock. |
dir | direction to pick. |
skill | lock picking skill. |
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().
Try to pick up an item.
op | object trying to pick up. |
alt | optional 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().
void play_again | ( | object * | op | ) |
Ask the player whether to play again or disconnect.
op | player. |
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().
int player_arrest | ( | object * | who | ) |
Put a player into jail, taking into account cursed exits and player's region.
who | player to put in jail |
0 | player was moved to jail. |
-1 | no jail found. |
-2 | couldn't move to jail (map loading error, or already at jail's position). |
-3 | op 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().
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().
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.
pl | player that may see op. |
op | what may be seen by pl. |
-1 | pl isn't a player |
0 | pl can't see op. |
1 | pl can see op. |
Definition at line 4146 of file player.cpp.
References rv_vector::distance_x, rv_vector::distance_y, FABS, get_rangevector(), HEAD, llevError, LOG(), give::op, altar_valkyrie::pl, and PLAYER.
Referenced by adj_attackroll(), monster_can_detect_enemy(), and monster_can_see_enemy().
Get a delayed socket buffer, that will be sent after the player's tick is complete. Will fatal() if memory error.
pl | player to get a buffer for. |
Definition at line 4484 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().
void player_set_state | ( | player * | pl, |
uint8_t | state | ||
) |
Set the player's state to the specified one.
pl | who to set state for. |
state | new state. |
Definition at line 4471 of file player.cpp.
References altar_valkyrie::pl, ST_CHANGE_PASSWORD_CONFIRM, and dragon::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().
Unready an object for a player. This function does nothing if the object was not readied.
pl | player. |
ob | object to unready. |
Definition at line 4453 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().
int playername_ok | ( | const char * | cp | ) |
Is the player name valid.
cp | name to test. |
Definition at line 257 of file player.cpp.
Referenced by check_name(), and create_player_cmd().
int players_on_map | ( | mapstruct * | m, |
int | show_all | ||
) |
Returns the count of players on a map, calculated from player list.
m | map we want the count of players on. |
show_all | if true, show everyone. If not, don't show hidden players (dms) |
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().
void plugins_display_list | ( | object * | op | ) |
Displays a list of loaded plugins (keystrings and description) in the game log window.
op | who 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().
int plugins_init_plugin | ( | const char * | libfile | ) |
Try to load the specified plugin. Update plugins_list if successful. Log errors at llevError.
libfile | full path to the plugin. |
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().
int plugins_remove_plugin | ( | const char * | id | ) |
Unload the specified plugin. No logging is done in case of error. Updates plugins_list.
id | plugin internal identifier. |
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().
Handles polymorphing an object, living or not. Will avoid some specific items (flying arrows and such).
op | object being polymorphed. |
who | spell caster. |
level | spell 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().
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.
pl | object praying, should be a player. |
skill | praying skill. |
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().
Player prays at altar. Checks for god changing, divine intervention, and so on.
pl | player praying. |
altar | altar player's praying on. Doesn't need to be consecrated. |
skill | praying 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().
Try to get information about a living thing.
op | who is casting. |
caster | what is casting. |
spell_ob | spell object being cast. |
dir | cast direction. |
level | probe level. |
0 | nothing probed. |
1 | something 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().
void process_events | ( | void | ) |
Process all active objects.
Definition at line 1078 of file server.cpp.
References object::active_next, active_objects, object::active_prev, animate_object(), Settings::casting_time, FABS, FLAG_FREED, FLAG_REMOVED, FREE_OBJ_NO_DESTROY_CALLBACK, llevError, LOG(), MAP, MAP_IN_MEMORY, MONSTER, object_dump(), object_free(), object_in_icecube(), object_update_speed(), object_was_destroyed, give::op, PLAYER, process_object(), process_players1(), process_players2(), QUERY_FLAG, settings, stringbuffer_finish(), stringbuffer_new(), CFweardisguise::tag, and TRUE.
Referenced by server_main(), and START_TEST().
void process_object | ( | object * | op | ) |
Main object move function.
op | object to move. |
Definition at line 796 of file time.cpp.
References add_string(), animate_object(), change_object(), draw_ext_info_format(), EVENT_TIME, events_execute_object_event(), FLAG_ANIMATE, FLAG_APPLIED, FLAG_CHANGING, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_IS_A_TEMPLATE, FLAG_IS_USED_UP, FLAG_MONSTER, FLAG_REMOVED, FLAG_SEE_ANYWHERE, FREE_OBJ_DROP_ABOVE_FLOOR, free_string(), generate_monster(), castle_read::key, llevDebug, LOG(), make_sure_not_seen(), make_sure_seen(), monster_move(), MSG_TYPE_ITEM, MSG_TYPE_ITEM_REMOVE, NDI_BLACK, ob_process(), object_free(), object_get_key_value(), object_remove(), give::op, PLAYER, QUERY_FLAG, remove_force(), SCRIPT_FIX_NOTHING, sstring, and key_value::value.
Referenced by attack_ob_simple(), and process_events().
Something is pushing some other object.
who | object being pushed. |
dir | pushing direction. |
pusher | what is pushing who. |
1 | if pushing invokes a attack |
0 | no attack during pushing. |
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().
Something tries to put an object into another.
This function was part of drop(), now is own function.
op | who is moving the item. |
sack | where to put the object. |
tmp | what to put into sack. |
nrof | if 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().
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.
pl | who 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().
Get the quest state for a player.
pl | player. |
quest_code | internal quest code. |
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().
void quest_load_definitions | ( | void | ) |
void quest_send_initial_states | ( | player * | pl | ) |
Send the current quest states for the specified player, if the client supports those notifications.
pl | who 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(), dragon::state, and quest_step_definition::step_description.
Referenced by check_login().
Set the state of a quest for a player.
pl | player to set the state for. |
quest_code | quest internal code. |
state | new 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 dragon::state.
Referenced by cfapi_player_quest().
Start a quest for a player. Will notify the player.
pl | player. |
quest_code | internal quest code. |
state | initial 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 dragon::state.
Referenced by cfapi_player_quest().
Check if a quest was completed once for a player, without taking account the current state.
pl | who to check for. |
quest_code | quest internal code. |
Definition at line 726 of file quest.cpp.
References get_or_create_quest(), get_state(), altar_valkyrie::pl, and dragon::state.
Referenced by cfapi_player_quest(), and evaluate_quest_conditions().
object* races_get_random_monster | ( | const char * | race, |
int | level | ||
) |
Get a random monster of specified race and level at most the specified one.
race | race, must not be NULL. If invalid, then logs as an error. |
level | maximum number, included. |
Definition at line 24 of file races.cpp.
References llevError, LOG(), ring_occidental_mages::r, races, and rndm().
Referenced by choose_cult_monster().
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().
void receive_party_password | ( | object * | op, |
const char * | password | ||
) |
Player entered a party password.
op | player. |
password | party 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().
void receive_play_again | ( | object * | op, |
char | key | ||
) |
Player replied to play again / disconnect.
op | player. |
key | received 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().
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.
op | player we're getting the name of. |
name | name 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().
void receive_player_password | ( | object * | op, |
const char * | password | ||
) |
A player just entered her password, including for changing it.
op | player. |
password | password 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().
Recharge wands.
op | who is casting. |
caster | what is casting. |
spell_ob | spell object. |
0 | nothing happened. |
1 | wand 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().
An object is pushed by another which is trying to take its place.
op | what is being pushed. |
dir | pushing direction. |
pusher | what 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().
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.
m | |
x | |
y | position of the object to test. |
sp_op | spell object to test. |
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().
void regenerate_rod | ( | object * | rod | ) |
Regenerates a rod's charges.
rod | rod to regenerate. |
Definition at line 761 of file spell_util.cpp.
References living::hp, living::maxhp, and object::stats.
Referenced by legacy_ob_process().
void register_all_ob_types | ( | void | ) |
Calls the intialization functions for all individual types.
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().
This function removes the cursed/damned status on equipped items.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
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().
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.)
op | door 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().
void remove_locked_door | ( | object * | op | ) |
Same as remove_door() but for locked doors.
op | door 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().
This skill will disarm any previously discovered trap. the algorithm is based (almost totally) on the old command_disarm() - b.t.
op | player disarming. Must be on a map. |
skill | disarming skill. |
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().
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.
op | object to start the search from. |
env | top-level container, should be in a map if free_items is 0, unused if free_items is 1. |
free_items | if 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().
void rod_adjust | ( | object * | rod | ) |
Adjusts rod attributes. This function must be called after a new rod has been created.
rod | the 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().
void roll_again | ( | object * | op | ) |
Ask the player what to do with the statistics.
op | player. |
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().
int roll_stat | ( | void | ) |
This rolls four 1-6 rolls and sums the best 3 of the 4.
Definition at line 1038 of file player.cpp.
References RANDOM.
Referenced by roll_stats().
void roll_stats | ( | object * | op | ) |
Roll the initial player's statistics.
op | player 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().
Check if an item op can be put into a sack. If pl exists then tell a player the reason of failure.
pl | player. |
sack | container to try to put into. |
op | what to put in the sack. |
nrof | number 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. |
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().
int save_player | ( | object * | op, |
int | flag | ||
) |
Saves a player to disk.
op | player to save. |
flag | if 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. |
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().
Object is attacked with some attacktype (fire, ice, ...). Calls did_make_save_item(). It then performs the appropriate actions to the item (such as burning the item up, calling cancellation(), etc.)
op | victim of the attack. |
type | attacktype. |
originator | what is attacking. |
Definition at line 202 of file attack.cpp.
References archininventory::arch, AT_CANCELLATION, AT_COLD, AT_ELECTRICITY, AT_FIRE, ATNR_COLD, ATNR_FIRE, blame(), cancellation(), commit_crime(), create_archetype(), did_make_save_item(), draw_ext_info_format(), env, fix_stopped_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_LIGHTABLE, FLAG_NO_PICK, FLAG_REMOVED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, commongive::inv, kill_player(), llevError, LOG(), m, MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, give::name, NDI_RED, NDI_UNIQUE, object_decrease_nrof(), object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_replace_insert_in_map(), give::op, put_in_icecube(), QUERY_FLAG, query_name(), RANDOM, rndm(), RUNE, SET_FLAG, spring_trap(), stop_item(), TRANSPORT, is_valid_types_gen::type, diamondslots::x, and diamondslots::y.
Referenced by do_light(), hit_map(), and spell_effect_type_move_on().
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.
op | who failed. |
failure | what kind of nasty things happen. |
power | the 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().
void send_news | ( | const object * | op | ) |
Send the news to a player.
op | player 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().
void send_rules | ( | const object * | op | ) |
Send the rules to a player.
op | player 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().
void server_main | ( | int | argc, |
char * | argv[] | ||
) |
Server main function.
argc | length of argv. |
argv | command-line options. |
Definition at line 1574 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().
void set_darkness_map | ( | mapstruct * | m | ) |
Set the darkness level for a map, based on the time of the day.
m | map 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().
void set_first_map | ( | object * | op | ) |
This loads the first map an puts the player on it.
op | player 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().
void set_map_timeout | ( | mapstruct * | oldmap | ) |
Enable swapping for the given map. Called when all players leave a map, because maps with players are marked as ineligible for swap.
oldmap | map to process. |
Definition at line 304 of file main.cpp.
References MAP_MINTIMEOUT, mapstruct::timeout, and nlohmann::detail::void().
Referenced by flush_old_maps(), place_exits(), and player_map_change_common().
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.
op | Object to set face on |
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().
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.
p | The target player object to copy the data into |
ns | the 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().
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).
op | object casting the spell. |
caster | object used to cast the spell (rod, wand, ...). |
spob | spell object. |
dest | object 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().
Check if op should abort moving victim because of it's race or slaying.
op | detector or equivalent we're testing. Note that its type is not checked. |
victim | object trying to move on op. |
Definition at line 68 of file apply.cpp.
References DOOR, give::op, and sword_of_souls::victim.
Referenced by director_type_move_on(), move_player_mover(), and player_mover_type_move_on().
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.
op | player wanting to examine skills. |
parms | optional 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().
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.
op | object 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().
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.
pl | player singing. |
dir | direction to sing in. |
skill | singing skill object. |
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().
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 s@as tro.p su.e du
tmp | victim. Can be NULL. |
pl | who is attacking. |
dir | direction to attack. |
string | describes the damage ("claw", "punch", ...). |
skill | attack 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().
Main identification skill handling.
pl | player identifying. |
skill | identification skill. |
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().
Throwing skill handling.
op | object throwing. |
part | actual part of op throwing. |
dir | direction to throw into. |
skill | throwing skill. |
0 | skill use failed. |
1 | skill 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().
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().
Returns adjusted damage based on the caster.
caster | who is casting. |
spob | spell we are adjusting. |
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().
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.
caster | who is casting. |
spob | spell we are adjusting. |
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().
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.
caster | who is casting. |
spob | spell we are adjusting. |
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().
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.
caster | what is casting the spell. |
spell | spell object. |
flags | one of Spell/grace points. |
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().
Returns adjusted wc based on the caster and the spell.
caster | who is casting. |
spob | spell we are adjusting. |
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().
Inserts into map a spell effect based on other_arch.
spob | spell object to insert object from. |
x | |
y | |
map | coordinates to put the effect at. |
originator | what 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().
Handles the various effects for differing degrees of failure badness.
op | player that failed. |
failure | random value of how badly you failed. |
power | how many spellpoints you'd normally need for the spell. |
skill | skill 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().
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.
m | |
x | |
y | where to search from. |
exclude | what object to avoid. Can be NULL, in which case all bets are off. |
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().
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.
trap | trap that activates. |
victim | victim 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 sword_of_souls::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().
int stand_near_hostile | ( | object * | who | ) |
Determine if who is standing near a hostile creature.
who | object to check. |
Definition at line 4078 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().
Main stealing function.
op | thief. |
dir | direction to steal from. |
skill | stealing skill. |
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().
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.
op | object to check. |
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().
void store_spell_expiry | ( | object * | spell | ) |
Stores in the spell when to warn player of expiration.
spell | spell 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().
int summon_hostile_monsters | ( | object * | op, |
int | n, | ||
const char * | monstername | ||
) |
Summons hostile monsters and places them in nearby squares.
op | the summoner. |
n | number of monsters. |
monstername | name of the monster to summon, should be a valid archetype. |
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().
int swap_map | ( | mapstruct * | map | ) |
Swaps a map to disk.
After calling this function, the map will be:
map | map to swap. |
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(), and command_reset().
Changes the attributes of cone, smite, and ball spells as needed by the code.
spellop | spell object to change. |
caster | what is casting spellop (player, spell, ...). |
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().
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.
teleporter | what is teleporting user. |
tele_type | what object type user can be put on. this is either set to SHOP_MAT or TELEPORTER. |
user | what object to teleport. |
1 | user was destroyed. |
0 | user is still valid, but may have moved or not. |
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().
void tick_the_clock | ( | void | ) |
This performs the basic function of advancing the clock one tick forward. Every 20 ticks, the clock is saved to disk. It is also saved on shutdown. Any time dependant functions should be called from this function, and probably be passed tod as an argument. Please don't modify tod in the dependant function.
Definition at line 94 of file weather.cpp.
References dawn_to_dusk(), get_tod(), todtick, and write_todclock().
Referenced by do_specials().
Move an object (even linked objects) to another spot on the same map.
Does nothing if there is no free spot.
op | what to move. |
x | |
y | new coordinates. |
randomly | if true, use object_find_free_spot() to find the destination, otherwise use object_find_first_free_spot(). |
originator | what is causing op to move. |
1 | op was destroyed. |
0 | op 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().
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
transport | transport to check. |
op | object we're trying to insert. |
nrof | number of op. |
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().
Try to disarm a trap/rune.
disarmer | object disarming the trap/rune. |
trap | trap to disarm. |
risk | if 0, trap/rune won't spring if disarm failure. Else it will spring. |
skill | spell used to disarm. |
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().
Should op see trap?
op | living that could spot the trap. |
trap | trap that is invisible. |
0 | trap wasn't spotted. |
1 | trap 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().
Handles showing a trap/rune detonation.
trap | trap that detonates. |
where | object at the location to detonate. |
0 | no animation inserted. |
1 | animation 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().
int use_alchemy | ( | object * | op | ) |
Handle use_skill for alchemy-like items.
op | player trying to do alchemy. |
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().
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) s@as tro.p su.e du
pl | player trying to convince a monster. |
dir | direction to orate in. |
skill | oratory skill object. |
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().
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.
op | player trying to use a skill. |
string | parameter for the skill to use. |
0 | unable to change to the requested skill, or unable to use the skill properly. |
1 | skill 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().
int verify_player | ( | const char * | name, |
char * | password | ||
) |
This verify that a character of name exits, and that it matches password.
name | player name. |
password | player's password, not encrypted. |
0 | there is match. |
1 | no such player. |
2 | incorrect 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().
This writes a rune that contains the appropriate message. There really aren't any adjustments we make.
op | who is casting. |
spell | actual spell cast. |
msg | message to write. |
0 | failure. |
1 | success. |
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().
Implement the 'inscription' skill, which checks for the required skills and marked items before running either write_note() or write_scroll().
pl | Player attempting to write |
params | Message to write, blank to write a spell |
skill | Writing 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().
Player is attempting to write a magical rune. This function does all checks for paths, sp/gr, ...
op | rune writer. |
caster | object used for casting this rune. |
spell | writing spell. |
dir | orientation of rune, direction rune's contained spell will be cast in, if applicable |
runename | name of the rune or message displayed by the rune for a rune of marking. |
0 | no rune was written. |
1 | rune 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().