Crossfire Server, Branches 1.12
R18729
|
Go to the source code of this file.
Functions | |
void | add_player (socket_struct *ns) |
int | alchemy (object *op, object *caster, object *spell_ob) |
int | animate_weapon (object *op, object *caster, object *spell, int dir) |
void | apply_builder_remove (object *pl, int dir) |
void | apply_changes_to_player (object *pl, object *change) |
int | apply_container (object *op, object *sack) |
void | apply_map_builder (object *pl, int dir) |
int | apply_special (object *who, object *op, int aflags) |
int | attack_ob (object *op, object *hitter) |
int | auto_apply (object *op) |
void | become_daemon (void) |
void | become_follower (object *op, const object *new_god) |
void | blind_living (object *op, object *hitter, int dam) |
sint64 | calc_skill_exp (object *who, object *op, object *skill) |
int | can_apply_object (object *who, object *op) |
int | can_detect_enemy (object *op, object *enemy, rv_vector *rv) |
int | can_pay (object *pl) |
int | can_see_enemy (object *op, object *enemy) |
int | cast_bless (object *op, object *caster, object *spell_ob, int dir) |
int | cast_cause_disease (object *op, object *caster, object *spell, int dir) |
int | cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent) |
int | cast_change_map_lightlevel (object *op, object *caster, object *spell) |
int | cast_cone (object *op, object *caster, int dir, object *spell) |
int | cast_consecrate (object *op, object *caster, object *spell) |
int | cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *stringarg) |
int | cast_create_missile (object *op, object *caster, object *spell, int dir, const char *stringarg) |
int | cast_create_obj (object *op, object *new_op, int dir) |
int | cast_create_town_portal (object *op, object *caster, object *spell, int dir) |
int | cast_curse (object *op, object *caster, object *spell_ob, int dir) |
int | cast_destruction (object *op, object *caster, object *spell_ob) |
int | cast_detection (object *op, object *caster, object *spell) |
void | cast_dust (object *op, object *throw_ob, int dir) |
int | cast_earth_to_dust (object *op, object *caster, object *spell_ob) |
int | cast_heal (object *op, object *caster, object *spell, int dir) |
int | cast_identify (object *op, object *caster, object *spell) |
int | cast_invisible (object *op, object *caster, object *spell_ob) |
int | cast_item_curse_or_curse (object *op, object *caster, object *spell_ob) |
int | cast_light (object *op, object *caster, object *spell, int dir) |
void | cast_magic_storm (object *op, object *tmp, int lvl) |
int | cast_polymorph (object *op, object *caster, object *spell_ob, int dir) |
int | cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg) |
int | cast_smite_spell (object *op, object *caster, int dir, object *spell) |
int | cast_spell (object *op, object *caster, int dir, object *spell_ob, char *stringarg) |
int | cast_transfer (object *op, object *caster, object *spell, int dir) |
int | cast_wonder (object *op, object *caster, int dir, object *spell_ob) |
int | cast_word_of_recall (object *op, object *caster, object *spell_ob) |
int | caster_level (const object *caster, const object *spell) |
void * | cfapi_archetype_get_property (int *type,...) |
void * | cfapi_friendlylist_get_next (int *type,...) |
void * | cfapi_generate_random_map (int *type,...) |
void * | cfapi_get_hooks (int *type,...) |
void * | cfapi_get_month_name (int *type,...) |
void * | cfapi_get_periodofday_name (int *type,...) |
void * | cfapi_get_season_name (int *type,...) |
void * | cfapi_get_time (int *type,...) |
void * | cfapi_get_weekday_name (int *type,...) |
void * | cfapi_log (int *type,...) |
void * | cfapi_map_change_light (int *type,...) |
void * | cfapi_map_create_path (int *type,...) |
void * | cfapi_map_delete_map (int *type,...) |
void * | cfapi_map_get_map (int *type,...) |
void * | cfapi_map_get_map_property (int *type,...) |
void * | cfapi_map_get_object_at (int *type,...) |
void * | cfapi_map_has_been_loaded (int *type,...) |
void * | cfapi_map_message (int *type,...) |
void * | cfapi_map_out_of_map (int *type,...) |
void * | cfapi_map_present_arch_by_name (int *type,...) |
void * | cfapi_map_set_map_property (int *type,...) |
void * | cfapi_map_trigger_connected (int *type,...) |
void * | cfapi_map_update_position (int *type,...) |
void * | cfapi_object_apply (int *type,...) |
void * | cfapi_object_apply_below (int *type,...) |
void * | cfapi_object_cast (int *type,...) |
void * | cfapi_object_change_abil (int *type,...) |
void * | cfapi_object_change_exp (int *type,...) |
void * | cfapi_object_check_inventory (int *type,...) |
void * | cfapi_object_check_spell (int *type,...) |
void * | cfapi_object_check_trigger (int *type,...) |
void * | cfapi_object_clean_object (int *type,...) |
void * | cfapi_object_clear (int *type,...) |
void * | cfapi_object_clone (int *type,...) |
void * | cfapi_object_create (int *type,...) |
void * | cfapi_object_delete (int *type,...) |
void * | cfapi_object_describe (int *type,...) |
void * | cfapi_object_distance (int *type,...) |
void * | cfapi_object_drain (int *type,...) |
void * | cfapi_object_drop (int *type,...) |
void * | cfapi_object_find (int *type,...) |
void * | cfapi_object_find_archetype_inside (int *type,...) |
void * | cfapi_object_fix (int *type,...) |
void * | cfapi_object_forget_spell (int *type,...) |
void * | cfapi_object_get_key (int *type,...) |
void * | cfapi_object_get_property (int *type,...) |
void * | cfapi_object_give_skill (int *type,...) |
void * | cfapi_object_identify (int *type,...) |
void * | cfapi_object_insert (int *type,...) |
void * | cfapi_object_learn_spell (int *type,...) |
void * | cfapi_object_merge (int *type,...) |
void * | cfapi_object_move (int *type,...) |
void * | cfapi_object_on_same_map (int *type,...) |
void * | cfapi_object_pay_amount (int *type,...) |
void * | cfapi_object_pay_item (int *type,...) |
void * | cfapi_object_pickup (int *type,...) |
void * | cfapi_object_query_cost (int *type,...) |
void * | cfapi_object_query_money (int *type,...) |
void * | cfapi_object_remove (int *type,...) |
void * | cfapi_object_reset (int *type,...) |
void * | cfapi_object_say (int *type,...) |
void * | cfapi_object_set_key (int *type,...) |
void * | cfapi_object_set_property (int *type,...) |
void * | cfapi_object_split (int *type,...) |
void * | cfapi_object_spring_trap (int *type,...) |
void * | cfapi_object_teleport (int *type,...) |
void * | cfapi_object_transfer (int *type,...) |
void * | cfapi_object_transmute (int *type,...) |
void * | cfapi_object_update (int *type,...) |
void * | cfapi_object_user_event (int *type,...) |
void * | cfapi_party_get_property (int *type,...) |
void * | cfapi_player_can_pay (int *type,...) |
void * | cfapi_player_find (int *type,...) |
void * | cfapi_player_message (int *type,...) |
void * | cfapi_region_get_property (int *type,...) |
void * | cfapi_set_random_map_variable (int *type,...) |
void * | cfapi_system_add_string (int *type,...) |
void * | cfapi_system_check_path (int *type,...) |
void * | cfapi_system_directory (int *type,...) |
void * | cfapi_system_find_animation (int *type,...) |
void * | cfapi_system_find_face (int *type,...) |
void * | cfapi_system_find_string (int *type,...) |
void * | cfapi_system_re_cmp (int *type,...) |
void * | cfapi_system_register_global_event (int *type,...) |
void * | cfapi_system_remove_string (int *type,...) |
void * | cfapi_system_strdup_local (int *type,...) |
void * | cfapi_system_unregister_global_event (int *type,...) |
void * | cfapi_timer_create (int *type,...) |
void * | cfapi_timer_destroy (int *type,...) |
int | cftimer_create (int id, long delay, object *ob, int mode) |
int | cftimer_destroy (int id) |
int | cftimer_find_free_id (void) |
void | cftimer_init (void) |
void | cftimer_process_timers (void) |
int | change_skill (object *who, object *new_skill, int flag) |
void | change_spell (object *op, char k) |
void | check_active_maps (void) |
void | check_bullet (object *op) |
void | check_doors (object *op, mapstruct *m, int x, int y) |
void | check_earthwalls (object *op, mapstruct *m, int x, int y) |
object * | check_enemy (object *npc, rv_vector *rv) |
void | check_login (object *op) |
int | check_name (player *me, const char *name) |
int | check_password (char *typed, char *crypted) |
void | check_physically_infect (object *victim, object *hitter) |
int | check_pick (object *op) |
void | check_score (object *op, int quiet) |
void | check_spell_expiry (object *spell) |
object * | check_spell_known (object *op, const char *name) |
void | check_spells (void) |
int | check_weapon_power (const object *who, int improvs) |
int | checkbanned (const char *login, const char *host) |
void | clean_tmp_files (void) |
void | cleanup (void) |
void | cleanupPlugins (void) |
void | clear_skill (object *who) |
int | command_abil (object *op, char *params) |
int | command_accuse (object *op, char *params) |
int | command_addexp (object *op, char *params) |
int | command_afk (object *op, char *params) |
int | command_apply (object *op, char *params) |
int | command_applymode (object *op, char *params) |
int | command_archs (object *op, char *params) |
int | command_arrest (object *op, char *params) |
int | command_banish (object *op, char *params) |
int | command_beg (object *op, char *params) |
int | command_bleed (object *op, char *params) |
int | command_blush (object *op, char *params) |
int | command_body (object *op, char *params) |
int | command_bounce (object *op, char *params) |
int | command_bow (object *op, char *params) |
int | command_bowmode (object *op, char *params) |
int | command_brace (object *op, char *params) |
int | command_burp (object *op, char *params) |
int | command_cackle (object *op, char *params) |
int | command_cast (object *op, char *params) |
int | command_cast_spell (object *op, char *params, char command) |
int | command_chat (object *op, char *params) |
int | command_chuckle (object *op, char *params) |
int | command_clap (object *op, char *params) |
int | command_cointoss (object *op, char *params) |
int | command_cough (object *op, char *params) |
int | command_create (object *op, char *params) |
int | command_cringe (object *op, char *params) |
int | command_cry (object *op, char *params) |
int | command_dance (object *op, char *params) |
int | command_debug (object *op, char *params) |
int | command_diff (object *op, char *params) |
int | command_disarm (object *op, char *params) |
int | command_dm (object *op, char *params) |
int | command_dmhide (object *op, char *params) |
int | command_dmtell (object *op, char *params) |
int | command_drop (object *op, char *params) |
int | command_dropall (object *op, char *params) |
int | command_dump (object *op, char *params) |
int | command_dumpallarchetypes (object *op, char *params) |
int | command_dumpallmaps (object *op, char *params) |
int | command_dumpallobjects (object *op, char *params) |
int | command_dumpbelow (object *op, char *params) |
int | command_dumpfriendlyobjects (object *op, char *params) |
int | command_dumpmap (object *op, char *params) |
int | command_east (object *op, char *params) |
int | command_empty (object *op, char *params) |
int | command_examine (object *op, char *params) |
int | command_explore (object *op, char *params) |
int | command_fire (object *op, char *params) |
int | command_fire_stop (object *op, char *params) |
int | command_fix_me (object *op, char *params) |
int | command_flip (object *op, char *params) |
int | command_follow (object *op, char *params) |
int | command_forget_spell (object *op, char *params) |
int | command_free (object *op, char *params) |
int | command_freeze (object *op, char *params) |
int | command_frown (object *op, char *params) |
int | command_gasp (object *op, char *params) |
int | command_giggle (object *op, char *params) |
int | command_glare (object *op, char *params) |
int | command_goto (object *op, char *params) |
int | command_grin (object *op, char *params) |
int | command_groan (object *op, char *params) |
int | command_growl (object *op, char *params) |
int | command_gsay (object *op, char *params) |
int | command_help (object *op, char *params) |
int | command_hiccup (object *op, char *params) |
int | command_hide (object *op, char *params) |
int | command_hiscore (object *op, char *params) |
int | command_hug (object *op, char *params) |
int | command_insert_into (object *op, char *params) |
int | command_inventory (object *op, char *params) |
int | command_invisible (object *op, char *params) |
int | command_invoke (object *op, char *params) |
int | command_kick (object *op, const char *params) |
int | command_kill_pets (object *op, char *params) |
int | command_kiss (object *op, char *params) |
int | command_language (object *op, char *params) |
int | command_laugh (object *op, char *params) |
int | command_learn_special_prayer (object *op, char *params) |
int | command_learn_spell (object *op, char *params) |
int | command_lick (object *op, char *params) |
int | command_listen (object *op, char *params) |
int | command_listplugins (object *op, char *params) |
int | command_loadplugin (object *op, char *params) |
int | command_loadtest (object *op, char *params) |
int | command_lock_item (object *op, char *params) |
int | command_malloc (object *op, char *params) |
int | command_mapinfo (object *op, char *params) |
int | command_maps (object *op, char *params) |
int | command_mark (object *op, char *params) |
int | command_me (object *op, char *params) |
int | command_mon_aggr (object *op, char *params) |
int | command_motd (object *op, char *params) |
int | command_news (object *op, char *params) |
int | command_nod (object *op, char *params) |
int | command_north (object *op, char *params) |
int | command_northeast (object *op, char *params) |
int | command_northwest (object *op, char *params) |
int | command_nowiz (object *op, char *params) |
int | command_orcknuckle (object *op, char *params) |
int | command_output_count (object *op, char *params) |
int | command_output_sync (object *op, char *params) |
int | command_overlay_reset (object *op, char *params) |
int | command_overlay_save (object *op, char *params) |
int | command_party (object *op, char *params) |
int | command_party_rejoin (object *op, char *params) |
int | command_passwd (object *pl, char *params) |
int | command_patch (object *op, char *params) |
int | command_peaceful (object *op, char *params) |
int | command_petmode (object *op, char *params) |
int | command_pickup (object *op, char *params) |
int | command_players (object *op, char *params) |
int | command_poke (object *op, char *params) |
int | command_possess (object *op, char *params) |
int | command_pout (object *op, char *params) |
int | command_prepare (object *op, char *params) |
int | command_printlos (object *op, char *params) |
int | command_puke (object *op, char *params) |
int | command_quit (object *op, char *params) |
int | command_remove (object *op, char *params) |
int | command_rename_item (object *op, char *params) |
int | command_reply (object *op, char *params) |
int | command_reset (object *op, char *params) |
int | command_resistances (object *op, char *params) |
int | command_rotateshoottype (object *op, char *params) |
int | command_rskill (object *pl, char *params) |
int | command_rules (object *op, char *params) |
int | command_run (object *op, char *params) |
int | command_run_stop (object *op, char *params) |
int | command_save (object *op, char *params) |
int | command_say (object *op, char *params) |
int | command_scream (object *op, char *params) |
int | command_search (object *op, char *params) |
int | command_search_items (object *op, char *params) |
int | command_setgod (object *op, char *params) |
int | command_shake (object *op, char *params) |
int | command_shiver (object *op, char *params) |
int | command_shout (object *op, char *params) |
int | command_showpets (object *op, char *params) |
int | command_shrug (object *op, char *params) |
int | command_shutdown (object *op, char *params) |
int | command_sigh (object *op, char *params) |
int | command_skills (object *op, char *params) |
int | command_slap (object *op, char *params) |
int | command_smile (object *op, char *params) |
int | command_smirk (object *op, char *params) |
int | command_snap (object *op, char *params) |
int | command_sneeze (object *op, char *params) |
int | command_snicker (object *op, char *params) |
int | command_sniff (object *op, char *params) |
int | command_snore (object *op, char *params) |
int | command_sound (object *op, char *params) |
int | command_south (object *op, char *params) |
int | command_southeast (object *op, char *params) |
int | command_southwest (object *op, char *params) |
int | command_speed (object *op, char *params) |
int | command_spit (object *op, char *params) |
int | command_ssdumptable (object *op, char *params) |
int | command_stack_clear (object *op, char *params) |
int | command_stack_list (object *op, char *params) |
int | command_stack_pop (object *op, char *params) |
int | command_stack_push (object *op, char *params) |
int | command_statistics (object *pl, char *params) |
int | command_stats (object *op, char *params) |
int | command_stay (object *op, char *params) |
int | command_strings (object *op, char *params) |
int | command_strut (object *op, char *params) |
int | command_style_map_info (object *op, char *params) |
int | command_sulk (object *op, char *params) |
int | command_summon (object *op, char *params) |
int | command_take (object *op, char *params) |
int | command_teleport (object *op, char *params) |
int | command_tell (object *op, char *params) |
int | command_thank (object *op, char *params) |
int | command_think (object *op, char *params) |
int | command_throw (object *op, char *params) |
int | command_time (object *op, char *params) |
int | command_title (object *op, char *params) |
int | command_toggle_shout (object *op, char *params) |
int | command_twiddle (object *op, char *params) |
int | command_unloadplugin (object *op, char *params) |
int | command_use (object *op, char *params) |
int | command_usekeys (object *op, char *params) |
int | command_uskill (object *pl, char *params) |
int | command_version (object *op, char *params) |
int | command_wave (object *op, char *params) |
int | command_west (object *op, char *params) |
int | command_whereabouts (object *op, char *params) |
int | command_whereami (object *op, char *params) |
int | command_whistle (object *op, char *params) |
int | command_who (object *op, char *params) |
int | command_wimpy (object *op, char *params) |
int | command_wink (object *op, char *params) |
int | command_wizcast (object *op, char *params) |
int | command_wizpass (object *op, char *params) |
int | command_yawn (object *op, char *params) |
void | communicate (object *op, const char *txt) |
int | compute_path (object *source, object *target, int default_dir) |
void | cone_drop (object *op) |
int | confirm_party_password (object *op) |
void | confirm_password (object *op) |
void | confuse_living (object *op, object *hitter, int dam) |
void | control_golem (object *op, int dir) |
int | coords_in_shop (mapstruct *map, int x, int y) |
void | counterspell (object *op, int dir) |
int | create_aura (object *op, object *caster, object *spell) |
int | create_bomb (object *op, object *caster, int dir, object *spell) |
char * | crypt_string (char *str, char *salt) |
int | cure_disease (object *sufferer, object *caster) |
void | current_map_info (object *op) |
void | current_region_info (object *op) |
void | dead_player (object *op) |
void | delete_character (const char *name) |
int | describe_shop (const object *op) |
void | destroy_object (object *op) |
const char * | determine_god (object *op) |
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 *caster, object *spell, object *skill, int dir) |
void | display_high_score (object *op, int max, const char *match) |
void | display_motd (const object *op) |
void | display_who_entry (object *op, player *pl, const char *format) |
object * | dm_stack_peek (player *pl) |
void | dm_stack_pop (player *pl) |
void | dm_stack_push (player *pl, tag_t item) |
void | do_forget_spell (object *op, const char *spell) |
int | do_harvest (object *pl, int dir, object *skill) |
void | do_hidden_move (object *op) |
void | do_learn_spell (object *op, object *spell, int special_prayer) |
int | do_skill (object *op, object *part, object *skill, int dir, const char *string) |
void | do_some_living (object *op) |
int | do_wizard_dm (object *op, char *params, int silent) |
void | do_wizard_hide (object *op, int silent_dm) |
void | dragon_ability_gain (object *who, int atnr, int level) |
void | drain_rod_charge (object *rod) |
void | drain_wand_charge (object *wand) |
void | drop (object *op, object *tmp) |
object * | drop_object (object *op, object *tmp, uint32 nrof) |
void | dump_spells (void) |
void | emergency_save (int flag) |
void | enter_exit (object *op, object *exit_ob) |
void | enter_player_savebed (object *op) |
void | examine (object *op, object *tmp) |
void | examine_monster (object *op, object *tmp) |
int | execute_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix) |
int | execute_global_event (int eventcode,...) |
int | execute_newserver_command (object *pl, char *command) |
void | explode_bullet (object *op) |
const object * | find_god (const char *name) |
object * | find_key (object *pl, object *container, object *door) |
object * | find_marked_object (object *op) |
object * | find_mon_throw_ob (object *op) |
object * | find_nearest_living_creature (object *npc) |
player * | find_player (const char *plname) |
player * | find_player_partial_name (const char *plname) |
command_array_struct * | find_plugin_command (char *cmd, object *op) |
racelink * | find_racelink (const char *name) |
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 | fire (object *op, int dir) |
int | fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell) |
int | fire_bolt (object *op, object *caster, int dir, object *spob, object *skill) |
int | fire_bow (object *op, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy) |
int | fire_bullet (object *op, object *caster, int dir, object *spob) |
int | fire_swarm (object *op, object *caster, object *spell, int dir) |
void | fix_auto_apply (mapstruct *m) |
void | fix_luck (void) |
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) |
void | follow_owner (object *ob, object *owner) |
int | forbid_play (void) |
partylist * | form_party (object *op, const char *params) |
int | free_no_drop (object *op) |
void | free_server (void) |
int | friendly_fire (object *op, object *hitter) |
object * | get_dm_object (player *pl, char **params, int *from) |
partylist * | get_firstparty (void) |
void | get_name (object *op) |
object * | get_nearest_player (object *mon) |
void | get_party_password (object *op, partylist *party) |
void | get_password (object *op) |
int | get_payment (object *pl, object *op) |
object * | get_pet_enemy (object *pet, rv_vector *rv) |
void | get_who_escape_code_value (char *return_val, int size, const char letter, player *pl) |
void | give_initial_items (object *pl, treasurelist *items) |
void | handle_apply_yield (object *tmp) |
int | handle_newcs_player (object *op) |
int | hide (object *op, object *skill) |
int | hideability (object *ob) |
int | hit_map (object *op, int dir, uint32 type, int full_hit) |
int | hit_player (object *op, int dam, object *hitter, uint32 type, int full_hit) |
object * | hit_with_arrow (object *op, object *victim) |
int | infect_object (object *victim, object *disease, int force) |
void | init (int argc, char **argv) |
void | init_commands (void) |
void | init_ob_methods (void) |
void | init_skills (void) |
int | initPlugins (void) |
void | inventory (object *op, object *inv) |
int | is_in_shop (object *ob) |
int | is_true_undead (object *op) |
int | jump (object *pl, int dir, object *skill) |
void | key_change_class (object *op, char key) |
void | key_confirm_quit (object *op, char key) |
void | key_roll_stat (object *op, char key) |
void | kill_player (object *op) |
int | learn_skill (object *pl, object *scroll) |
void | leave (player *pl, int draw_exit) |
void | legacy_animate_trigger (object *op) |
void | legacy_apply_container (object *op, object *sack) |
void | legacy_move_hole (object *op) |
void | legacy_remove_force (object *op) |
int | legal_range (object *op, int r) |
void | link_player_skills (object *op) |
void | list_players (object *op, region *reg, partylist *party) |
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) |
void | malloc_info (object *op) |
int | manual_apply (object *op, object *tmp, int aflag) |
void | map_info (object *op, char *search) |
void | meditate (object *pl, object *skill) |
int | min_casting_level (const object *caster, const object *spell) |
void | monster_check_apply (object *mon, object *item) |
int | mood_change (object *op, object *caster, object *spell) |
int | move_disease (object *disease) |
void | move_firewall (object *op) |
void | move_golem (object *op) |
int | move_monster (object *op) |
int | move_ob (object *op, int dir, object *originator) |
int | move_object (object *op, int dir) |
int | move_player (object *op, int dir) |
void | move_player_attack (object *op, int dir) |
void | move_player_mover (object *op) |
void | move_symptom (object *symptom) |
int | move_to (object *op, int x, int y) |
void | npc_call_help (object *op) |
void | npc_say (object *npc, const char *cp) |
void | obsolete_parties (void) |
int | ok_to_put_more (mapstruct *m, sint16 x, sint16 y, object *op, uint32 immune_stop) |
int | onoff_value (const char *line) |
int | op_on_battleground (object *op, int *x, int *y, archetype **trophy) |
void | paralyze_living (object *op, object *hitter, int dam) |
int | path_to_player (object *mon, object *pl, unsigned mindiff) |
int | pay_for_amount (uint64 to_pay, object *pl) |
int | pay_for_item (object *op, object *pl) |
int | perceive_self (object *op) |
void | pet_move (object *ob) |
int | pick_lock (object *pl, int dir, object *skill) |
void | pick_up (object *op, object *alt) |
void | play_again (object *op) |
int | player_apply (object *pl, object *op, int aflag, int quiet) |
void | player_apply_below (object *pl) |
int | player_can_view (object *pl, object *op) |
void | player_unready_range_ob (player *pl, object *ob) |
int | playername_ok (const char *cp) |
int | players_on_map (mapstruct *m, int show_all) |
void | plugins_display_list (object *op) |
crossfire_plugin * | plugins_find_plugin (const char *id) |
int | plugins_init_plugin (const char *libfile) |
int | plugins_remove_plugin (const char *id) |
void | polymorph (object *op, object *who, int level) |
int | pray (object *pl, object *skill) |
void | pray_at_altar (object *pl, object *altar, object *skill) |
int | probe (object *op, object *caster, object *spell_ob, int dir) |
void | process_events (void) |
int | process_object (object *op) |
int | push_ob (object *who, int dir, object *pusher) |
void | put_object_in_sack (object *op, object *sack, object *tmp, uint32 nrof) |
uint64 | query_cost (const object *tmp, object *who, int flag) |
StringBuffer * | query_cost_string (const object *tmp, object *who, int flag, StringBuffer *buf) |
uint64 | query_money (const object *op) |
void | read_map_log (void) |
void | receive_party_password (object *op) |
void | receive_play_again (object *op, char key) |
void | receive_player_name (object *op) |
void | receive_player_password (object *op) |
int | recharge (object *op, object *caster, object *spell_ob) |
void | recursive_roll (object *op, int dir, object *pusher) |
int | reflwall (mapstruct *m, int x, int y, object *sp_op) |
void | regenerate_rod (object *rod) |
void | register_all_ob_types (void) |
void | remove_all_pets (void) |
int | remove_curse (object *op, object *caster, object *spell) |
void | remove_door (object *op) |
void | remove_locked_door (object *op) |
void | remove_party (partylist *target_party) |
int | remove_trap (object *op, object *skill) |
void | remove_unpaid_objects (object *op, object *env, int free_items) |
void | roll_again (object *op) |
int | roll_stat (void) |
void | roll_stats (object *op) |
int | sack_can_hold (const object *pl, const object *sack, const object *op, uint32 nrof) |
int | save_player (object *op, int flag) |
void | save_throw_object (object *op, uint32 type, object *originator) |
void | scroll_failure (object *op, int failure, int power) |
void | sell_item (object *op, object *pl) |
void | send_news (const object *op) |
void | send_party_message (object *op, char *msg) |
void | send_rules (const object *op) |
int | server_main (int argc, char **argv) |
void | set_darkness_map (mapstruct *m) |
void | set_map_timeout (mapstruct *oldmap) |
int | set_object_face_main (object *op) |
void | set_spell_skill (object *op, object *caster, object *spob, object *dest) |
double | shopkeeper_approval (const mapstruct *map, const object *player) |
int | should_arena_attack (object *pet, object *owner, object *target) |
int | should_director_abort (object *op, object *victim) |
void | show_skills (object *op, const char *search) |
void | shuffle_attack (object *op, int change_face) |
int | similar_direction (int a, int b) |
int | singing (object *pl, int dir, object *skill) |
int | skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill) |
int | skill_ident (object *pl, object *skill) |
int | skill_throw (object *op, object *part, int dir, const char *params, object *skill) |
int | SP_level_dam_adjust (const object *caster, const object *spob) |
int | SP_level_duration_adjust (const object *caster, const object *spob) |
int | SP_level_range_adjust (const object *caster, const object *spob) |
sint16 | SP_level_spellpoint_cost (object *caster, object *spell, int flags) |
void | spell_effect (object *spob, int x, int y, mapstruct *map, object *originator) |
void | spell_failure (object *op, int failure, int power, object *skill) |
int | spell_find_dir (mapstruct *m, int x, int y, object *exclude) |
void | spring_trap (object *trap, object *victim) |
int | stand_in_light (object *op) |
int | stand_near_hostile (object *who) |
void | start_info (object *op) |
int | steal (object *op, int dir, object *skill) |
object * | stop_item (object *op) |
void | store_spell_expiry (object *spell) |
int | summon_golem (object *op, object *caster, int dir, object *spob) |
int | summon_hostile_monsters (object *op, int n, const char *monstername) |
int | summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg) |
void | swap_below_max (const char *except_level) |
int | swap_map (mapstruct *map) |
int | tailor_god_spell (object *spellop, object *caster) |
int | teleport (object *teleporter, uint8 tele_type, object *user) |
void | terminate_all_pets (object *owner) |
void | tick_the_clock (void) |
int | transfer_ob (object *op, int x, int y, int randomly, object *originator) |
int | transport_can_hold (const object *transport, const object *op, int nrof) |
void | trap_adjust (object *trap, int difficulty) |
int | trap_disarm (object *disarmer, object *trap, int risk, object *skill) |
int | trap_see (object *op, object *trap) |
int | trap_show (object *trap, object *where) |
int | use_alchemy (object *op) |
int | use_oratory (object *pl, int dir, object *skill) |
int | use_skill (object *op, const char *string) |
int | user_event (object *op, object *activator, object *third, const char *message, int fix) |
int | verify_player (const char *name, char *password) |
void | version (object *op) |
int | write_mark (object *op, object *spell, const char *msg) |
int | write_on_item (object *pl, const char *params, object *skill) |
int | write_rune (object *op, object *caster, object *spell, int dir, const char *runename) |
void add_player | ( | socket_struct * | ns | ) |
Tries to add player on the connection passwd in ns.
Player object is created and put on the first map, rules/news/motd are sent.
ns | connection. |
Definition at line 383 of file player.c.
References add_friendly_object(), CLEAR_FLAG, display_motd(), socket_struct::faces_sent, fatal(), FLAG_FRIENDLY, get_name(), get_player(), socket_struct::inbuf, pl::ob, OUT_OF_MEMORY, send_news(), send_rules(), set_first_map(), pl::socket, and SockList_ResetRead().
Referenced by add_me_cmd().
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 2208 of file spell_effect.c.
References obj::above, alchemy_object(), obj::below, obj::contr, create_archetype(), obj::duration, F_TRUE, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::inv, large_value, socket_struct::look_position, obj::map, MOVE_WALK, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, query_cost(), QUERY_FLAG, small_value, pl::socket, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::type, obj::weight, obj::x, and obj::y.
Referenced by cast_spell().
Generalization of staff_to_snake(). Makes a golem out of the caster's weapon. The golem is based on the archetype specified, modified by the caster's level and the attributes of the weapon. The weapon is inserted in the golem's inventory so that it falls to the ground when the golem dies. This code was very odd - code early on would only let players use the spell, yet the code wass full of player checks. I've presumed that the code that only let players use it was correct, and removed all the other player checks. MSW 2003-01-06
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 2954 of file spell_effect.c.
References add_friendly_object(), add_string(), obj::anim_speed, obj::animation_id, obj::arch, arch_to_object(), AT_PHYSICAL, ATNR_BLIND, ATNR_CONFUSION, ATNR_DEATH, ATNR_DEPLETE, ATNR_FEAR, ATNR_PARALYZE, ATNR_PHYSICAL, ATNR_POISON, ATNR_SLOW, ATNR_TURN_UNDEAD, obj::attacktype, caster_level(), CLEAR_FLAG, archt::clone, liv::Con, obj::contr, control_golem(), obj::count, liv::dam, liv::Dex, obj::direction, draw_ext_info(), draw_ext_info_format(), obj::duration, esrv_update_item(), liv::exp, obj::face, find_free_spot(), find_marked_object(), fix_object(), FLAG_ANIMATE, FLAG_APPLIED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_REMOVED, FLAG_UNPAID, FLAG_USE_WEAPON, free_string(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_split_ob(), GOLEM, pl::golem_count, liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::last_anim, llevError, LOG(), obj::magic, obj::map, obj::materialname, MAX, MAX_BUF, liv::maxgrace, liv::maxhp, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, archt::name, name_to_material(), NDI_BLACK, NDI_UNIQUE, obj::nrof, NROFATTACKS, obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, query_name(), obj::race, range_golem, pl::ranges, remove_ob(), obj::resist, _materialtype::save, SET_FLAG, set_owner(), set_spell_skill(), pl::shoottype, snprintf(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::speed, obj::speed_left, obj::state, obj::stats, liv::Str, obj::type, UPD_NROF, update_ob_speed(), liv::wc, WEAPON, obj::x, and obj::y.
Referenced by cast_spell().
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 907 of file build_map.c.
References obj::above, BUTTON, CF_HANDLE, DETECTOR, DOOR, draw_ext_info(), draw_ext_info_format(), FLAG_IS_FLOOR, FLAG_IS_LINKED, FLOOR, free_object(), freearr_x, freearr_y, GATE, GET_MAP_OB, llevError, LOG(), MAGIC_EAR, obj::map, MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, archt::name, NDI_UNIQUE, mapdef::path, PEDESTAL, QUERY_FLAG, query_name(), remove_button_link(), remove_ob(), SIGN, TIMED_GATE, obj::type, WALL, obj::x, and obj::y.
Referenced by apply_map_builder().
Applies (race) changes to a player.
pl | object to change. |
change | what kind of changes to apply. Should be of type CLASS. |
Definition at line 1776 of file apply.c.
References obj::anim_speed, obj::anim_suffix, animate_object(), obj::animation_id, animations, obj::arch, obj::below, CHA, change_attr_value(), CLASS, CLEAR_FLAG, archt::clone, obj::contr, obj::face, obj::facing, FLAG_ANIMATE, FLAG_USE_WEAPON, GET_ANIM_ID, get_attr_value(), give_initial_items(), obj::inv, MAX_BUF, animations_struct::name, obj::name, NUM_STATS, pl::orig_stats, QUERY_FLAG, obj::randomitems, rndm(), set_attr_value(), SET_FLAG, snprintf(), obj::stats, try_find_animation(), and obj::type.
Referenced by player_changer_type_process().
Handle apply on containers. This is for containers that are applied by a player, whether in inventory or on the ground: eg, sacks, luggages, etc.
Moved to own function and added many features [Tero.Haatanen(at)lut.fi] This version is for client/server mode.
Reminder - there are three states for any container - closed (non applied), applied (not open, but objects that match get tossed into it), and open (applied flag set, and op->container points to the open container)
op | player. |
sack | container the player is opening or closing. |
Definition at line 230 of file apply.c.
References CLEAR_FLAG, obj::container, CONTAINER, draw_ext_info_format(), obj::env, esrv_send_inventory(), esrv_send_item(), esrv_update_item(), EVENT_CLOSE, execute_event(), find_key(), FLAG_APPLIED, get_split_ob(), INS_NO_MERGE, insert_ob_in_map_at(), insert_ob_in_ob(), llevError, LOG(), obj::map, MAX_BUF, MOVE_ALL, obj::move_off, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, obj::name, NDI_UNIQUE, obj::nrof, PLAYER, QUERY_FLAG, query_name(), SCRIPT_FIX_ALL, SET_FLAG, set_object_face_main(), set_object_face_other(), obj::slaying, obj::type, UPD_FACE, UPD_FLAGS, obj::x, and obj::y.
Referenced by legacy_apply_container(), and loot_object().
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 978 of file build_map.c.
References obj::above, apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), obj::arch, can_build_over(), obj::contr, decrease_ob, draw_ext_info(), find_archetype(), find_marked_object(), FLAG_IS_BUILDABLE, freearr_x, freearr_y, GET_MAP_OB, llevError, LOG(), obj::map, MAP_HEIGHT, MAP_WIDTH, MATERIAL, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, archt::name, NDI_UNIQUE, object_create_arch(), mapdef::path, PLAYER, QUERY_FLAG, range_builder, pl::ranges, SET_FLAG, SIGN, obj::slaying, ST_BD_BUILD, ST_BD_REMOVE, ST_MAT_FLOOR, ST_MAT_ITEM, ST_MAT_WALL, ST_MAT_WINDOW, obj::subtype, obj::type, obj::x, and obj::y.
Referenced by fire().
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 1139 of file apply.c.
References AMULET, AP_APPLY, AP_BASIC_FLAGS, AP_IGNORE_CURSE, AP_NOPRINT, AP_PRINT, AP_UNAPPLY, ARMOUR, BOOTS, BOW, BRACERS, BUILDER, CAN_APPLY_NEVER, can_apply_object(), CAN_APPLY_RESTRICTION, CAN_APPLY_UNAPPLY_CHOICE, change_abil(), change_skill(), check_weapon_power(), obj::chosen_skill, CLOAK, obj::contr, draw_ext_info(), draw_ext_info_format(), obj::env, esrv_update_item(), liv::exp, find_skill_by_name(), fix_object(), FLAG_APPLIED, FLAG_BEEN_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SKILL, FLAG_READY_WEAPON, get_ob_key_value(), get_split_ob(), GIRDLE, GLOVES, HELMET, HORN, liv::hp, insert_ob_in_ob(), obj::invisible, pl::item_power, obj::item_power, Settings::item_power_factor, obj::last_eat, obj::level, llevError, LOG(), MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BADBODY, MSG_TYPE_APPLY_CURSED, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_PROHIBITION, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_HIT, obj::name, NDI_UNIQUE, obj::nrof, Settings::personalized_blessings, PLAYER, QUERY_FLAG, query_name(), obj::race, random_roll(), range_bow, range_builder, range_misc, range_skill, pl::ranges, RING, ROD, SET_FLAG, settings, SHIELD, pl::shoottype, SKILL, obj::skill, SKILL_TOOL, obj::stats, obj::type, pl::unapply, unapply_always, unapply_for_ob(), unapply_never, unapply_nochoice, unapply_special(), UPD_FLAGS, UPD_NROF, UPD_WEIGHT, WAND, and WEAPON.
Referenced by adjust_skill_tool(), attack_hth(), change_skill(), drop_object(), find_throw_ob(), improve_armour(), improve_weapon(), legacy_ob_apply(), put_object_in_sack(), and stop_using_item().
Simple wrapper for attack_ob_simple(), will use hitter's values.
op | victim. |
hitter | attacker. |
Definition at line 929 of file attack.c.
References attack_ob_simple(), liv::dam, obj::head, obj::stats, and liv::wc.
Referenced by do_skill_attack(), and move_golem().
int auto_apply | ( | object * | op | ) |
Map was just loaded, handle op's initialisation.
Generates shop floor's item, and treasures.
op | object to initialize. |
Definition at line 85 of file standalone.c.
References obj::below, CLEAR_FLAG, create_treasure(), mapdef::difficulty, obj::env, liv::exp, FLAG_AUTO_APPLY, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_A_TEMPLATE, FLAG_UNPAID, free_object(), generate_treasure(), GT_ENVIRONMENT, HAS_RANDOM_ITEMS, liv::hp, identify(), insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::map, MAX, QUERY_FLAG, obj::randomitems, remove_ob(), SET_FLAG, SHOP_FLOOR, obj::stats, TREASURE, obj::type, obj::x, and obj::y.
Referenced by do_auto_apply(), and fix_auto_apply().
void become_daemon | ( | void | ) |
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).
op | player switching cults. |
new_god | new god to worship. |
Definition at line 502 of file gods.c.
References add_string(), ARMOUR, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_POISON, obj::below, BOOK, BOOTS, cast_magic_storm(), change_abil(), check_special_prayers(), CLEAR_FLAG, archt::clone, obj::contr, create_archetype(), determine_god(), draw_ext_info_format(), EXPERIENCE, find_god(), FLAG_APPLIED, FLAG_BLIND, FLAG_MAKE_INVIS, FLAG_REFL_MISSILE, FLAG_REFL_SPELL, FLAG_SEE_IN_DARK, FLAG_STARTEQUIP, FLAG_STEALTH, FLAG_UNDEAD, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FLAG_XRAYS, follower_remove_given_items(), liv::food, FORCE, free_object(), free_string(), get_archetype_by_type_subtype(), give_skill_by_name(), GLOVES, god_gives_present(), liv::grace, HELMET, liv::hp, obj::inv, obj::invisible, treasurestruct::item, treasureliststruct::items, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, link_player_skills(), LOOSE_MANA, liv::luck, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, obj::name, NDI_NAVY, NDI_UNIQUE, treasurestruct::next, NROFATTACKS, obj::path_attuned, obj::path_denied, obj::path_repelled, player_unready_range_ob(), PREFER_LOW, present_in_ob_by_name(), QUERY_FLAG, obj::race, random_roll(), obj::randomitems, remove_ob(), obj::resist, SET_FLAG, SHIELD, SK_PRAYING, SKILL, obj::slaying, liv::sp, SPELL, SPELLBOOK, obj::stats, stop_using_item(), obj::subtype, obj::title, obj::type, update_priest_flag(), WEAPON, and worship_forbids_use().
Referenced by command_setgod(), and pray_at_altar().
Blind a living thing.
op | victim. |
hitter | who is attacking. |
dam | damage to deal. |
Definition at line 2276 of file attack.c.
References ATNR_BLIND, BLINDNESS, change_abil(), create_archetype(), draw_ext_info_format(), fix_object(), FLAG_APPLIED, FLAG_BLIND, liv::food, get_owner(), insert_ob_in_ob(), MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, NDI_UNIQUE, obj::owner, present_in_ob(), query_name(), obj::resist, SET_FLAG, obj::speed, and obj::stats.
Referenced by hit_with_one_attacktype(), and scroll_failure().
Calculates amount of experience can be gained for successfull use of a skill.
Here we take the view that a player must 'overcome an opponent' in order to gain experience. Examples include foes killed combat, finding/disarming a trap, stealing from somebeing, etc.
The gained experience is based primarily on the difference in levels, exp point value of vanquished foe, the relevent stats of the skill being used and modifications in the skills[] table.
For now, monsters and players will be treated differently. Below I give the algorithm for *PLAYER *experience gain. Monster exp gain is simpler. Monsters just get 10% of the exp of the opponent.
Players get a ratio, eg, opponent lvl / player level. This is then multiplied by various things. If simple exp is true, then this multiplier, include the level difference, is always 1. This revised method prevents some cases where there are big gaps in the amount you get just because you are now equal level vs lower level
who | player/creature that used the skill. |
op | object that was 'defeated'. |
skill | used skill. If none, it should just point back to who. |
Definition at line 599 of file skill_util.c.
References obj::arch, liv::Cha, archt::clone, mapdef::difficulty, liv::exp, FLAG_ALIVE, obj::level, llevDebug, LOG(), obj::magic, obj::map, MAX, obj::name, PLAYER, QUERY_FLAG, RUNE, settings, Settings::simple_exp, SKILL, obj::stats, TRAP, and obj::type.
Referenced by attempt_jump(), book_type_apply(), do_hidden_move(), do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident2(), find_traps(), hide(), kill_object(), pick_lock(), remove_trap(), scroll_type_apply(), singing(), spellbook_type_apply(), steal(), use_oratory(), and write_scroll().
Checks to see if 'who' can apply object 'op'.
who | living thing trying to apply op. |
op | object applied. |
Definition at line 955 of file apply.c.
References obj::below, obj::body_info, obj::body_used, BOW, CAN_APPLY_NEVER, CAN_APPLY_RESTRICTION, CAN_APPLY_UNAPPLY, CAN_APPLY_UNAPPLY_CHOICE, CAN_APPLY_UNAPPLY_MULT, FABS, FLAG_APPLIED, FLAG_USE_ARMOUR, FLAG_USE_BOW, FLAG_USE_RANGE, FLAG_USE_RING, FLAG_USE_SHIELD, FLAG_USE_WEAPON, get_item_from_body_location(), HORN, obj::inv, IS_ARMOR, IS_SHIELD, IS_WEAPON, NUM_BODY_LOCATIONS, PLAYER, QUERY_FLAG, RING, ROD, SHIELD, obj::type, WAND, and WEAPON.
Referenced by apply_special(), and monster_check_apply().
Definition at line 2020 of file monster.c.
References can_see_enemy(), obj::contr, find_skill_by_number(), FLAG_WIZ, get_rangevector(), pl::hidden, obj::hide, liv::Int, obj::invisible, obj::level, llevError, LOG(), make_visible(), obj::map, MAX, MIN_MON_RADIUS, on_same_map(), PLAYER, QUERY_FLAG, SK_HIDING, obj::stats, pl::tmp_invis, obj::type, and liv::Wis.
Referenced by attempt_steal(), check_enemy(), get_nearest_player(), and get_pet_enemy().
int can_pay | ( | object * | pl | ) |
Checks all unpaid items in op's inventory, adds up all the money they have, and checks that they can actually afford what they want to buy. Prints appropriate messages to the player.
pl | player trying to bug. |
1 | player could buy the items. |
0 | some items can't be bought. |
Definition at line 938 of file shop.c.
References coins, cost_string_from_value(), count_unpaid(), draw_ext_info(), find_archetype(), obj::inv, llevError, LOG(), make_list_like(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_PAYMENT, NDI_UNIQUE, NUM_COINS, PLAYER, query_money(), snprintf(), stringbuffer_finish(), and obj::type.
Referenced by cfapi_player_can_pay(), and shop_mat_type_move_on().
Definition at line 2199 of file monster.c.
References mapdef::darkness, draw_ext_info(), FLAG_ALIVE, FLAG_BLIND, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_XRAYS, has_carried_lights(), obj::head, obj::hide, obj::invisible, is_true_undead(), make_visible(), makes_invisible_to(), obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, player_can_view(), QUERY_FLAG, stand_in_light(), and obj::type.
Referenced by adj_attackroll(), attack_ob_simple(), can_detect_enemy(), and get_pet_enemy().
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 1965 of file spell_effect.c.
References liv::ac, add_refcount(), add_string(), AT_PHYSICAL, ATNR_GODPOWER, obj::attacktype, obj::below, change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), obj::duration, find_god(), find_target_for_friendly_spell(), fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), insert_ob_in_ob(), obj::inv, MIN, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_SPELL_TARGET, obj::name, obj::name_pl, NDI_UNIQUE, NROFATTACKS, obj::path_attuned, obj::race, obj::resist, SET_FLAG, obj::slaying, SP_level_duration_adjust(), obj::speed, obj::speed_left, obj::stats, obj::subtype, obj::type, and liv::wc.
Referenced by cast_spell().
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 1310 of file spell_attack.c.
References obj::above, liv::ac, ARCH_DETECT_MAGIC, arch_to_object(), caster_level(), create_archetype(), liv::dam, draw_ext_info(), draw_ext_info_format(), liv::exp, obj::facing, FLAG_MONSTER, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::head, liv::hp, infect_object(), insert_ob_in_map(), obj::last_eat, obj::last_sp, obj::level, obj::magic, obj::map, liv::maxgrace, liv::maxhp, liv::maxsp, MOVE_FLY_LOW, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, NDI_UNIQUE, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, set_owner(), set_spell_skill(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::type, liv::wc, obj::x, and obj::y.
Referenced by cast_spell().
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 1825 of file spell_effect.c.
References liv::ac, add_refcount(), obj::attacktype, obj::below, change_abil(), CLEAR_FLAG, create_archetype(), draw_ext_info(), draw_ext_info_format(), obj::duration, liv::exp, find_target_for_friendly_spell(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_SEE_IN_DARK, FLAG_XRAYS, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_attr_value(), liv::hp, insert_ob_in_ob(), obj::inv, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, obj::name_pl, NDI_UNIQUE, no_gain_msgs, NROFATTACKS, NUM_STATS, PLAYER, QUERY_FLAG, obj::race, obj::resist, rndm(), set_attr_value(), SET_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::speed, obj::speed_left, obj::stats, store_spell_expiry(), obj::subtype, obj::type, and liv::wc.
Referenced by cast_spell(), and god_intervention().
This changes the light level for the entire map.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
0 | light not affected. |
1 | light changed. |
Definition at line 3183 of file spell_effect.c.
References change_map_light(), liv::dam, draw_ext_info(), obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, and obj::stats.
Referenced by cast_spell().
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 403 of file spell_attack.c.
References arch_to_object(), AT_FEAR, AT_GODPOWER, AT_HOLYWORD, AT_TURN_UNDEAD, obj::attacktype, caster_level(), liv::Cha, archt::clone, cone_drop(), obj::count, liv::dam, draw_ext_info(), obj::duration, fear_bonus, FLAG_UNDEAD, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::level, llevDebug, LOG(), obj::map, liv::maxhp, MOVE_FLY_LOW, obj::move_on, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, archt::name, NDI_UNIQUE, obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, RUNE, set_owner(), set_spell_skill(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, tailor_god_spell(), turn_bonus, obj::type, liv::Wis, obj::x, and obj::y.
Referenced by cast_spell(), cast_wonder(), prayer_failure(), and spell_failure().
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 2873 of file spell_effect.c.
References arch_to_object(), obj::below, caster_level(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_archetype(), find_god(), FLAG_IS_FLOOR, HOLY_ALTAR, INS_BELOW_ORIGINATOR, insert_ob_in_map(), obj::level, llevError, LOG(), obj::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, NDI_UNIQUE, QUERY_FLAG, remove_ob(), snprintf(), tolower, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
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 639 of file spell_effect.c.
References cast_create_obj(), archt::clone, copy_object(), draw_ext_info(), DRINK, find_archetype_by_object_type_name(), first_archetype, liv::food, FOOD, get_object(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, archt::next, obj::nrof, SP_level_duration_adjust(), obj::stats, obj::type, and obj::value.
Referenced by cast_spell().
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 525 of file spell_effect.c.
References obj::below, BOW, cast_create_obj(), obj::count, create_archetype(), liv::dam, draw_ext_info_format(), obj::duration, find_archetype(), find_artifactlist(), FLAG_APPLIED, FLAG_IDENTIFIED, free_object(), give_artifact_abilities(), obj::inv, artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), obj::magic, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, artifactstruct::next, obj::nrof, pick_up(), PLAYER, QUERY_FLAG, obj::race, SET_FLAG, obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::stats, strcasecmp(), obj::type, obj::value, and was_destroyed.
Referenced by cast_spell().
Creates object new_op in direction dir or if that is blocked, beneath the player (op). we pass 'caster', but don't use it for anything. This is really just a simple wrapper function .
op | who is casting. |
new_op | object to insert. |
dir | direction to insert into. Can be 0. |
Definition at line 517 of file spell_util.c.
References draw_ext_info(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, INS_BELOW_ORIGINATOR, insert_ob_in_map(), obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, obj::x, and obj::y.
Referenced by cast_create_food(), cast_create_missile(), and cast_create_town_portal().
This function cast the spell of town portal for op.
The spell operates in two passes. During the first one a place is marked as a destination for the portal. During the second one, 2 portals are created, one in the position the player cast it and one in the destination place. The portal are synchronized and 2 forces are inserted in the player to destruct the portal next time player creates a new portal pair. This spell has a side effect that it allows people to meet each other in a permanent, private, appartements by making a town portal from it to the town or another public place. So, check if the map is unique and if so return an error
Code by Tchize (david) .del becq@ usa. net
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
0 | spell was insuccessful for some reason. |
1 | spell worked. |
Definition at line 1122 of file spell_effect.c.
References obj::above, add_string(), arch_to_object(), cast_create_obj(), caster_level(), check_inv_recursive(), obj::contr, create_archetype(), Settings::create_home_portals, draw_ext_info(), EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FREE_AND_COPY, free_object(), free_string(), insert_ob_in_map(), insert_ob_in_ob(), mapdef::last_reset_time, llevDebug, llevError, Settings::localdir, LOG(), obj::map, MAP_PLAYER_UNIQUE, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, obj::name_pl, NDI_NAVY, NDI_UNIQUE, obj::other_arch, mapdef::path, present_arch(), obj::race, ready_map_name(), remove_ob(), settings, obj::slaying, snprintf(), pl::transport, obj::weapontype, obj::x, and obj::y.
Referenced by cast_spell().
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 914 of file spell_attack.c.
References liv::ac, add_refcount(), obj::below, change_abil(), create_archetype(), determine_god(), obj::direction, draw_ext_info(), draw_ext_info_format(), obj::duration, find_god(), fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_pointed_target(), insert_ob_in_ob(), obj::inv, obj::last_grace, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_SPELL, obj::name, obj::name_pl, NDI_UNIQUE, obj::path_denied, obj::path_repelled, PLAYER, obj::race, obj::range, SET_FLAG, SP_level_duration_adjust(), obj::speed, obj::speed_left, SPELL_GRACE, obj::stats, obj::subtype, obj::type, and liv::wc.
Referenced by cast_spell().
Hit all monsters around the caster.
op | who is casting. |
caster | what object is casting. |
spell_ob | spell object to cast. |
Definition at line 819 of file spell_attack.c.
References obj::above, arch_to_object(), ATNR_MAGIC, obj::attacktype, change_skill(), liv::dam, obj::duration, find_skill_by_name(), FLAG_ALIVE, FLAG_FRIENDLY, get_map_flags(), GET_MAP_OB, obj::head, hit_player(), insert_ob_in_map(), make_object_glow(), obj::map, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, obj::resist, obj::skill, SP_DESTRUCTION, SP_FAERY_FIRE, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::subtype, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
Detect magic or invisible items.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
Definition at line 2500 of file spell_effect.c.
References obj::above, ALTAR, obj::anim_speed, obj::animation_id, arch_to_object(), AT_MAGIC, obj::attacktype, obj::below, BOOK, BUTTON, caster_level(), CF_HANDLE, liv::Cha, CLEAR_FLAG, determine_god(), esrv_send_item(), EXIT, obj::face, find_god(), FLAG_ANIMATE, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_IS_FLOOR, FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FLAG_MAKE_INVIS, FLAG_MONSTER, FLAG_WIZ, GATE, get_map_flags(), GET_MAP_OB, HOLE, HOLY_ALTAR, insert_ob_in_map(), obj::inv, obj::invisible, is_magical(), obj::last_anim, obj::level, LOCKED_DOOR, obj::map, obj::other_arch, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, obj::race, random_roll(), obj::range, RUNE, SET_FLAG, SIGN, obj::slaying, SP_level_range_adjust(), SPECIAL_KEY, obj::stats, TELEPORTER, TRAPDOOR, TREASURE, TRIGGER_PEDESTAL, obj::type, WEAPON, obj::x, and obj::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 3682 of file player.c.
References cast_spell(), draw_ext_info_format(), find_skill_by_name(), FLAG_REMOVED, free_object(), obj::inv, llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, obj::name, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, remove_ob(), obj::skill, and obj::type.
Referenced by do_throw().
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 882 of file spell_effect.c.
References obj::above, AT_PHYSICAL, FLAG_TEAR_DOWN, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), obj::map, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::type, obj::x, and obj::y.
Referenced by cast_spell().
Heals something.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
Definition at line 1679 of file spell_effect.c.
References AT_BLIND, AT_CONFUSION, AT_DISEASE, AT_POISON, obj::attacktype, cure_disease(), liv::dam, draw_ext_info(), obj::duration, find_archetype(), find_target_for_friendly_spell(), liv::food, FORCE, liv::grace, liv::hp, obj::last_grace, obj::last_sp, liv::maxgrace, liv::maxhp, liv::maxsp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, PREFER_HIGH, present_arch_in_ob(), present_in_ob_by_name(), random_roll(), liv::sp, and obj::stats.
Referenced by cast_spell(), and god_intervention().
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 2419 of file spell_effect.c.
References obj::above, obj::below, liv::dam, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), FLAG_IDENTIFIED, GET_MAP_OB, identify(), obj::inv, obj::invisible, obj::map, MAX_BUF, obj::msg, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, need_identify(), ob_describe(), PLAYER, QUERY_FLAG, SP_level_dam_adjust(), spell_effect(), obj::stats, obj::type, UPD_FLAGS, UPD_NAME, obj::x, and obj::y.
Referenced by cast_spell().
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 821 of file spell_effect.c.
References obj::active_next, active_objects, add_refcount(), obj::contr, draw_ext_info(), obj::duration, obj::enemy, FLAG_MAKE_INVIS, FREE_AND_CLEAR_STR, pl::hidden, pl::invis_race, obj::invisible, makes_invisible_to(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, obj::race, SP_level_duration_adjust(), pl::tmp_invis, obj::type, UP_OBJ_FACE, and update_object().
Referenced by cast_spell().
This alters player's marked item's cursed or blessed status, based on the spell_ob's fields.
op | player casting the spell. |
caster | what object was used to cast the spell. |
spell_ob | spell itself. |
Definition at line 2367 of file spell_effect.c.
References CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_marked_object(), FLAG_BLESSED, FLAG_CURSED, FLAG_IDENTIFIED, FLAG_KNOWN_BLESSED, FLAG_KNOWN_CURSED, FLAG_STARTEQUIP, HUGE_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, QUERY_FLAG, query_short_name(), SET_FLAG, and UPD_FLAGS.
Referenced by cast_spell().
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 1235 of file spell_attack.c.
References obj::above, arch_to_object(), obj::attacktype, liv::dam, draw_ext_info(), obj::duration, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::head, hit_player(), insert_ob_in_map(), llevError, LOG(), obj::map, MAX_LIGHT_RADII, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::range, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
This is really used mostly for spell fumbles at the like.
op | what is casting this. |
tmp | object to propogate. |
lvl | how nasty should the propagation be. |
Definition at line 55 of file spell_effect.c.
References obj::count, liv::dam, obj::duration, insert_ob_in_map(), obj::level, obj::map, liv::maxhp, obj::range, obj::stats, obj::x, and obj::y.
Referenced by alchemy_failure_effect(), become_follower(), god_examines_priest(), pray_at_altar(), prayer_failure(), and scroll_failure().
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 453 of file spell_effect.c.
References obj::above, arch_to_object(), obj::below, caster_level(), FLAG_IS_FLOOR, liv::food, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, insert_ob_in_map(), obj::map, MOVE_FLY_LOW, obj::other_arch, P_NO_MAGIC, P_OUT_OF_MAP, polymorph(), QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::speed_left, obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
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 186 of file resurrection.c.
References obj::above, arch_to_object(), caster_level(), CORPSE, draw_ext_info(), draw_ext_info_format(), find_archetype(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, insert_ob_in_map(), treasurestruct::item, treasureliststruct::items, obj::last_heal, obj::level, obj::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, obj::name, archt::name, NDI_UNIQUE, treasurestruct::next, treasurestruct::nrof, P_OUT_OF_MAP, obj::randomitems, remove_ob(), resurrect_player(), resurrection_fails(), summon_hostile_monsters(), obj::type, obj::x, and obj::y.
Referenced by cast_spell().
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 655 of file spell_attack.c.
References arch_to_object(), AT_DEATH, AT_GODPOWER, AT_HOLYWORD, obj::attacktype, caster_level(), obj::count, liv::dam, determine_god(), draw_ext_info(), draw_ext_info_format(), obj::duration, find_god(), FLAG_REFL_SPELL, FLAG_UNDEAD, free_object(), get_pointed_target(), liv::grace, liv::hp, HUGE_BUF, insert_ob_in_map(), obj::level, obj::map, liv::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, NDI_UNIQUE, obj::other_arch, PREFER_LOW, QUERY_FLAG, query_name(), obj::race, random_roll(), obj::range, set_owner(), set_spell_skill(), SP_EXPLOSION, SP_level_dam_adjust(), SP_level_range_adjust(), SPELL_EFFECT, SPELL_GRACE, SPELL_MANA, obj::stats, obj::subtype, tailor_god_spell(), obj::title, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
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 1308 of file spell_util.c.
References alchemy(), obj::anim_suffix, animate_weapon(), apply_anim_suffix(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_change_map_lightlevel(), cast_cone(), cast_consecrate(), cast_create_food(), cast_create_missile(), cast_create_town_portal(), cast_curse(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_heal(), cast_identify(), cast_invisible(), cast_item_curse_or_curse(), cast_light(), cast_polymorph(), cast_raise_dead_spell(), cast_smite_spell(), cast_transfer(), cast_wonder(), cast_word_of_recall(), caster_level(), obj::casting_time, Settings::casting_time, change_skill(), cleric_chance, obj::contr, create_aura(), create_bomb(), determine_god(), dimension_door(), dispel_rune(), draw_ext_info(), draw_ext_info_format(), draw_magic_map(), pl::encumbrance, FABS, find_random_spell_in_ob(), find_skill_by_name(), fire_arch_from_position(), fire_bolt(), fire_bullet(), fire_swarm(), FIREWALL, FLAG_ALIVE, FLAG_CONFUSED, FLAG_MONSTER, FLAG_WIZ, FLAG_WIZCAST, freearr_x, freearr_y, get_map_flags(), get_owner(), liv::grace, handle_spell_confusion(), HORN, obj::level, llevError, LOG(), magic_wall(), obj::map, MAX, MAX_BUF, liv::maxgrace, min_casting_level(), mood_change(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_MISSING, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_INFO, obj::name, NDI_UNIQUE, P_NO_CLERIC, P_NO_MAGIC, obj::path_attuned, obj::path_denied, obj::path_repelled, PATH_TIME_MULT, perceive_self(), play_sound_map(), play_sound_player_only(), PLAYER, POTION, prayer_failure(), PREFER_HIGH, PREFER_LOW, probe(), QUERY_FLAG, query_name(), random_roll(), range_golem, range_magic, range_misc, recharge(), remove_curse(), rndm(), ROD, RUNE, SCROLL, settings, pl::shoottype, obj::skill, SOUND_TYPE_SPELL, liv::sp, SP_ALCHEMY, SP_ANIMATE_WEAPON, SP_AURA, SP_BLESS, SP_BOLT, SP_BOMB, SP_BULLET, SP_CAUSE_DISEASE, SP_CHANGE_ABILITY, SP_CHANGE_MANA, SP_CHANGE_MAP_LIGHT, SP_CHARGING, SP_CONE, SP_CONSECRATE, SP_CREATE_FOOD, SP_CREATE_MISSILE, SP_CURSE, SP_DESTRUCTION, SP_DETECTION, SP_DIMENSION_DOOR, SP_DISPEL_RUNE, SP_EARTH_TO_DUST, SP_FAERY_FIRE, SP_HEALING, SP_IDENTIFY, SP_INVISIBLE, SP_ITEM_CURSE_BLESS, SP_level_spellpoint_cost(), SP_LIGHT, SP_MAGIC_MAPPING, SP_MAGIC_MISSILE, SP_MAGIC_WALL, SP_MAKE_MARK, SP_MOOD_CHANGE, SP_MOVING_BALL, SP_PERCEIVE_SELF, SP_POLYMORPH, SP_PROBE, SP_RAISE_DEAD, SP_REMOVE_CURSE, SP_RUNE, SP_SMITE, SP_SUMMON_GOLEM, SP_SUMMON_MONSTER, SP_SWARM, SP_TOWN_PORTAL, SP_WONDER, SP_WORD_OF_RECALL, obj::speed, obj::speed_left, SPELL, obj::spell, spell_effect(), spell_failure(), Settings::spell_failure_effects, SPELL_GRACE, SPELL_MANA, obj::spellarg, obj::stats, strdup_local(), obj::subtype, summon_golem(), summon_object(), TRUE, obj::type, WAND, liv::Wis, write_mark(), write_rune(), obj::x, and obj::y.
Referenced by altar_type_move_on(), cast_dust(), cast_wonder(), cfapi_object_cast(), command_cast_spell(), fire(), fire_misc_object(), monster_cast_spell(), monster_use_range(), move_firewall(), potion_type_apply(), scroll_type_apply(), spring_trap(), and START_TEST().
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 2726 of file spell_effect.c.
References obj::above, caster_level(), charge_mana_effect(), liv::dam, draw_ext_info(), FLAG_ALIVE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_BLACK, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, liv::sp, SP_level_dam_adjust(), obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
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 997 of file spell_effect.c.
References cast_cone(), cast_spell(), generate_treasure(), obj::level, llevError, LOG(), obj::name, obj::randomitems, rndm(), SP_WONDER, SPELL, obj::subtype, and obj::type.
Referenced by cast_spell(), and scroll_failure().
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 935 of file spell_effect.c.
References add_string(), pl::bed_x, pl::bed_y, obj::contr, create_archetype(), draw_ext_info(), obj::duration, EXIT_PATH, EXIT_X, EXIT_Y, find_obj_by_type_subtype(), FORCE_NAME, insert_ob_in_ob(), llevError, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, pl::savebed_map, SP_level_duration_adjust(), SP_WORD_OF_RECALL, obj::speed, obj::speed_left, SPELL_EFFECT, obj::subtype, obj::type, and update_ob_speed().
Referenced by cast_spell().
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 237 of file spell_util.c.
References obj::contr, pl::last_skill_ob, obj::level, NUM_SKILLS, obj::path_attuned, obj::path_repelled, PLAYER, obj::skill, and obj::type.
Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_consecrate(), cast_create_town_portal(), cast_detection(), cast_polymorph(), cast_raise_dead_spell(), cast_smite_spell(), cast_spell(), cast_transfer(), create_aura(), fire_arch_from_position(), fire_swarm(), magic_wall(), mood_change(), remove_curse(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SP_level_spellpoint_cost(), summon_golem(), summon_object(), and write_rune().
void* cfapi_archetype_get_property | ( | int * | type, |
... | |||
) |
Definition at line 4262 of file plugins.c.
References CFAPI_ARCH_PROP_CLONE, CFAPI_ARCH_PROP_HEAD, CFAPI_ARCH_PROP_MORE, CFAPI_ARCH_PROP_NAME, CFAPI_ARCH_PROP_NEXT, CFAPI_NONE, CFAPI_PARCH, CFAPI_POBJECT, CFAPI_SSTRING, archt::clone, first_archetype, archt::head, archt::more, archt::name, and archt::next.
void* cfapi_friendlylist_get_next | ( | int * | type, |
... | |||
) |
Friend list access, to get objects on it.
Expects one parameter, ob.
type | unused |
Definition at line 4439 of file plugins.c.
References CFAPI_POBJECT, first_friendly_object, oblnk::next, and oblnk::ob.
void* cfapi_generate_random_map | ( | int * | type, |
... | |||
) |
Wrapper for generate_random_map().
type | unused. |
Definition at line 4511 of file plugins.c.
References generate_random_map().
void* cfapi_get_hooks | ( | int * | type, |
... | |||
) |
Definition at line 527 of file plugins.c.
References CFAPI_FUNC, CFAPI_NONE, _hook_entry::func, and NR_OF_HOOKS.
Referenced by plugins_init_plugin().
void* cfapi_get_month_name | ( | int * | type, |
... | |||
) |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 981 of file plugins.c.
References get_month_name(), and string_get_int.
void* cfapi_get_periodofday_name | ( | int * | type, |
... | |||
) |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 993 of file plugins.c.
References get_periodofday(), and string_get_int.
void* cfapi_get_season_name | ( | int * | type, |
... | |||
) |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 957 of file plugins.c.
References get_season_name(), and string_get_int.
void* cfapi_get_time | ( | int * | type, |
... | |||
) |
Wrapper for get_tod().
type | will be CFAPI_NONE. |
Definition at line 924 of file plugins.c.
References CFAPI_NONE, and get_tod().
void* cfapi_get_weekday_name | ( | int * | type, |
... | |||
) |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 969 of file plugins.c.
References get_weekday(), and string_get_int.
void* cfapi_log | ( | int * | type, |
... | |||
) |
Wrapper for LOG().
type | will be CFAPI_NONE. |
Definition at line 1069 of file plugins.c.
References CFAPI_NONE, and LOG().
void* cfapi_map_change_light | ( | int * | type, |
... | |||
) |
Wrapper for change_map_light().
type | will be CFAPI_INT. |
Definition at line 1512 of file plugins.c.
References CFAPI_INT, and change_map_light().
void* cfapi_map_create_path | ( | int * | type, |
... | |||
) |
Wrapper for create_pathname() and create_overlay_pathname().
type | will be CFAPI_STRING. |
Definition at line 1170 of file plugins.c.
References CFAPI_NONE, CFAPI_STRING, create_overlay_pathname(), create_pathname(), and MAX_BUF.
void* cfapi_map_delete_map | ( | int * | type, |
... | |||
) |
Definition at line 1413 of file plugins.c.
References CFAPI_NONE, and delete_map().
void* cfapi_map_get_map | ( | int * | type, |
... | |||
) |
Gets map information.
First parameter is a integer, which should be:
Definition at line 1095 of file plugins.c.
References CFAPI_NONE, CFAPI_PMAP, get_empty_map(), get_map_from_coord(), and ready_map_name().
void* cfapi_map_get_map_property | ( | int * | type, |
... | |||
) |
Definition at line 1205 of file plugins.c.
References calculate_difficulty(), CFAPI_INT, CFAPI_MAP_PROP_DARKNESS, CFAPI_MAP_PROP_DIFFICULTY, CFAPI_MAP_PROP_ENTER_X, CFAPI_MAP_PROP_ENTER_Y, CFAPI_MAP_PROP_FLAGS, CFAPI_MAP_PROP_HEIGHT, CFAPI_MAP_PROP_MESSAGE, CFAPI_MAP_PROP_NAME, CFAPI_MAP_PROP_NEXT, CFAPI_MAP_PROP_PATH, CFAPI_MAP_PROP_PLAYERS, CFAPI_MAP_PROP_REGION, CFAPI_MAP_PROP_RESET_TIME, CFAPI_MAP_PROP_RESET_TIMEOUT, CFAPI_MAP_PROP_TMPNAME, CFAPI_MAP_PROP_UNIQUE, CFAPI_MAP_PROP_WIDTH, CFAPI_NONE, CFAPI_PMAP, CFAPI_PREGION, CFAPI_SSTRING, mapdef::darkness, mapdef::enter_x, mapdef::enter_y, first_map, get_map_flags(), get_region_by_map(), mapdef::height, mapdef::msg, mapdef::name, mapdef::next, mapdef::path, mapdef::players, mapdef::reset_time, mapdef::reset_timeout, mapdef::tmpname, mapdef::unique, and mapdef::width.
void* cfapi_map_get_object_at | ( | int * | type, |
... | |||
) |
Wrapper for GET_MAP_OB().
type | will be CFAPI_POBJECT. |
Definition at line 1451 of file plugins.c.
References CFAPI_POBJECT, get_map_flags(), GET_MAP_OB, and P_OUT_OF_MAP.
void* cfapi_map_has_been_loaded | ( | int * | type, |
... | |||
) |
Wrapper for has_been_loaded().
type | will be CFAPI_PMAP. |
Definition at line 1149 of file plugins.c.
References CFAPI_PMAP, and has_been_loaded().
void* cfapi_map_message | ( | int * | type, |
... | |||
) |
Definition at line 1426 of file plugins.c.
References CFAPI_NONE, ext_info_map(), MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.
void* cfapi_map_out_of_map | ( | int * | type, |
... | |||
) |
Wrapper for out_of_map().
type | will be CFAPI_INT. |
Definition at line 1371 of file plugins.c.
References CFAPI_INT, and out_of_map().
void* cfapi_map_present_arch_by_name | ( | int * | type, |
... | |||
) |
Kinda wrapper for present_arch() (but uses a string, not an archetype*).
type | will be CFAPI_POBJECT. |
Definition at line 1483 of file plugins.c.
References CFAPI_POBJECT, present_arch(), and try_find_archetype().
void* cfapi_map_set_map_property | ( | int * | type, |
... | |||
) |
Definition at line 1338 of file plugins.c.
References CFAPI_MAP_PROP_PATH, CFAPI_NONE, CFAPI_STRING, mapdef::path, and snprintf().
void* cfapi_map_trigger_connected | ( | int * | type, |
... | |||
) |
Wrapper for trigger_connected().
Expected parameters after type:
[out] | type | Will be CFAPI_NONE. |
Definition at line 3729 of file plugins.c.
References CFAPI_NONE, and trigger_connected().
void* cfapi_map_update_position | ( | int * | type, |
... | |||
) |
Wrapper for update_position().
type | CFAPI_NONE. |
Definition at line 1396 of file plugins.c.
References CFAPI_NONE, and update_position().
void* cfapi_object_apply | ( | int * | type, |
... | |||
) |
Applies an object.
type | will be CFAPI_INT. |
Definition at line 3084 of file plugins.c.
References CFAPI_INT, and manual_apply().
void* cfapi_object_apply_below | ( | int * | type, |
... | |||
) |
Applies an object below.
type | will be CFAPI_NONE. |
Definition at line 3061 of file plugins.c.
References CFAPI_NONE, and player_apply_below().
void* cfapi_object_cast | ( | int * | type, |
... | |||
) |
Wrapper for query_money().
type | Will be CFAPI_INT. |
Definition at line 3800 of file plugins.c.
References cast_spell(), CFAPI_INT, and obj::map.
void* cfapi_object_change_abil | ( | int * | type, |
... | |||
) |
Wrapper for change_abil().
Definition at line 4070 of file plugins.c.
References CFAPI_INT, and change_abil().
void* cfapi_object_change_exp | ( | int * | type, |
... | |||
) |
Wrapper for change_exp().
type | will be CFAPI_NONE. |
Definition at line 4162 of file plugins.c.
References CFAPI_NONE, and change_exp().
void* cfapi_object_check_inventory | ( | int * | type, |
... | |||
) |
Definition at line 3621 of file plugins.c.
References CFAPI_NONE, CFAPI_POBJECT, check_inv(), and check_inv_recursive().
void* cfapi_object_check_spell | ( | int * | type, |
... | |||
) |
Wrapper for check_spell_known().
type | Will be CFAPI_POBJECT. |
Definition at line 3868 of file plugins.c.
References CFAPI_POBJECT, and check_spell_known().
void* cfapi_object_check_trigger | ( | int * | type, |
... | |||
) |
Wrapper for check_trigger().
type | Will be CFAPI_INT. |
Definition at line 3699 of file plugins.c.
References CFAPI_INT, and check_trigger().
void* cfapi_object_clean_object | ( | int * | type, |
... | |||
) |
Definition at line 3647 of file plugins.c.
References CFAPI_NONE, and clean_object().
void* cfapi_object_clear | ( | int * | type, |
... | |||
) |
Wrapper for clear_object().
type | Will be CFAPI_NONE. |
Definition at line 3585 of file plugins.c.
References CFAPI_NONE, and clear_object().
void* cfapi_object_clone | ( | int * | type, |
... | |||
) |
Clone an object, either through object_create_clone() or copy_object().
type | will be CFAPI_POBJECT. |
Definition at line 3274 of file plugins.c.
References CFAPI_POBJECT, copy_object(), get_object(), and object_create_clone().
void* cfapi_object_create | ( | int * | type, |
... | |||
) |
Wrapper for get_object(), create_archetype() and create_archetype_by_object_name().
type | will be CFAPI_POBJECT, or CFAPI_NONE if invalid value asked for. |
Definition at line 3355 of file plugins.c.
References CFAPI_NONE, CFAPI_POBJECT, find_archetype_by_object_name(), get_object(), object_create_arch(), and try_find_archetype().
void* cfapi_object_delete | ( | int * | type, |
... | |||
) |
Definition at line 3245 of file plugins.c.
References CFAPI_NONE, FLAG_FREED, FLAG_REMOVED, free_object(), llevError, LOG(), obj::name, and QUERY_FLAG.
void* cfapi_object_describe | ( | int * | type, |
... | |||
) |
Wrapper for describe_item().
type | will be CFAPI_STRING. |
Definition at line 3134 of file plugins.c.
References CFAPI_STRING, and describe_item().
void* cfapi_object_distance | ( | int * | type, |
... | |||
) |
Wrapper for distance().
type | will be CFAPI_INT. |
Definition at line 3538 of file plugins.c.
References CFAPI_INT, and distance().
void* cfapi_object_drain | ( | int * | type, |
... | |||
) |
Definition at line 3154 of file plugins.c.
References CFAPI_NONE, and drain_specific_stat().
void* cfapi_object_drop | ( | int * | type, |
... | |||
) |
Wrapper for drop().
type | will be CFAPI_NONE. |
Definition at line 4044 of file plugins.c.
References CFAPI_NONE, obj::contr, pl::count, drop(), FLAG_NO_DROP, PLAYER, QUERY_FLAG, pl::socket, obj::type, and socket_struct::update_look.
void* cfapi_object_find | ( | int * | type, |
... | |||
) |
Definition at line 3301 of file plugins.c.
References CFAPI_NONE, CFAPI_POBJECT, find_obj_by_type_subtype(), find_object(), find_object_name(), and get_player_container().
void* cfapi_object_find_archetype_inside | ( | int * | type, |
... | |||
) |
Kinda wrapper for present_arch_in_ob().
Definition at line 4004 of file plugins.c.
References obj::below, CFAPI_POBJECT, obj::inv, MAX_BUF, obj::name, present_arch_in_ob(), query_name(), and try_find_archetype().
void* cfapi_object_fix | ( | int * | type, |
... | |||
) |
Definition at line 3173 of file plugins.c.
References CFAPI_NONE, and fix_object().
void* cfapi_object_forget_spell | ( | int * | type, |
... | |||
) |
Definition at line 3845 of file plugins.c.
References CFAPI_NONE, do_forget_spell(), MAX_BUF, and query_name().
void* cfapi_object_get_key | ( | int * | type, |
... | |||
) |
Gets a key/value value for an object.
type | will contain CFAPI_SSTRING. |
Definition at line 1588 of file plugins.c.
References CFAPI_SSTRING, and get_ob_key_value().
void* cfapi_object_get_property | ( | int * | type, |
... | |||
) |
Main object property getter.
Definition at line 1637 of file plugins.c.
References obj::above, liv::ac, obj::active_next, obj::active_prev, obj::anim_speed, obj::animation_id, obj::arch, obj::attack_movement, obj::attacked_by, obj::attacktype, pl::bed_x, pl::bed_y, obj::below, can_merge(), can_pick(), obj::carrying, CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_MOVETYPE, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ARCH_NAME, CFAPI_OBJECT_PROP_ARCHETYPE, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_ATTACKED_BY, CFAPI_OBJECT_PROP_BASE_NAME, CFAPI_OBJECT_PROP_CARRYING, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CLIENT_TYPE, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CONTAINER, CFAPI_OBJECT_PROP_COUNT, CFAPI_OBJECT_PROP_CURRENT_WEAPON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_ENVIRONMENT, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GOD, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HEAD, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVENTORY, CFAPI_OBJECT_PROP_INVISIBLE, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MAGICAL, CFAPI_OBJECT_PROP_MAP, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MERGEABLE, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_ALLOW, CFAPI_OBJECT_PROP_MOVE_BLOCK, CFAPI_OBJECT_PROP_MOVE_OFF, CFAPI_OBJECT_PROP_MOVE_ON, CFAPI_OBJECT_PROP_MOVE_SLOW, CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_MOVE_TYPE, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NEXT_ACTIVE_OB, CFAPI_OBJECT_PROP_NO_SAVE, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OB_ABOVE, CFAPI_OBJECT_PROP_OB_BELOW, CFAPI_OBJECT_PROP_OTHER_ARCH, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PERM_EXP, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_PICKABLE, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_PRESENT, CFAPI_OBJECT_PROP_PREV_ACTIVE_OB, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SHORT_NAME, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_SUBTYPE, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_TYPE, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_OBJECT_PROP_X, CFAPI_OBJECT_PROP_Y, CFAPI_PARCH, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_IP, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_NEXT, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_PMAP, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_SSTRING, CFAPI_STRING, liv::Cha, obj::chosen_skill, obj::client_type, liv::Con, obj::container, obj::contr, obj::count, obj::current_weapon, obj::custom_name, liv::dam, determine_god(), liv::Dex, obj::direction, obj::duration, obj::enemy, obj::env, liv::exp, obj::expmul, obj::face, obj::facing, find_marked_object(), first_player, FLAG_WAS_WIZ, liv::food, obj::gen_sp_armour, get_owner(), obj::glow_radius, liv::grace, obj::head, obj::hide, socket_struct::host, liv::hp, liv::Int, obj::inv, obj::invisible, is_friendly(), is_magical(), obj::item_power, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, obj::lore, liv::luck, obj::magic, obj::map, obj::material, obj::materialname, liv::maxgrace, liv::maxhp, liv::maxsp, obj::move_allow, obj::move_block, obj::move_off, obj::move_on, obj::move_slow_penalty, obj::move_status, obj::move_type, obj::msg, archt::name, obj::name_pl, pl::next, obj::no_save, obj::nrof, new_face_struct::number, pl::ob, obj::other_arch, pl::party, obj::path_attuned, obj::path_denied, obj::path_repelled, obj::perm_exp, obj::pick_up, liv::Pow, present_arch_in_ob(), present_in_ob(), present_in_ob_by_name(), query_base_name(), QUERY_FLAG, query_name(), query_short_name(), obj::race, obj::resist, obj::run_away, pl::savebed_map, obj::skill, obj::slaying, snprintf(), pl::socket, liv::sp, obj::speed, obj::speed_left, obj::spellitem, obj::stats, liv::Str, obj::subtype, obj::title, pl::title, obj::type, obj::value, liv::wc, obj::weight, obj::weight_limit, liv::Wis, obj::x, and obj::y.
void* cfapi_object_give_skill | ( | int * | type, |
... | |||
) |
Definition at line 3189 of file plugins.c.
References CFAPI_POBJECT, and give_skill_by_name().
void* cfapi_object_identify | ( | int * | type, |
... | |||
) |
Wrapper for identify().
type | will be CFAPI_NONE. |
Definition at line 3112 of file plugins.c.
References CFAPI_NONE, and identify().
void* cfapi_object_insert | ( | int * | type, |
... | |||
) |
Definition at line 3394 of file plugins.c.
References CFAPI_NONE, CFAPI_POBJECT, FLAG_FREED, FLAG_REMOVED, free_object(), insert_ob_in_map(), insert_ob_in_map_at(), insert_ob_in_ob(), llevError, LOG(), obj::name, QUERY_FLAG, and remove_ob().
void* cfapi_object_learn_spell | ( | int * | type, |
... | |||
) |
Definition at line 3829 of file plugins.c.
References CFAPI_NONE, and do_learn_spell().
void* cfapi_object_merge | ( | int * | type, |
... | |||
) |
Wrapper for merge_ob().
type | Will be CFAPI_POBJECT. |
Definition at line 3512 of file plugins.c.
References CFAPI_POBJECT, and merge_ob().
void* cfapi_object_move | ( | int * | type, |
... | |||
) |
Moves an object.
Syntax is: cfapi_object_move(&type, kind) where kind is:
type | unused |
Definition at line 1546 of file plugins.c.
References CFAPI_INT, move_ob(), move_player(), and pl::ob.
void* cfapi_object_on_same_map | ( | int * | type, |
... | |||
) |
Definition at line 3659 of file plugins.c.
References CFAPI_INT, and on_same_map().
void* cfapi_object_pay_amount | ( | int * | type, |
... | |||
) |
Wrapper for pay_for_amount().
type | will be CFAPI_INT. |
Definition at line 3891 of file plugins.c.
References CFAPI_INT, and pay_for_amount().
void* cfapi_object_pay_item | ( | int * | type, |
... | |||
) |
Wrapper for pay_for_item().
type | will be CFAPI_INT. |
Definition at line 3914 of file plugins.c.
References CFAPI_INT, and pay_for_item().
void* cfapi_object_pickup | ( | int * | type, |
... | |||
) |
Definition at line 4246 of file plugins.c.
References CFAPI_NONE, and pick_up().
void* cfapi_object_query_cost | ( | int * | type, |
... | |||
) |
Wrapper for query_cost().
type | Will be CFAPI_INT. |
Definition at line 3752 of file plugins.c.
References CFAPI_INT, flags, and query_cost().
void* cfapi_object_query_money | ( | int * | type, |
... | |||
) |
Wrapper for query_money().
type | Will be CFAPI_INT. |
Definition at line 3778 of file plugins.c.
References CFAPI_INT, and query_money().
void* cfapi_object_remove | ( | int * | type, |
... | |||
) |
Definition at line 3224 of file plugins.c.
References CFAPI_NONE, FLAG_REMOVED, llevError, LOG(), obj::name, QUERY_FLAG, and remove_ob().
void* cfapi_object_reset | ( | int * | type, |
... | |||
) |
Wrapper for clear_reset().
type | Will be CFAPI_NONE. |
Definition at line 3606 of file plugins.c.
References CFAPI_NONE, and reset_object().
void* cfapi_object_say | ( | int * | type, |
... | |||
) |
void* cfapi_object_set_key | ( | int * | type, |
... | |||
) |
Write a key/value for an object.
type | will contain CFAPI_SSTRING. |
Definition at line 1613 of file plugins.c.
References CFAPI_INT, and set_ob_key_value().
void* cfapi_object_set_property | ( | int * | type, |
... | |||
) |
Sets the property of an object. Will send changes to client if required. First argument should be an object*, second an integer.. Will not change an archetype's object.
type | will contain the type of the first argument used to change the property. |
Definition at line 2459 of file plugins.c.
References obj::above, liv::ac, add_friendly_object(), obj::anim_speed, obj::animation_id, obj::arch, obj::attack_movement, obj::attacktype, pl::bed_x, pl::bed_y, CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NO_SAVE, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PERM_EXP, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_STRING, liv::Cha, obj::chosen_skill, CLEAR_FLAG, archt::clone, liv::Con, obj::container, obj::contr, copy_message(), obj::count, obj::custom_name, liv::dam, decrease_ob_nr(), liv::Dex, obj::direction, obj::duration, obj::enemy, obj::env, esrv_update_item(), liv::exp, obj::expmul, obj::face, obj::facing, first_player, fix_object(), liv::food, FREE_AND_COPY, obj::gen_sp_armour, get_player_container(), obj::glow_radius, liv::grace, obj::hide, liv::hp, liv::Int, obj::invisible, is_friendly(), obj::item_power, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, obj::lore, liv::luck, obj::magic, obj::map, pl::mark, pl::mark_count, obj::material, MAX_BUF, liv::maxgrace, liv::maxhp, liv::maxsp, obj::move_status, obj::name, obj::name_pl, new_faces, pl::next, obj::no_save, obj::nrof, pl::ob, object_get_env_recursive(), P_NEED_UPDATE, pl::party, obj::path_attuned, obj::path_denied, obj::path_repelled, obj::perm_exp, obj::pick_up, PLAYER, liv::Pow, obj::race, remove_friendly_object(), obj::resist, obj::run_away, pl::savebed_map, send_changed_object(), SET_ANIMATION, set_cheat(), SET_FLAG, SET_MAP_FLAGS, set_owner(), obj::skill, obj::slaying, pl::socket, liv::sp, obj::speed, obj::speed_left, obj::spellitem, obj::state, obj::stats, liv::Str, sum_weight(), obj::title, pl::title, obj::type, UP_OBJ_FACE, UPD_NROF, UPD_WEIGHT, update_all_los(), socket_struct::update_look, update_ob_speed(), update_object(), update_position(), obj::value, liv::wc, obj::weight, obj::weight_limit, liv::Wis, obj::x, and obj::y.
void* cfapi_object_split | ( | int * | type, |
... | |||
) |
Wrapper for get_split_ob().
type | will be CFAPI_POBJECT. |
Definition at line 3483 of file plugins.c.
References CFAPI_POBJECT, and get_split_ob().
void* cfapi_object_spring_trap | ( | int * | type, |
... | |||
) |
Definition at line 3677 of file plugins.c.
References CFAPI_NONE, and spring_trap().
void* cfapi_object_teleport | ( | int * | type, |
... | |||
) |
Teleports an object at a specified destination if possible.
type | Will be CFAPI_INT. |
Definition at line 4210 of file plugins.c.
References CFAPI_INT, obj::contr, find_first_free_spot(), FLAG_REMOVED, insert_ob_in_map_at(), map_newmap_cmd(), out_of_map(), PLAYER, QUERY_FLAG, remove_ob(), pl::socket, and obj::type.
void* cfapi_object_transfer | ( | int * | type, |
... | |||
) |
Object transfer. Parameters are object*, int meaning: 0: call to transfer_ob() 1: call to insert_ob_in_map_at() 2: call to move_to()
Definition at line 3941 of file plugins.c.
References CFAPI_INT, CFAPI_NONE, CFAPI_POBJECT, mapdef::enter_x, mapdef::enter_y, insert_ob_in_map_at(), move_to(), and transfer_ob().
void* cfapi_object_transmute | ( | int * | type, |
... | |||
) |
Definition at line 3206 of file plugins.c.
References CFAPI_NONE, and transmute_materialname().
void* cfapi_object_update | ( | int * | type, |
... | |||
) |
Wrapper for update_object().
type | Will be CFAPI_NONE. |
Definition at line 3562 of file plugins.c.
References CFAPI_NONE, and update_object().
void* cfapi_object_user_event | ( | int * | type, |
... | |||
) |
Definition at line 4530 of file plugins.c.
References CFAPI_INT, and user_event().
void* cfapi_party_get_property | ( | int * | type, |
... | |||
) |
Party-related functions.
type | data type returned. |
Definition at line 4320 of file plugins.c.
References CFAPI_NONE, CFAPI_PARTY_PROP_NAME, CFAPI_PARTY_PROP_NEXT, CFAPI_PARTY_PROP_PASSWORD, CFAPI_PARTY_PROP_PLAYER, CFAPI_PPARTY, CFAPI_PPLAYER, CFAPI_SSTRING, obj::contr, first_player, get_firstparty(), party_struct::next, pl::next, party_struct::partyname, and party_struct::passwd.
void* cfapi_player_can_pay | ( | int * | type, |
... | |||
) |
void* cfapi_player_find | ( | int * | type, |
... | |||
) |
Wrapper for find_player_partial_name().
type | will be CFAPI_PPLAYER. |
Definition at line 4118 of file plugins.c.
References CFAPI_PPLAYER, and find_player_partial_name().
void* cfapi_player_message | ( | int * | type, |
... | |||
) |
Definition at line 4134 of file plugins.c.
References CFAPI_NONE, draw_ext_info(), flags, MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.
void* cfapi_region_get_property | ( | int * | type, |
... | |||
) |
Regions-related functions.
type | data type returned. |
Return values.
Definition at line 4378 of file plugins.c.
References CFAPI_NONE, CFAPI_PREGION, CFAPI_REGION_PROP_LONGNAME, CFAPI_REGION_PROP_MESSAGE, CFAPI_REGION_PROP_NAME, CFAPI_REGION_PROP_NEXT, CFAPI_REGION_PROP_PARENT, CFAPI_SSTRING, first_region, regiondef::longname, regiondef::msg, regiondef::name, regiondef::next, and regiondef::parent.
void* cfapi_set_random_map_variable | ( | int * | type, |
... | |||
) |
Wrapper for set_random_map_variable().
type | unused. |
Definition at line 4485 of file plugins.c.
References CFAPI_INT, and set_random_map_variable().
void* cfapi_system_add_string | ( | int * | type, |
... | |||
) |
Wrapper for add_string().
type | will be CFAPI_SSTRING. |
Definition at line 756 of file plugins.c.
References add_string(), and CFAPI_SSTRING.
void* cfapi_system_check_path | ( | int * | type, |
... | |||
) |
Wrapper for check_path().
type | will be CFAPI_INT. |
Definition at line 822 of file plugins.c.
References CFAPI_INT, and check_path().
void* cfapi_system_directory | ( | int * | type, |
... | |||
) |
Definition at line 867 of file plugins.c.
References CFAPI_STRING, Settings::confdir, Settings::datadir, Settings::localdir, Settings::mapdir, Settings::playerdir, settings, Settings::tmpdir, and Settings::uniquedir.
void* cfapi_system_find_animation | ( | int * | type, |
... | |||
) |
Wrapper for find_animation().
type | will be CFAPI_INT. |
Definition at line 648 of file plugins.c.
References CFAPI_INT, and find_animation().
void* cfapi_system_find_face | ( | int * | type, |
... | |||
) |
Wrapper for find_face().
type | will be CFAPI_INT. |
Definition at line 670 of file plugins.c.
References CFAPI_INT, and find_face().
void* cfapi_system_find_string | ( | int * | type, |
... | |||
) |
Wrapper for find_string().
type | will be CFAPI_SSTRING. |
Definition at line 800 of file plugins.c.
References CFAPI_SSTRING, and find_string().
void* cfapi_system_re_cmp | ( | int * | type, |
... | |||
) |
Wrapper for re_cmp().
type | will be CFAPI_STRING. |
Definition at line 848 of file plugins.c.
References CFAPI_STRING, and re_cmp().
void* cfapi_system_register_global_event | ( | int * | type, |
... | |||
) |
Definition at line 709 of file plugins.c.
References CFAPI_NONE, _crossfire_plugin::gevent, and plugins_find_plugin().
void* cfapi_system_remove_string | ( | int * | type, |
... | |||
) |
Wrapper for free_string().
type | will be CFAPI_NONE. |
Definition at line 779 of file plugins.c.
References CFAPI_NONE, and free_string().
void* cfapi_system_strdup_local | ( | int * | type, |
... | |||
) |
Wrapper for strdup_local().
type | will be CFAPI_STRING. |
Definition at line 694 of file plugins.c.
References CFAPI_STRING, and strdup_local().
void* cfapi_system_unregister_global_event | ( | int * | type, |
... | |||
) |
Definition at line 729 of file plugins.c.
References CFAPI_NONE, _crossfire_plugin::gevent, and plugins_find_plugin().
void* cfapi_timer_create | ( | int * | type, |
... | |||
) |
Wrapper for cfapi_timer_create().
type | unused |
Additional parameters:
Definition at line 1010 of file plugins.c.
References CFAPI_INT, cftimer_create(), cftimer_find_free_id(), TIMER_ERR_ID, and TIMER_ERR_NONE.
void* cfapi_timer_destroy | ( | int * | type, |
... | |||
) |
Wrapper for cftimer_destroy().
type | will be CFAPI_INT. |
Additional parameters:
Definition at line 1046 of file plugins.c.
References CFAPI_INT, and cftimer_destroy().
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 106 of file timers.c.
References obj::count, _cftimer::delay, EVENT_CONNECTOR, EVENT_TIMER, find_obj_by_type_subtype(), MAX_TIMERS, _cftimer::mode, _cftimer::ob_tag, seconds(), TIMER_ERR_ID, TIMER_ERR_MODE, TIMER_ERR_NONE, TIMER_ERR_OBJ, TIMER_MODE_CYCLES, TIMER_MODE_DEAD, and TIMER_MODE_SECONDS.
Referenced by cfapi_timer_create().
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 137 of file timers.c.
References MAX_TIMERS, _cftimer::mode, TIMER_ERR_ID, TIMER_ERR_NONE, and TIMER_MODE_DEAD.
Referenced by cfapi_timer_destroy().
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 153 of file timers.c.
References MAX_TIMERS, TIMER_ERR_ID, and TIMER_MODE_DEAD.
Referenced by cfapi_timer_create().
void cftimer_init | ( | void | ) |
Initialize timers.
Definition at line 166 of file timers.c.
References MAX_TIMERS.
Referenced by init().
void cftimer_process_timers | ( | void | ) |
Processes all timers.
Definition at line 53 of file timers.c.
References cftimer_process_event(), _cftimer::delay, MAX_TIMERS, _cftimer::mode, seconds(), TIMER_MODE_CYCLES, TIMER_MODE_DEAD, and TIMER_MODE_SECONDS.
Referenced by server_main().
This changes the objects skill to new_skill. Note that this function doesn't always need to get used - you can now add skill exp to the player without the chosen_skill being set. This function is of most interest to players to update the various range information.
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 301 of file skill_util.c.
References AP_APPLY, AP_NOPRINT, AP_UNAPPLY, apply_special(), obj::chosen_skill, obj::contr, PLAYER, range_skill, pl::shoottype, and obj::type.
Referenced by apply_special(), cast_destruction(), cast_spell(), command_rskill(), and do_skill_attack().
void change_spell | ( | object * | op, |
char | k | ||
) |
Rotate the selected range attack.
op | player. |
k | '+' selects next range, other values previous range. |
Definition at line 321 of file c_range.c.
References obj::chosen_skill, obj::contr, draw_ext_info(), draw_ext_info_format(), legal_range(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, query_base_name(), query_name(), obj::race, range_bottom, range_bow, range_golem, range_magic, range_misc, range_none, range_size, range_skill, pl::ranges, and pl::shoottype.
Referenced by command_rotateshoottype().
void check_active_maps | ( | void | ) |
Finds maps in memory to reset.
Definition at line 206 of file swap.c.
References first_map, mapdef::in_memory, MAP_IN_MEMORY, mapdef::next, swap_map(), and mapdef::timeout.
Referenced by server_main().
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 242 of file spell_attack.c.
References obj::above, obj::attacktype, obj::count, liv::dam, explode_bullet(), FLAG_ALIVE, FLAG_REMOVED, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), obj::map, OB_TYPE_MOVE_BLOCK, obj::other_arch, P_IS_ALIVE, QUERY_FLAG, remove_ob(), obj::stats, was_destroyed, obj::x, and obj::y.
Referenced by fire_bullet(), and move_bullet().
Definition at line 1802 of file monster.c.
References obj::above, AT_PHYSICAL, DOOR, GET_MAP_OB, hit_player(), and obj::type.
Referenced by move_ob().
Definition at line 1791 of file monster.c.
References obj::above, AT_PHYSICAL, liv::dam, EARTHWALL, GET_MAP_OB, hit_player(), obj::stats, and obj::type.
Referenced by move_ob().
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 83 of file monster.c.
References obj::attack_movement, can_detect_enemy(), obj::enemy, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NEUTRAL, FLAG_REMOVED, GOLEM, HI4, on_same_map(), obj::owner, PETMOVE, PLAYER, QUERY_FLAG, should_arena_attack(), and obj::type.
Referenced by find_enemy(), and get_pet_enemy().
void check_login | ( | object * | op | ) |
Actually login a player, load from disk and such.
op | player. |
Definition at line 473 of file login.c.
References obj::arch, pl::bed_x, pl::bed_y, obj::below, pl::bowtype, obj::carrying, liv::Cha, check_password(), check_path(), CLEAR_FLAG, archt::clone, close_and_delete(), liv::Con, confirm_password(), containers, obj::contr, liv::Dex, pl::digestion, draw_ext_info(), draw_ext_info_format(), enter_exit(), esrv_add_spells(), esrv_new_player(), esrv_send_inventory(), esrv_send_pickup(), EVENT_LOGIN, execute_global_event(), pl::explore, final_free_player(), first_map_path, first_player, fix_object(), FLAG_FRIENDLY, FLAG_NO_FIX_PLAYER, FLAG_REMOVED, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FORCE, form_party(), pl::gen_grace, pl::gen_hp, pl::gen_sp, get_firstparty(), socket_struct::host, liv::hp, liv::Int, obj::inv, is_dragon_pl(), key_inventory, keyrings, kill_player(), pl::language, leave(), legal_range(), pl::levgrace, pl::levhp, pl::levsp, link_player_skills(), pl::listening, llevDebug, llevError, llevInfo, LO_NEWFILE, load_object(), Settings::localdir, LOG(), pl::maplevel, MAX_BUF, pl::mode, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, archt::name, pl::name_changed, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, party_struct::next, pl::next, pl::no_shout, Ns_Dead, NUM_LANGUAGES, pl::ob, open_and_uncompress(), pl::orig_stats, pl::outputs_count, pl::outputs_sync, pl::own_title, pl::party, party_rejoin_always, party_rejoin_no, party_struct::partyname, party_struct::passwd, pl::peaceful, pl::petmode, PLAYER, Settings::playerdir, liv::Pow, pticks, QUERY_FLAG, range_none, pl::rejoin_party, remove_ob(), remove_unpaid_objects(), Settings::reset_loc_time, reset_object(), save_player(), pl::savebed_map, Settings::search_items, pl::search_str, send_party_message(), set_dragon_name(), SET_FLAG, Settings::set_title, settings, pl::shoottype, snprintf(), pl::socket, obj::speed, pl::spellparam, ST_PLAYING, pl::state, obj::stats, liv::Str, strdup_local(), strtol(), sum_weight(), terminate_all_pets(), pl::title, TRUE, obj::type, pl::unapply, unapply_always, unapply_never, unapply_nochoice, socket_struct::update_look, update_ob_speed(), pl::usekeys, pl::weapon_sp, obj::weight, liv::Wis, pl::write_buf, wrong_password(), obj::x, and obj::y.
Referenced by receive_player_password().
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 173 of file login.c.
References draw_ext_info(), draw_ext_info_format(), MAX_NAME, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, NDI_UNIQUE, pl::ob, and playername_ok().
Referenced by receive_player_name().
int check_password | ( | char * | typed, |
char * | crypted | ||
) |
Check if 2 passwords match.
typed | entered password. Not crypted. |
crypted | password to check against. Must be crypted. |
Definition at line 162 of file server.c.
References crypt_string().
Referenced by 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 694 of file disease.c.
References obj::below, DISEASE, infect_object(), obj::inv, and obj::type.
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 1384 of file player.c.
References AMULET, obj::arch, ARMOUR, ARROW, obj::below, BOOK, BOOTS, BOW, can_pick(), CLOAK, obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), DRINK, F_TRUE, FLAG_IS_THROWN, FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FLAG_UNPAID, obj::flags, FLESH, FOOD, GEM, GLOVES, HELMET, HORN, item_matched_string(), KEY, MAX, pl::mode, MONEY, MOVE_FLYING, obj::move_type, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, MSG_TYPE_COMMAND_SUCCESS, obj::name, archt::name, NDI_UNIQUE, obj::nrof, pick_up(), POISON, POTION, PU_ALLWEAPON, PU_ARMOUR, PU_ARROW, PU_BOOTS, PU_BOW, PU_CLOAK, PU_DEBUG, PU_DRINK, PU_FLESH, PU_FOOD, PU_GLOVES, PU_HELMET, PU_INHIBIT, PU_JEWELS, PU_KEY, PU_MAGIC_DEVICE, PU_MAGICAL, PU_MISSILEWEAPON, PU_NEWMODE, PU_NOT_CURSED, PU_NOTHING, PU_POTION, PU_RATIO, PU_READABLES, PU_SHIELD, PU_SKILLSCROLL, PU_SPELLBOOK, PU_STOP, PU_VALUABLES, query_cost(), QUERY_FLAG, RING, ROD, SCROLL, Settings::search_items, pl::search_str, settings, SHIELD, SKILLSCROLL, snprintf(), SPECIAL_KEY, SPELLBOOK, TRUE, obj::type, WAND, was_destroyed, WEAPON, and obj::weight.
Referenced by move_player().
void check_score | ( | 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 289 of file hiscore.c.
References add_score(), BIG_NAME, obj::contr, draw_ext_info(), draw_ext_info_format(), draw_one_high_score(), scr::exp, liv::exp, pl::explore, FLAG_WAS_WIZ, HIGHSCORE_LENGTH, scr::killer, pl::killer, obj::map, scr::maplevel, MAX_BUF, scr::maxgrace, liv::maxgrace, scr::maxhp, liv::maxhp, scr::maxsp, liv::maxsp, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, scr::name, obj::name, mapdef::name, pl::name_changed, NDI_UNIQUE, pl::own_title, mapdef::path, scr::position, QUERY_FLAG, obj::stats, scr::title, and pl::title.
Referenced by apply_savebed(), command_kick(), command_shutdown(), emergency_save(), key_confirm_quit(), kill_player(), leave(), and process_players1().
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 1854 of file spell_util.c.
References draw_ext_info_format(), obj::duration, obj::env, get_ob_key_value(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, obj::name, NDI_NAVY, NDI_UNIQUE, PLAYER, and obj::type.
Referenced by move_aura(), and remove_force().
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 408 of file spell_util.c.
References obj::below, obj::inv, obj::name, SPELL, and obj::type.
Referenced by cfapi_object_check_spell(), command_learn_spell_or_prayer(), do_forget_spell(), do_learn_spell(), dragon_ability_gain(), god_intervention(), and spellbook_type_apply().
void check_spells | ( | void | ) |
It goes through the spells looking for any obvious errors. This was most useful in debugging when re-doing all the spells to catch simple errors. To use it all the time will result in it spitting out messages that aren't really errors.
Definition at line 120 of file spell_util.c.
References archt::clone, find_archetype(), first_archetype, llevDebug, llevError, LOG(), archt::name, archt::next, NUM_SKILLS, obj::skill, skill_names, SPELL, spell_mapping, and obj::type.
Referenced by init_beforeplay().
int check_weapon_power | ( | const object * | who, |
int | improvs | ||
) |
This checks to see of the player (who) is sufficient level to use a weapon with improvs improvements (typically last_eat). We take an int here instead of the object so that the improvement code can pass along the increased value to see if the object is usuable. we return 1 (true) if the player can use the weapon. See ../types/weapon_improver/weapon_improver.c
who | living to check |
improvs | improvement level. |
Definition at line 1076 of file apply.c.
References obj::below, obj::inv, IS_COMBAT_SKILL, obj::level, llevError, LOG(), obj::name, PLAYER, SKILL, obj::subtype, and obj::type.
Referenced by apply_special(), and improve_weapon().
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 38 of file ban.c.
References BANFILE, BANISHFILE, Settings::confdir, llevDebug, Settings::localdir, LOG(), MAX_BUF, settings, and snprintf().
Referenced by do_server(), and receive_player_password().
void clean_tmp_files | ( | void | ) |
Remove temporary map files.
Definition at line 194 of file standalone.c.
References clean_tmp_map(), first_map, mapdef::in_memory, llevInfo, LOG(), MAP_IN_MEMORY, mapdef::next, Settings::recycle_tmp_maps, save_map(), SAVE_MODE_NORMAL, settings, swap_map(), TRUE, and write_todclock().
Referenced by cleanup(), fatal(), fatal_signal(), and LOG().
void cleanup | ( | void | ) |
Clean up everything and exit.
Definition at line 1196 of file server.c.
References clean_tmp_files(), cleanupPlugins(), free_all_anim(), free_all_archs(), free_all_god(), free_all_images(), free_all_maps(), free_all_newserver(), free_all_object_data(), free_all_readable(), free_all_recipes(), free_all_treasures(), free_globals(), free_loader(), free_server(), free_style_maps(), llevDebug, LOG(), and write_book_archive().
Referenced by command_shutdown(), init_beforeplay(), and server_main().
void cleanupPlugins | ( | void | ) |
Call closePlugin() on the various plugins, used at server shutdown.
Definition at line 4623 of file plugins.c.
References _crossfire_plugin::closefunc, _crossfire_plugin::next, and plugin_number.
Referenced by cleanup().
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 340 of file skill_util.c.
References obj::chosen_skill, CLEAR_FLAG, obj::contr, FLAG_READY_SKILL, PLAYER, range_none, range_skill, pl::ranges, pl::shoottype, and obj::type.
Referenced by unapply_special().
int command_abil | ( | object * | op, |
char * | params | ||
) |
Changes an object's statistics.
op | wizard. |
params | parameters, should be "player statistic new_value". |
Definition at line 1595 of file c_wiz.c.
References liv::Cha, liv::Con, liv::Dex, draw_ext_info(), draw_ext_info_format(), FALSE, first_player, fix_object(), FLAG_WAS_WIZ, liv::Int, MAX_STAT, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::next, pl::ob, pl::orig_stats, liv::Pow, Settings::real_wiz, SET_FLAG, settings, obj::stats, liv::Str, and liv::Wis.
int command_accuse | ( | object * | op, |
char * | params | ||
) |
'accuse' command.
op | player. |
params | message. |
Definition at line 1255 of file c_chat.c.
References basic_emote(), and EMOTE_ACCUSE.
int command_addexp | ( | object * | op, |
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 1433 of file c_wiz.c.
References calc_perm_exp(), check_exp_adjust(), draw_ext_info(), draw_ext_info_format(), liv::exp, FALSE, find_skill_by_name(), first_player, FLAG_WAS_WIZ, MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::next, pl::ob, player_lvl_adj(), Settings::real_wiz, SET_FLAG, settings, and obj::stats.
int command_afk | ( | object * | op, |
char * | params | ||
) |
Toggles the afk status of a player. 'afk' command.
op | player to toggle status for. |
params | unused. |
Definition at line 795 of file c_misc.c.
References CLEAR_FLAG, draw_ext_info(), FLAG_AFK, get_language(), I18N_MSG_CMISC_056, I18N_MSG_CMISC_057, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.
int command_apply | ( | object * | op, |
char * | params | ||
) |
'apply' command.
op | player. |
params | what to apply. |
Definition at line 221 of file c_object.c.
References obj::above, AP_APPLY, AP_UNAPPLY, obj::container, draw_ext_info_format(), find_best_apply_object_match(), obj::inv, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, player_apply(), and player_apply_below().
int command_applymode | ( | object * | op, |
char * | params | ||
) |
Players wants to change the apply mode, ie how to handle applying an item when no body slot available.
op | player asking for change. |
params | new mode. |
Definition at line 1443 of file c_misc.c.
References obj::contr, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_132, I18N_MSG_CMISC_133, I18N_MSG_CMISC_134, I18N_MSG_CMISC_135, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, pl::unapply, unapply_always, unapply_never, and unapply_nochoice.
int command_archs | ( | object * | op, |
char * | params | ||
) |
Archetype-related statistics. Wizard 'archs' command.
op | player asking for information. |
params | unused. |
Definition at line 915 of file c_misc.c.
References arch_info().
int command_arrest | ( | object * | op, |
char * | params | ||
) |
Wizard jails player.
op | wizard. |
params | player to jail. |
Definition at line 619 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), enter_exit(), free_object(), get_jail_exit(), get_other_player_from_name(), llevInfo, LOG(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, and pl::ob.
int command_banish | ( | object * | op, |
char * | params | ||
) |
Add player's IP to ban_file and kick them off the server.
I know most people have dynamic IPs but this is more of a short term solution if they have to get a new IP to play maybe they'll calm down. This uses the banish_file in the local directory *not *the ban_file The action is logged with a ! for easy searching. -tm
op | DM banishing. |
params | player to banish. Must be a complete name match. |
Definition at line 293 of file c_wiz.c.
References BANISHFILE, command_kick(), draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), socket_struct::host, llevDebug, Settings::localdir, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ALL, NDI_RED, NDI_UNIQUE, pl::ob, settings, snprintf(), and pl::socket.
int command_beg | ( | object * | op, |
char * | params | ||
) |
'beg' command.
op | player. |
params | message. |
Definition at line 1684 of file c_chat.c.
References basic_emote(), and EMOTE_BEG.
int command_bleed | ( | object * | op, |
char * | params | ||
) |
'bleed' command.
op | player. |
params | message. |
Definition at line 1697 of file c_chat.c.
References basic_emote(), and EMOTE_BLEED.
int command_blush | ( | object * | op, |
char * | params | ||
) |
'blush' command.
op | player. |
params | message. |
Definition at line 1307 of file c_chat.c.
References basic_emote(), and EMOTE_BLUSH.
int command_body | ( | object * | op, |
char * | params | ||
) |
This command dumps the body information for object *op. it doesn't care what the params are.
This is mostly meant as a debug command.
This is the 'body' command.
op | player to display body info for. |
params | unused |
1. |
Definition at line 157 of file c_misc.c.
References obj::body_info, body_locations, obj::body_used, draw_ext_info(), draw_ext_info_format(), FLAG_USE_ARMOUR, FLAG_USE_WEAPON, get_language(), I18N_MSG_CMISC_007, I18N_MSG_CMISC_008, I18N_MSG_CMISC_009, I18N_MSG_CMISC_010, I18N_MSG_CMISC_011, I18N_MSG_CMISC_012, I18N_MSG_CMISC_013, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_BODY, NDI_UNIQUE, NUM_BODY_LOCATIONS, and QUERY_FLAG.
int command_bounce | ( | object * | op, |
char * | params | ||
) |
'bounce' command.
op | player. |
params | message. |
Definition at line 1073 of file c_chat.c.
References basic_emote(), and EMOTE_BOUNCE.
int command_bow | ( | object * | op, |
char * | params | ||
) |
'bow' command.
op | player. |
params | message. |
Definition at line 1281 of file c_chat.c.
References basic_emote(), and EMOTE_BOW.
int command_bowmode | ( | object * | op, |
char * | params | ||
) |
Player wants to change the bowmode, how arrows are fired.
op | player asking for change. |
params | new mode. |
Definition at line 1491 of file c_misc.c.
References bow_bestarrow, bow_nw, pl::bowtype, obj::contr, draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_136, I18N_MSG_CMISC_137, i18n_translate(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, snprintf(), and types.
int command_brace | ( | object * | op, |
char * | params | ||
) |
Player toggles her braced status.
op | player. |
params | brace status (on/off). |
Definition at line 2382 of file c_misc.c.
References pl::braced, obj::contr, draw_ext_info(), fix_object(), get_language(), I18N_MSG_CMISC_212, I18N_MSG_CMISC_213, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and onoff_value().
int command_burp | ( | object * | op, |
char * | params | ||
) |
'burp' command.
op | player. |
params | message. |
Definition at line 1320 of file c_chat.c.
References basic_emote(), and EMOTE_BURP.
int command_cackle | ( | object * | op, |
char * | params | ||
) |
'cackle' command.
op | player. |
params | message. |
Definition at line 1099 of file c_chat.c.
References basic_emote(), and EMOTE_CACKLE.
int command_cast | ( | object * | op, |
char * | params | ||
) |
'cast' command, prepares a spell for laster casting.
op | player. |
params | spell. |
Definition at line 67 of file c_range.c.
References command_cast_spell().
int command_cast_spell | ( | object * | op, |
char * | params, | ||
char | command | ||
) |
Sets up to cast a spell.
Invoke casts a spell immediately, whereas cast just set up the range type.
op | caster. |
params | spell name. |
command | first letter of the spell type (c=cast, i=invoke, p=prepare). |
Definition at line 178 of file c_range.c.
References obj::below, cast_spell(), obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), obj::facing, find_skill_by_name(), free_object(), pl::golem_count, obj::inv, lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, obj::name, NDI_UNIQUE, range_golem, range_magic, pl::ranges, remove_friendly_object(), remove_ob(), pl::shoottype, show_matching_spells(), obj::skill, SPELL, pl::spellparam, and obj::type.
Referenced by command_cast(), command_invoke(), and command_prepare().
int command_chat | ( | object * | op, |
char * | params | ||
) |
'chat' command.
op | player. |
params | message. |
Definition at line 254 of file c_chat.c.
References command_tell_all(), MSG_TYPE_COMMUNICATION_CHAT, and NDI_BLUE.
int command_chuckle | ( | object * | op, |
char * | params | ||
) |
'chuckle' command.
op | player. |
params | message. |
Definition at line 1333 of file c_chat.c.
References basic_emote(), and EMOTE_CHUCKLE.
int command_clap | ( | object * | op, |
char * | params | ||
) |
'clap' command.
op | player. |
params | message. |
Definition at line 1294 of file c_chat.c.
References basic_emote(), and EMOTE_CLAP.
int command_cointoss | ( | object * | op, |
char * | params | ||
) |
'cointoss' command.
op | player. |
params | message. |
Definition at line 84 of file c_chat.c.
References draw_ext_info(), ext_info_map_except(), obj::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, obj::name, NDI_UNIQUE, NDI_WHITE, rndm(), and snprintf().
int command_cough | ( | object * | op, |
char * | params | ||
) |
'cough' command.
op | player. |
params | message. |
Definition at line 1346 of file c_chat.c.
References basic_emote(), and EMOTE_COUGH.
int command_create | ( | object * | op, |
char * | params | ||
) |
Wizard wants to create an object.
This function is a real mess, because we're stucking getting the entire item description in one block of text, so we just can't simply parse it - we need to look for double quotes for example. This could actually get much simpler with just a little help from the client - if we could get line breaks, it makes parsing much easier, eg, something like:
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 783 of file c_wiz.c.
References obj::arch, arch_to_object(), CLEAR_FLAG, archt::clone, obj::contr, copy_object(), obj::count, pl::count, create_treasure(), mapdef::difficulty, dm_stack_pop(), dm_stack_push(), draw_ext_info(), draw_ext_info_format(), FALSE, find_archetype(), find_archetype_by_object_name(), find_artifactlist(), FLAG_ALIVE, FLAG_IDENTIFIED, FLAG_KNOWN_MAGICAL, FLAG_WAS_WIZ, free_object(), give_artifact_abilities(), GT_APPLY, HORN, insert_ob_in_map(), insert_ob_in_map_at(), insert_ob_in_ob(), artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), obj::map, MAX, MAX_BUF, obj::more, archt::more, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, need_identify(), artifactstruct::next, obj::nrof, object_create_arch(), out_of_map(), QUERY_FLAG, obj::randomitems, Settings::real_wiz, ROD, SCROLL, set_abs_magic(), SET_FLAG, set_magic(), set_variable(), settings, SPELL, SPELLBOOK, obj::type, WAND, obj::x, and obj::y.
int command_cringe | ( | object * | op, |
char * | params | ||
) |
'cringe' command.
op | player. |
params | message. |
Definition at line 1710 of file c_chat.c.
References basic_emote(), and EMOTE_CRINGE.
int command_cry | ( | object * | op, |
char * | params | ||
) |
'cry' command.
op | player. |
params | message. |
Definition at line 1229 of file c_chat.c.
References basic_emote(), and EMOTE_CRY.
int command_dance | ( | object * | op, |
char * | params | ||
) |
'dance' command.
op | player. |
params | message. |
Definition at line 1047 of file c_chat.c.
References basic_emote(), and EMOTE_DANCE.
int command_debug | ( | object * | op, |
char * | params | ||
) |
Player wants to see/change the debug level.
op | player asking for information. |
params | new debug value. |
Definition at line 945 of file c_misc.c.
References Settings::debug, draw_ext_info(), draw_ext_info_format(), FABS, FLAG_WIZ, get_language(), I18N_MSG_CMISC_092, I18N_MSG_CMISC_093, I18N_MSG_CMISC_094, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and settings.
int command_diff | ( | object * | op, |
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 2664 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), find_object(), get_dm_object(), get_ob_diff(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, STACK_FROM_NUMBER, STACK_FROM_TOP, pl::stack_items, pl::stack_position, stringbuffer_finish(), and stringbuffer_new().
int command_disarm | ( | object * | op, |
char * | params | ||
) |
'disarm' command.
op | player. |
params | unused. |
Definition at line 181 of file c_object.c.
References SK_DISARM_TRAPS, skill_names, and use_skill().
int command_dm | ( | object * | op, |
char * | params | ||
) |
Actual command to perhaps become dm. Changed around a bit in version 0.92.2 to allow people on sockets to become dm, and allow better dm file
op | player wishing to become wizard. |
params | password. |
Definition at line 1983 of file c_wiz.c.
References do_wizard_dm().
int command_dmhide | ( | object * | op, |
char * | params | ||
) |
A players wants to become DM and hide. Let's see if that's authorized. Make sure to not tell anything to anyone.
op | wizard. |
params | password. |
0 | failure. |
1 | success. |
Definition at line 2333 of file c_wiz.c.
References do_wizard_dm(), and do_wizard_hide().
int command_dmtell | ( | object * | op, |
char * | params | ||
) |
int command_drop | ( | object * | op, |
char * | params | ||
) |
'drop' command.
op | player. |
params | what to drop. |
Definition at line 1173 of file c_object.c.
References obj::below, obj::contr, pl::count, draw_ext_info(), draw_ext_info_format(), drop(), FLAG_INV_LOCKED, FLAG_NO_DROP, obj::inv, obj::invisible, item_matched_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, pl::socket, obj::type, and socket_struct::update_look.
int command_dropall | ( | object * | op, |
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 1021 of file c_object.c.
References AMULET, ARMOUR, ARMOUR_IMPROVER, ARROW, obj::below, BOOK, BOOTS, BOW, BRACERS, CLEAR_FLAG, CLOAK, obj::container, CONTAINER, obj::contr, pl::count, draw_ext_info(), DRINK, drop(), esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_INV_LOCKED, FLAG_NO_FIX_PLAYER, FLESH, FOOD, GEM, GIRDLE, GLOVES, HELMET, HORN, obj::inv, obj::invisible, KEY, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, RING, ROD, SCROLL, SET_FLAG, SHIELD, pl::socket, SPECIAL_KEY, SPELLBOOK, obj::type, UPD_WEIGHT, socket_struct::update_look, WAND, WEAPON, and WEAPON_IMPROVER.
int command_dump | ( | object * | op, |
char * | params | ||
) |
Dumps the difference between an object and its archetype.
op | wiard. |
params | object to dump. |
Definition at line 1171 of file c_wiz.c.
References obj::contr, draw_ext_info(), dump_object(), FLAG_OBJ_ORIGINAL, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, QUERY_FLAG, stringbuffer_finish(), and stringbuffer_new().
int command_dumpallarchetypes | ( | object * | op, |
char * | params | ||
) |
Various archetypes-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1102 of file c_misc.c.
References dump_all_archetypes().
int command_dumpallmaps | ( | object * | op, |
char * | params | ||
) |
Various map-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1148 of file c_misc.c.
References dump_all_maps().
int command_dumpallobjects | ( | object * | op, |
char * | params | ||
) |
Various object-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1072 of file c_misc.c.
References dump_all_objects().
int command_dumpbelow | ( | object * | op, |
char * | params | ||
) |
Player wants to dump object below her.
op | player asking for information. |
params | unused. |
Definition at line 979 of file c_misc.c.
References obj::below, obj::contr, obj::count, dm_stack_push(), draw_ext_info(), dump_object(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, stringbuffer_finish(), and stringbuffer_new().
int command_dumpfriendlyobjects | ( | object * | op, |
char * | params | ||
) |
Various friendly object-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1087 of file c_misc.c.
References dump_friendly_objects().
int command_dumpmap | ( | object * | op, |
char * | params | ||
) |
Various map-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1132 of file c_misc.c.
References dump_map(), and obj::map.
int command_east | ( | object * | op, |
char * | params | ||
) |
'east' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 77 of file c_move.c.
References move_internal().
int command_empty | ( | object * | op, |
char * | params | ||
) |
'empty' command.
op | player. |
params | item specifier. |
Definition at line 1263 of file c_object.c.
References obj::below, CONTAINER, draw_ext_info(), empty_container(), find_best_object_match(), obj::inv, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and obj::type.
int command_examine | ( | object * | op, |
char * | params | ||
) |
'examine' command.
op | player. |
params | optional item specifier. |
Definition at line 1306 of file c_object.c.
References obj::below, draw_ext_info_format(), examine(), find_best_object_match(), LOOK_OBJ, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.
int command_explore | ( | object * | op, |
char * | params | ||
) |
Player wants to enter explore mode, that is never-dying mode.
Don't allow people to exit explore mode. It otherwise becomes really easy to abuse this.
op | player asking for explore mode. |
params | unused. |
Definition at line 2086 of file c_misc.c.
References obj::contr, draw_ext_info(), pl::explore, Settings::explore_mode, FALSE, first_player, get_language(), I18N_MSG_CMISC_182, I18N_MSG_CMISC_183, I18N_MSG_CMISC_184, I18N_MSG_CMISC_185, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, pl::next, and settings.
int command_fire | ( | object * | op, |
char * | params | ||
) |
Player wants to start furing.
op | player. |
params | additional parameters. |
Definition at line 206 of file c_new.c.
References obj::contr, draw_ext_info(), pl::fire_on, move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.
int command_fire_stop | ( | object * | op, |
char * | params | ||
) |
Player wants to stop firing.
op | player. |
params | ignored. |
Definition at line 229 of file c_new.c.
References obj::contr, and pl::fire_on.
int command_fix_me | ( | object * | op, |
char * | params | ||
) |
Wrapper to fix a player.
op | player asking to be fixed. |
params | unused. |
Definition at line 1374 of file c_misc.c.
References fix_object(), and sum_weight().
int command_flip | ( | object * | op, |
char * | params | ||
) |
'flip' command.
op | player. |
params | message. |
Definition at line 1359 of file c_chat.c.
References basic_emote(), and EMOTE_FLIP.
int command_follow | ( | object * | op, |
char * | params | ||
) |
DM wants to follow a player, or stop following a player.
op | wizard. |
params | player to follow. If NULL, stop following player. |
Definition at line 2863 of file c_wiz.c.
References add_string(), obj::contr, draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), pl::followed_player, FREE_AND_CLEAR_STR, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, obj::name, NDI_UNIQUE, and pl::ob.
int command_forget_spell | ( | object * | op, |
char * | params | ||
) |
Wizard wishes to forget a spell.
op | wizard. |
params | spell name to forget. |
Definition at line 2210 of file c_wiz.c.
References obj::contr, do_forget_spell(), draw_ext_info(), draw_ext_info_format(), lookup_spell_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, and NDI_UNIQUE.
int command_free | ( | object * | op, |
char * | params | ||
) |
Totally free an object.
op | wizard. |
params | object to free. |
Definition at line 1394 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), FLAG_REMOVED, free_object(), get_dm_object(), obj::head, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, remove_ob(), and STACK_FROM_STACK.
int command_freeze | ( | object * | op, |
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 571 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_RED, NDI_UNIQUE, pl::ob, obj::speed, and obj::speed_left.
int command_frown | ( | object * | op, |
char * | params | ||
) |
'frown' command.
op | player. |
params | message. |
Definition at line 1372 of file c_chat.c.
References basic_emote(), and EMOTE_FROWN.
int command_gasp | ( | object * | op, |
char * | params | ||
) |
'gasp' command.
op | player. |
params | message. |
Definition at line 1385 of file c_chat.c.
References basic_emote(), and EMOTE_GASP.
int command_giggle | ( | object * | op, |
char * | params | ||
) |
'giggle' command.
op | player. |
params | message. |
Definition at line 1125 of file c_chat.c.
References basic_emote(), and EMOTE_GIGGLE.
int command_glare | ( | object * | op, |
char * | params | ||
) |
'glare' command.
op | player. |
params | message. |
Definition at line 1398 of file c_chat.c.
References basic_emote(), and EMOTE_GLARE.
int command_goto | ( | object * | op, |
char * | params | ||
) |
Wizard teleports to a map.
op | wizard teleporting. |
params | map to teleport to. Can be absolute or relative path. |
Definition at line 532 of file c_wiz.c.
References add_string(), mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, free_object(), get_object(), obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, and NDI_UNIQUE.
Referenced by command_loadtest().
int command_grin | ( | object * | op, |
char * | params | ||
) |
'grin' command.
op | player. |
params | message. |
Definition at line 1268 of file c_chat.c.
References basic_emote(), and EMOTE_GRIN.
int command_groan | ( | object * | op, |
char * | params | ||
) |
'groan' command.
op | player. |
params | message. |
Definition at line 1411 of file c_chat.c.
References basic_emote(), and EMOTE_GROAN.
int command_growl | ( | object * | op, |
char * | params | ||
) |
'growl' command.
op | player. |
params | message. |
Definition at line 1164 of file c_chat.c.
References basic_emote(), and EMOTE_GROWL.
int command_gsay | ( | object * | op, |
char * | params | ||
) |
'gsay' command, talks to party.
op | player. |
params | message. |
Definition at line 304 of file c_party.c.
References command_party(), draw_ext_info(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.
int command_help | ( | object * | op, |
char * | params | ||
) |
Player is asking for some help.
op | player asking for information. |
params | what kind of help to ask for. |
Definition at line 1900 of file c_misc.c.
References Settings::datadir, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_language(), help_topics(), I18N_MSG_CMISC_178, I18N_MSG_CMISC_179, I18N_MSG_CMISC_180, i18n_translate(), language_codes, llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, QUERY_FLAG, S_ISREG, settings, show_commands(), snprintf(), and strerror_local().
int command_hiccup | ( | object * | op, |
char * | params | ||
) |
'hiccup' command.
op | player. |
params | message. |
Definition at line 1424 of file c_chat.c.
References basic_emote(), and EMOTE_HICCUP.
int command_hide | ( | object * | op, |
char * | params | ||
) |
Wizard 'hide' command.
op | DM wanting to hide. |
params | ignored. |
Definition at line 197 of file c_wiz.c.
References do_wizard_hide().
int command_hiscore | ( | object * | op, |
char * | params | ||
) |
Player is asking for the hiscore.
op | player asking for information. |
params | unused. |
Definition at line 930 of file c_misc.c.
References display_high_score().
int command_hug | ( | object * | op, |
char * | params | ||
) |
'hug' command.
op | player. |
params | message. |
Definition at line 1216 of file c_chat.c.
References basic_emote(), and EMOTE_HUG.
int command_insert_into | ( | object * | op, |
char * | params | ||
) |
Puts an object into another.
op | wizard. |
params | object specifier. |
Definition at line 2733 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_object(), FLAG_REMOVED, get_dm_object(), insert_ob_in_ob(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), STACK_FROM_NUMBER, STACK_FROM_TOP, pl::stack_items, pl::stack_position, obj::type, UPD_NAME, UPD_NROF, and UPD_WEIGHT.
int command_inventory | ( | object * | op, |
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 1123 of file c_wiz.c.
References draw_ext_info(), find_object(), inventory(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.
int command_invisible | ( | object * | op, |
char * | params | ||
) |
Wizard wants to become invisible.
op | wizard. |
params | ignored. |
Definition at line 1998 of file c_wiz.c.
References draw_ext_info(), obj::invisible, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, UP_OBJ_FACE, and update_object().
int command_invoke | ( | object * | op, |
char * | params | ||
) |
'invoke' command, fires a spell immediately.
op | player. |
params | spell. |
Definition at line 53 of file c_range.c.
References command_cast_spell().
int 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 352 of file c_wiz.c.
References check_score(), obj::contr, obj::direction, draw_ext_info_format(), EVENT_KICK, execute_global_event(), first_player, FLAG_FREED, FLAG_REMOVED, pl::killer, obj::map, MAP_TIMEOUT, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, obj::name, NDI_ALL, NDI_RED, NDI_UNIQUE, pl::next, Ns_Dead, pl::ob, mapdef::players, QUERY_FLAG, remove_ob(), save_player(), pl::socket, socket_struct::status, and mapdef::timeout.
Referenced by command_banish(), and command_shutdown().
int command_kill_pets | ( | object * | op, |
char * | params | ||
) |
Player wants to get rid of pets.
op | player. |
params | unused. |
Definition at line 2410 of file c_misc.c.
References draw_ext_info(), draw_ext_info_format(), first_friendly_object, FLAG_REMOVED, free_object(), get_language(), get_owner(), I18N_MSG_CMISC_214, I18N_MSG_CMISC_215, I18N_MSG_CMISC_216, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, obj::name, NDI_UNIQUE, oblnk::next, oblnk::ob, QUERY_FLAG, remove_friendly_object(), remove_ob(), strcasecmp(), and terminate_all_pets().
int command_kiss | ( | object * | op, |
char * | params | ||
) |
'kiss' command.
op | player. |
params | message. |
Definition at line 1060 of file c_chat.c.
References basic_emote(), and EMOTE_KISS.
int command_language | ( | object * | op, |
char * | params | ||
) |
This is the 'language' command.
op | player requesting the information. |
params | optional language code ("en", "fr", etc.) |
Definition at line 97 of file c_misc.c.
References obj::contr, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_005, I18N_MSG_CMISC_006, I18N_MSG_CMISC_051, i18n_translate(), pl::language, language_codes, language_names, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and NUM_LANGUAGES.
int command_laugh | ( | object * | op, |
char * | params | ||
) |
'laugh' command.
op | player. |
params | message. |
Definition at line 1112 of file c_chat.c.
References basic_emote(), and EMOTE_LAUGH.
int command_learn_special_prayer | ( | object * | op, |
char * | params | ||
) |
Wizard wants to learn a god-given spell.
op | wizard. |
params | spell name. |
0 | failure. |
1 | success. |
Definition at line 2196 of file c_wiz.c.
References command_learn_spell_or_prayer().
int command_learn_spell | ( | object * | op, |
char * | params | ||
) |
Wizard wants to learn a regular spell.
op | wizard. |
params | spell name. |
0 | failure. |
1 | success. |
Definition at line 2180 of file c_wiz.c.
References command_learn_spell_or_prayer().
int command_lick | ( | object * | op, |
char * | params | ||
) |
'lick' command.
op | player. |
params | message. |
Definition at line 1437 of file c_chat.c.
References basic_emote(), and EMOTE_LICK.
int command_listen | ( | object * | op, |
char * | params | ||
) |
Change the player's listen level.
op | player asking for information. |
params | unused. |
Definition at line 1264 of file c_misc.c.
References obj::contr, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_105, I18N_MSG_CMISC_106, I18N_MSG_CMISC_107, i18n_translate(), pl::listening, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.
int command_listplugins | ( | object * | op, |
char * | params | ||
) |
Lists all plugins currently loaded with their IDs and full names.
op | wizard. |
params | ignored. |
Definition at line 2242 of file c_wiz.c.
References plugins_display_list().
int command_loadplugin | ( | object * | op, |
char * | params | ||
) |
Loads the given plugin. The DM specifies the name of the library to load (no pathname is needed). Do not ever attempt to load the same plugin more than once at a time, or bad things could happen.
op | DM loading a plugin. |
params | should be the plugin's name, eg cfpython.so |
Definition at line 2259 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), LIBDIR, llevDebug, llevInfo, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, and plugins_init_plugin().
int command_loadtest | ( | object * | op, |
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 108 of file c_wiz.c.
References command_goto(), draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, settings, snprintf(), Settings::worldmapstartx, Settings::worldmapstarty, Settings::worldmaptilesx, and Settings::worldmaptilesy.
int command_lock_item | ( | object * | op, |
char * | params | ||
) |
Alternate way to lock/unlock items (command line).
op | player |
params | sent command line. |
Definition at line 2234 of file c_object.c.
References CLEAR_FLAG, obj::count, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_best_object_match(), FLAG_INV_LOCKED, HUGE_BUF, merge_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, NDI_UNIQUE, QUERY_FLAG, query_short_name(), SET_FLAG, and UPD_FLAGS.
int command_malloc | ( | object * | op, |
char * | params | ||
) |
Display memory information.
op | player requesting information. |
params | unused. |
Definition at line 818 of file c_misc.c.
References malloc_info().
int command_mapinfo | ( | object * | op, |
char * | params | ||
) |
'mapinfo' command.
op | player requesting the information. |
params | unused. |
Definition at line 833 of file c_misc.c.
References current_map_info().
int command_maps | ( | object * | op, |
char * | params | ||
) |
'maps' command.
op | player requesting the information. |
params | region to restrict to. |
Definition at line 861 of file c_misc.c.
References map_info().
int command_mark | ( | object * | op, |
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 1376 of file c_object.c.
References obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), find_best_object_match(), find_marked_object(), pl::mark, pl::mark_count, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, and query_name().
int command_me | ( | object * | op, |
char * | params | ||
) |
'me' command.
op | player. |
params | message. |
Definition at line 64 of file c_chat.c.
References ext_info_map(), obj::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_ME, obj::name, NDI_BLUE, NDI_UNIQUE, and snprintf().
int command_mon_aggr | ( | object * | op, |
char * | params | ||
) |
When DM is possessing a monster, flip aggression on and off, to allow better motion.
op | wiard. |
params | ignored. |
Definition at line 1202 of file c_wiz.c.
References CLEAR_FLAG, draw_ext_info(), obj::enemy, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.
int command_motd | ( | object * | op, |
char * | params | ||
) |
Display the message of the day.
op | player requesting the motd. |
params | unused. |
1. |
Definition at line 203 of file c_misc.c.
References display_motd().
int command_news | ( | object * | op, |
char * | params | ||
) |
Display the server news.
op | player requesting the news. |
params | unused. |
1. |
Definition at line 233 of file c_misc.c.
References send_news().
int command_nod | ( | object * | op, |
char * | params | ||
) |
'nod' command.
op | player. |
params | message. |
Definition at line 1034 of file c_chat.c.
References basic_emote(), and EMOTE_NOD.
int command_north | ( | object * | op, |
char * | params | ||
) |
'north' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 90 of file c_move.c.
References move_internal().
int command_northeast | ( | object * | op, |
char * | params | ||
) |
'northeast' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 103 of file c_move.c.
References move_internal().
int command_northwest | ( | object * | op, |
char * | params | ||
) |
'northwest' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 116 of file c_move.c.
References move_internal().
int command_nowiz | ( | object * | op, |
char * | params | ||
) |
Steps down from wizard mode.
op | wizard. |
params | ignored. |
Definition at line 1839 of file c_wiz.c.
References CLEAR_FLAG, obj::contr, draw_ext_info(), draw_ext_info_format(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, pl::followed_player, FREE_AND_CLEAR_STR, pl::hidden, obj::invisible, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_LT_GREEN, NDI_UNIQUE, mapdef::players, Settings::real_wiz, settings, TRUE, and update_los().
int command_orcknuckle | ( | object * | op, |
char * | params | ||
) |
Plays the "orcknucke" game.
If there is an "dice" archetype in server arches, this command will require the player to have at least 4 dice to play. There is a 5% chance to lose one dice at each play. Dice can be made through alchemy (finding the recipe is left as an exercice to the player). Note that the check is on the name 'dice', so you can have multiple archetypes for that name, they'll be all taken into account.
op | player who plays. |
params | string sent by the player. Ignored. |
int command_output_count | ( | object * | op, |
char * | params | ||
) |
output-count command.
op | player asking for information. |
params | new value. |
Definition at line 1230 of file c_misc.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_102, I18N_MSG_CMISC_103, I18N_MSG_CMISC_104, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and pl::outputs_count.
int command_output_sync | ( | object * | op, |
char * | params | ||
) |
Output-sync command.
op | player asking for information. |
params | new value. |
Definition at line 1196 of file c_misc.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_099, I18N_MSG_CMISC_100, I18N_MSG_CMISC_101, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and pl::outputs_sync.
int command_overlay_reset | ( | object * | op, |
char * | params | ||
) |
Removes the overlay for op's current map.
op | DM acting. |
params | ignored. |
Definition at line 430 of file c_wiz.c.
References create_overlay_pathname(), draw_ext_info(), obj::map, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, mapdef::path, and unlink.
int command_overlay_save | ( | object * | op, |
char * | params | ||
) |
Saves the op's map as an overlay - objects are persisted.
op | DM wanting to save. |
params | ignored. |
Definition at line 406 of file c_wiz.c.
References draw_ext_info(), obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, save_map(), and SAVE_MODE_OVERLAY.
int command_party | ( | object * | op, |
char * | params | ||
) |
'party' command, subdivided in different sub commands.
op | player. |
params | additional parameters. 1. |
Definition at line 350 of file c_party.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), first_player, firstparty, form_party(), get_party_password(), party_struct::kills, list_players(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, obj::name, NDI_UNIQUE, NDI_WHITE, party_struct::next, pl::next, pl::party, party_help(), party_struct::partyleader, party_struct::partyname, party_struct::passwd, remove_party(), replace_unprintable_chars(), send_party_message(), snprintf(), and party_struct::total_exp.
Referenced by command_gsay().
int command_party_rejoin | ( | object * | op, |
char * | params | ||
) |
Handles the 'party_rejoin' command.
op | player. |
params | optional parameters. |
Definition at line 688 of file c_party.c.
References obj::contr, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, and pl::rejoin_party.
int command_passwd | ( | object * | pl, |
char * | params | ||
) |
Player is asking to change password.
pl | player. |
params | unused. |
Definition at line 2454 of file c_misc.c.
References obj::contr, CS_QUERY_HIDEINPUT, get_language(), I18N_MSG_CMISC_217, i18n_translate(), send_query(), pl::socket, ST_CHANGE_PASSWORD_OLD, and pl::state.
int command_patch | ( | object * | op, |
char * | params | ||
) |
Wizard wants to altar an object.
op | wizard. |
params | object and what to patch. |
Definition at line 1296 of file c_wiz.c.
References obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), FALSE, FLAG_WAS_WIZ, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, Settings::real_wiz, SET_FLAG, set_variable(), and settings.
int command_peaceful | ( | object * | op, |
char * | params | ||
) |
Player toggles her peaceful status.
op | player. |
params | unused. |
Definition at line 2333 of file c_misc.c.
References obj::contr, draw_ext_info(), get_language(), I18N_MSG_CMISC_208, I18N_MSG_CMISC_209, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and pl::peaceful.
int command_petmode | ( | object * | op, |
char * | params | ||
) |
Player wants to change how her pets behave.
op | player asking for change. |
params | new mode. |
Definition at line 1556 of file c_misc.c.
References obj::contr, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_138, I18N_MSG_CMISC_139, I18N_MSG_CMISC_140, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, pet_arena, pet_defend, pet_normal, pet_sad, pl::petmode, and types.
int command_pickup | ( | object * | op, |
char * | params | ||
) |
'pickup' command.
op | player. |
params | pickup mode. Can be empty to display the current mode. |
Definition at line 1867 of file c_object.c.
References obj::contr, display_new_pickup(), draw_ext_info(), draw_ext_info_format(), llevDebug, LOG(), pl::mode, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PU_ALLWEAPON, PU_ARMOUR, PU_ARROW, PU_BOOTS, PU_BOW, PU_CLOAK, PU_DEBUG, PU_DRINK, PU_FLESH, PU_FOOD, PU_GLOVES, PU_HELMET, PU_INHIBIT, PU_JEWELS, PU_KEY, PU_MAGIC_DEVICE, PU_MAGICAL, PU_MISSILEWEAPON, PU_NEWMODE, PU_NOT_CURSED, PU_POTION, PU_READABLES, PU_SHIELD, PU_SKILLSCROLL, PU_SPELLBOOK, PU_STOP, PU_VALUABLES, and set_pickup_mode().
int command_players | ( | object * | op, |
char * | params | ||
) |
Display all known players.
op | player asking for information. |
params | unused. |
Definition at line 1390 of file c_misc.c.
References closedir(), dirent::d_name, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_130, I18N_MSG_CMISC_131, i18n_translate(), Settings::localdir, MAX_BUF, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, opendir(), Settings::playerdir, readdir(), S_ISDIR, settings, and snprintf().
int command_poke | ( | object * | op, |
char * | params | ||
) |
'poke' command.
op | player. |
params | message. |
Definition at line 1242 of file c_chat.c.
References basic_emote(), and EMOTE_POKE.
int command_possess | ( | object * | op, |
char * | params | ||
) |
DM can possess a monster. Basically, this tricks the client into thinking a given monster, is actually the player it controls. This allows a DM to inhabit a monster's body, and run around the game with it. This function is severely broken - it has tons of hardcoded values,
op | wizard wanting to possess something. |
params | monster to possess. |
Definition at line 1232 of file c_wiz.c.
References obj::body_info, obj::contr, do_some_living(), draw_ext_info(), esrv_new_player(), esrv_send_inventory(), find_object(), find_object_name(), fix_object(), FLAG_WIZ, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, NUM_BODY_LOCATIONS, pl::ob, PLAYER, SET_FLAG, and obj::type.
int command_pout | ( | object * | op, |
char * | params | ||
) |
'pout' command.
op | player. |
params | message. |
Definition at line 1450 of file c_chat.c.
References basic_emote(), and EMOTE_POUT.
int command_prepare | ( | object * | op, |
char * | params | ||
) |
Equivalent to command_cast().
op | player. |
params | spell. |
Definition at line 82 of file c_range.c.
References command_cast_spell().
int command_printlos | ( | object * | op, |
char * | params | ||
) |
Various LOS-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1163 of file c_misc.c.
References print_los().
int command_puke | ( | object * | op, |
char * | params | ||
) |
'puke' command.
op | player. |
params | message. |
Definition at line 1151 of file c_chat.c.
References basic_emote(), and EMOTE_PUKE.
int command_quit | ( | object * | op, |
char * | params | ||
) |
Player wants to totally delete her character.
op | player wanting to delete her character. |
params | unused. |
Definition at line 2065 of file c_misc.c.
References obj::contr, CS_QUERY_SINGLECHAR, get_language(), I18N_MSG_CMISC_181, i18n_translate(), send_query(), pl::socket, ST_CONFIRM_QUIT, and pl::state.
int command_remove | ( | object * | op, |
char * | params | ||
) |
Remove an object from its position.
op | wizard. |
params | object to remove. |
Definition at line 1342 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), FLAG_REMOVED, get_dm_object(), obj::head, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), obj::speed, STACK_FROM_STACK, obj::type, and update_ob_speed().
int command_rename_item | ( | object * | op, |
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 2047 of file c_object.c.
References obj::below, obj::count, obj::custom_name, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_best_object_match(), find_marked_object(), FREE_AND_CLEAR_STR, FREE_AND_COPY, obj::inv, obj::invisible, MAX_BUF, merge_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, obj::nrof, query_base_name(), snprintf(), UPD_NAME, and VERY_BIG_BUF.
int command_reply | ( | object * | op, |
char * | params | ||
) |
Reply to last person who told you something [mids 01/14/2002]
Must have been told something by someone first.
op | who is telling. |
params | message to say. |
Definition at line 373 of file c_chat.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), find_player(), FLAG_WIZ, pl::hidden, pl::last_tell, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, obj::name, NDI_ORANGE, NDI_UNIQUE, pl::ob, and QUERY_FLAG.
int command_reset | ( | object * | op, |
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 1665 of file c_wiz.c.
References add_string(), obj::contr, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, first_player, flush_old_maps(), free_object(), get_object(), has_been_loaded(), HUGE_BUF, mapdef::in_memory, insert_ob_in_map(), llevDebug, llevError, LOG(), obj::map, MAP_IN_MEMORY, map_remove_unique_files(), MAP_SWAPPED, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_RED, NDI_UNIQUE, pl::next, pl::ob, mapdef::path, path_combine_and_normalize(), remove_ob(), mapdef::reset_time, SAVE_ERROR_PLAYER, snprintf(), swap_map(), pl::transport, mapdef::unique, obj::x, and obj::y.
int command_resistances | ( | object * | op, |
char * | params | ||
) |
Players wants to know her resistances.
op | player asking for information. |
params | unused. |
Definition at line 1740 of file c_misc.c.
References obj::arch, ATNR_INTERNAL, atnr_is_dragon_enabled(), attacktype_desc, obj::below, change_resist_msg, draw_ext_info(), draw_ext_info_format(), FORCE, get_language(), I18N_MSG_CMISC_168, I18N_MSG_CMISC_169, I18N_MSG_CMISC_170, I18N_MSG_CMISC_171, i18n_translate(), obj::inv, is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, archt::name, NDI_UNIQUE, NROFATTACKS, obj::resist, and obj::type.
int command_rotateshoottype | ( | object * | op, |
char * | params | ||
) |
'rotateshoottype' command, switch range attack.
op | player. |
params | arguments to the command. |
Definition at line 394 of file c_range.c.
References change_spell().
int command_rskill | ( | object * | pl, |
char * | params | ||
) |
'ready_skill' command.
pl | player. |
params | skill name. |
Definition at line 132 of file c_object.c.
References change_skill(), draw_ext_info(), draw_ext_info_format(), find_skill_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, and NDI_UNIQUE.
int command_rules | ( | object * | op, |
char * | params | ||
) |
Display the server rules.
op | player requesting the rules. |
params | unused. |
1. |
Definition at line 218 of file c_misc.c.
References send_rules().
int command_run | ( | object * | op, |
char * | params | ||
) |
Player wants to start running.
op | player. |
params | additional parameters. |
Definition at line 168 of file c_new.c.
References obj::contr, draw_ext_info(), move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and pl::run_on.
int command_run_stop | ( | object * | op, |
char * | params | ||
) |
Player wants to stop running.
op | player. |
params | ignored. |
Definition at line 191 of file c_new.c.
References obj::contr, and pl::run_on.
int command_save | ( | object * | op, |
char * | params | ||
) |
Player wants to get saved.
op | player. |
params | unused. |
Definition at line 2305 of file c_misc.c.
References draw_ext_info(), liv::exp, get_language(), get_map_flags(), I18N_MSG_CMISC_204, I18N_MSG_CMISC_205, I18N_MSG_CMISC_206, I18N_MSG_CMISC_207, i18n_translate(), obj::map, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, P_NO_CLERIC, save_player(), obj::stats, obj::x, and obj::y.
int command_say | ( | object * | op, |
char * | params | ||
) |
'say' command.
op | player. |
params | message. |
Definition at line 47 of file c_chat.c.
References communicate().
Referenced by cfapi_object_say().
int command_scream | ( | object * | op, |
char * | params | ||
) |
'scream' command.
op | player. |
params | message. |
Definition at line 1177 of file c_chat.c.
References basic_emote(), and EMOTE_SCREAM.
int command_search | ( | object * | op, |
char * | params | ||
) |
'search' command.
op | player. |
params | unused. |
Definition at line 167 of file c_object.c.
References SK_FIND_TRAPS, skill_names, and use_skill().
int command_search_items | ( | object * | op, |
char * | params | ||
) |
'search-items' command.
op | player. |
params | options. |
Definition at line 1998 of file c_object.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), FALSE, fix_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, Settings::search_items, pl::search_str, and settings.
int command_setgod | ( | object * | op, |
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. |
0 | syntax error. |
1 | correct syntax. |
Definition at line 232 of file c_wiz.c.
References become_follower(), draw_ext_info(), draw_ext_info_format(), find_god(), find_object_both(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, PLAYER, and obj::type.
int command_shake | ( | object * | op, |
char * | params | ||
) |
'shake' command.
op | player. |
params | message. |
Definition at line 1138 of file c_chat.c.
References basic_emote(), and EMOTE_SHAKE.
int command_shiver | ( | object * | op, |
char * | params | ||
) |
'shiver' command.
op | player. |
params | message. |
Definition at line 1463 of file c_chat.c.
References basic_emote(), and EMOTE_SHIVER.
int command_shout | ( | object * | op, |
char * | params | ||
) |
'sbout' command.
op | player. |
params | message. |
Definition at line 241 of file c_chat.c.
References command_tell_all(), MSG_TYPE_COMMUNICATION_SHOUT, and NDI_RED.
int command_showpets | ( | object * | op, |
char * | params | ||
) |
Players wants to know her pets.
op | player asking for information. |
params | unused. |
Definition at line 1606 of file c_misc.c.
References liv::ac, liv::Cha, liv::Con, liv::dam, liv::Dex, draw_ext_info(), draw_ext_info_format(), first_friendly_object, get_language(), get_owner(), liv::hp, I18N_MSG_CMISC_141, I18N_MSG_CMISC_142, I18N_MSG_CMISC_143, I18N_MSG_CMISC_144, I18N_MSG_CMISC_145, I18N_MSG_CMISC_146, I18N_MSG_CMISC_147, I18N_MSG_CMISC_148, I18N_MSG_CMISC_149, I18N_MSG_CMISC_150, I18N_MSG_CMISC_151, I18N_MSG_CMISC_152, I18N_MSG_CMISC_153, I18N_MSG_CMISC_154, I18N_MSG_CMISC_155, I18N_MSG_CMISC_156, I18N_MSG_CMISC_157, I18N_MSG_CMISC_158, I18N_MSG_CMISC_159, I18N_MSG_CMISC_160, I18N_MSG_CMISC_161, I18N_MSG_CMISC_162, I18N_MSG_CMISC_163, I18N_MSG_CMISC_164, i18n_translate(), liv::Int, obj::level, liv::maxhp, liv::maxsp, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, obj::name, NDI_UNIQUE, oblnk::next, oblnk::ob, liv::Pow, liv::sp, obj::stats, liv::Str, liv::wc, and liv::Wis.
int command_shrug | ( | object * | op, |
char * | params | ||
) |
'shrug' command.
op | player. |
params | message. |
Definition at line 1476 of file c_chat.c.
References basic_emote(), and EMOTE_SHRUG.
int command_shutdown | ( | object * | op, |
char * | params | ||
) |
Totally shutdowns the server.
op | wizard shutting down the server. |
params | ignored. |
Definition at line 508 of file c_wiz.c.
References check_score(), cleanup(), command_kick(), play_again(), and save_player().
int command_sigh | ( | object * | op, |
char * | params | ||
) |
'sigh' command.
op | player. |
params | message. |
Definition at line 1190 of file c_chat.c.
References basic_emote(), and EMOTE_SIGH.
int command_skills | ( | object * | op, |
char * | params | ||
) |
Player is asking for her skills.
Just show player's their skills for now. Dm's can already see skills w/ inventory command - b.t.
op | player. |
params | optional skill restriction. |
Definition at line 1156 of file c_wiz.c.
References show_skills().
int command_slap | ( | object * | op, |
char * | params | ||
) |
'slap' command.
op | player. |
params | message. |
Definition at line 1489 of file c_chat.c.
References basic_emote(), and EMOTE_SLAP.
int command_smile | ( | object * | op, |
char * | params | ||
) |
'smile' command.
op | player. |
params | message. |
Definition at line 1086 of file c_chat.c.
References basic_emote(), and EMOTE_SMILE.
int command_smirk | ( | object * | op, |
char * | params | ||
) |
'smirk' command.
op | player. |
params | message. |
Definition at line 1502 of file c_chat.c.
References basic_emote(), and EMOTE_SMIRK.
int command_snap | ( | object * | op, |
char * | params | ||
) |
'snap' command.
op | player. |
params | message. |
Definition at line 1515 of file c_chat.c.
References basic_emote(), and EMOTE_SNAP.
int command_sneeze | ( | object * | op, |
char * | params | ||
) |
'sneeze' command.
op | player. |
params | message. |
Definition at line 1528 of file c_chat.c.
References basic_emote(), and EMOTE_SNEEZE.
int command_snicker | ( | object * | op, |
char * | params | ||
) |
'snicker' command.
op | player. |
params | message. |
Definition at line 1541 of file c_chat.c.
References basic_emote(), and EMOTE_SNICKER.
int command_sniff | ( | object * | op, |
char * | params | ||
) |
'sniff' command.
op | player. |
params | message. |
Definition at line 1554 of file c_chat.c.
References basic_emote(), and EMOTE_SNIFF.
int command_snore | ( | object * | op, |
char * | params | ||
) |
'snore' command.
op | player. |
params | message. |
Definition at line 1567 of file c_chat.c.
References basic_emote(), and EMOTE_SNORE.
int command_sound | ( | object * | op, |
char * | params | ||
) |
Player wants to change sound status.
op | player asking for change. |
params | unused. |
Definition at line 2120 of file c_misc.c.
References obj::contr, draw_ext_info(), get_language(), I18N_MSG_CMISC_186, I18N_MSG_CMISC_187, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, SND_MUTE, pl::socket, and socket_struct::sound.
int command_south | ( | object * | op, |
char * | params | ||
) |
'south' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 129 of file c_move.c.
References move_internal().
int command_southeast | ( | object * | op, |
char * | params | ||
) |
'southeast' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 142 of file c_move.c.
References move_internal().
int command_southwest | ( | object * | op, |
char * | params | ||
) |
'southwest' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 155 of file c_move.c.
References move_internal().
int command_speed | ( | object * | op, |
char * | params | ||
) |
Changes the server speed.
op | wizard. |
params | new speed, or NULL to see the speed. |
Definition at line 1493 of file c_wiz.c.
References draw_ext_info_format(), max_time, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, reset_sleep(), and set_max_time().
int command_spit | ( | object * | op, |
char * | params | ||
) |
'spit' command.
op | player. |
params | message. |
Definition at line 1580 of file c_chat.c.
References basic_emote(), and EMOTE_SPIT.
int command_ssdumptable | ( | object * | op, |
char * | params | ||
) |
Various string-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1117 of file c_misc.c.
References SS_DUMP_TABLE, and ss_dump_table().
int command_stack_clear | ( | object * | op, |
char * | params | ||
) |
Empty DM item stack.
op | wizard. |
params | ignored. |
Definition at line 2636 of file c_wiz.c.
References obj::contr, draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, and pl::stack_position.
int command_stack_list | ( | object * | op, |
char * | params | ||
) |
Displays stack contents.
op | wizard. |
params | ignored. |
Definition at line 2600 of file c_wiz.c.
References obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, obj::name, NDI_UNIQUE, pl::stack_items, and pl::stack_position.
int command_stack_pop | ( | object * | op, |
char * | params | ||
) |
Pop the stack top.
op | wizard. |
params | ignored. |
Definition at line 2563 of file c_wiz.c.
References obj::contr, and dm_stack_pop().
int command_stack_push | ( | object * | op, |
char * | params | ||
) |
Push specified item on stack.
op | wizard. |
params | object specifier. |
Definition at line 2578 of file c_wiz.c.
References obj::contr, obj::count, dm_stack_push(), get_dm_object(), and STACK_FROM_NUMBER.
int command_statistics | ( | object * | pl, |
char * | params | ||
) |
Prints out some useful information for the character. Everything we print out can be determined by the docs, so we aren't revealing anything extra - rather, we are making it convenient to find the values. params have no meaning here.
pl | player asking for information. |
params | unused. |
Definition at line 1300 of file c_misc.c.
References obj::arch, liv::Cha, archt::clone, liv::Con, obj::contr, liv::Dex, draw_ext_info(), draw_ext_info_format(), liv::exp, obj::expmul, get_language(), I18N_MSG_CMISC_108, I18N_MSG_CMISC_109, I18N_MSG_CMISC_110, I18N_MSG_CMISC_111, I18N_MSG_CMISC_112, I18N_MSG_CMISC_113, I18N_MSG_CMISC_114, I18N_MSG_CMISC_115, I18N_MSG_CMISC_116, I18N_MSG_CMISC_117, I18N_MSG_CMISC_118, I18N_MSG_CMISC_119, I18N_MSG_CMISC_120, I18N_MSG_CMISC_121, I18N_MSG_CMISC_122, I18N_MSG_CMISC_123, I18N_MSG_CMISC_124, I18N_MSG_CMISC_125, I18N_MSG_CMISC_126, I18N_MSG_CMISC_127, I18N_MSG_CMISC_128, I18N_MSG_CMISC_129, i18n_translate(), liv::Int, obj::level, level_exp(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, NDI_UNIQUE, pl::orig_stats, pl::peaceful, liv::Pow, obj::stats, liv::Str, and liv::Wis.
int command_stats | ( | object * | op, |
char * | params | ||
) |
Displays the statistics of a player.
op | wizard. |
params | player's name. |
Definition at line 1528 of file c_wiz.c.
References liv::ac, liv::Cha, liv::Con, liv::dam, liv::Dex, draw_ext_info(), draw_ext_info_format(), liv::exp, find_player_partial_name(), liv::food, liv::grace, liv::hp, liv::Int, liv::maxhp, liv::maxsp, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, liv::Pow, liv::sp, obj::stats, liv::Str, liv::wc, and liv::Wis.
int command_stay | ( | object * | op, |
char * | params | ||
) |
'stay' command. Used to specify to fire under oneself.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 181 of file c_move.c.
References obj::contr, fire(), and pl::fire_on.
int command_strings | ( | object * | op, |
char * | params | ||
) |
Various string-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 876 of file c_misc.c.
References draw_ext_info(), draw_ext_info_format(), HUGE_BUF, MSG_TYPE_COMMAND, MSG_TYPE_LAST, NDI_UNIQUE, ss_dump_statistics(), ss_dump_table(), and SS_DUMP_TOTALS.
int command_strut | ( | object * | op, |
char * | params | ||
) |
'strut' command.
op | player. |
params | message. |
Definition at line 1593 of file c_chat.c.
References basic_emote(), and EMOTE_STRUT.
int command_style_map_info | ( | object * | op, |
char * | params | ||
) |
Displays information about styles loaded for random maps.
op | wizard. |
params | ignored. |
Definition at line 2815 of file c_wiz.c.
References obj::above, draw_ext_info(), draw_ext_info_format(), GET_MAP_OB, MAP_HEIGHT, MAP_WIDTH, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapdef::next, and styles.
int command_sulk | ( | object * | op, |
char * | params | ||
) |
'sulk' command.
op | player. |
params | message. |
Definition at line 1203 of file c_chat.c.
References basic_emote(), and EMOTE_SULK.
int command_summon | ( | object * | op, |
char * | params | ||
) |
Summons player near DM.
op | DM. |
params | player to summon. |
Definition at line 661 of file c_wiz.c.
References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_free_spot(), free_object(), freearr_x, freearr_y, get_object(), get_other_player_from_name(), obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, mapdef::path, obj::x, and obj::y.
int command_take | ( | object * | op, |
char * | params | ||
) |
This takes (picks up) and item.
op | player who issued the command. |
params | string to match against the item name. |
Definition at line 602 of file c_object.c.
References obj::above, obj::below, can_pick(), obj::container, draw_ext_info(), draw_ext_info_format(), FLAG_IS_FLOOR, obj::inv, obj::invisible, item_matched_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, obj::name, NDI_UNIQUE, obj::next, pick_up(), and QUERY_FLAG.
int command_teleport | ( | object * | op, |
char * | params | ||
) |
Teleport next to target player.
op | DM teleporting. |
params | options sent by player. |
Definition at line 712 of file c_wiz.c.
References add_string(), obj::contr, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_free_spot(), find_player_partial_name(), free_object(), freearr_x, freearr_y, get_object(), pl::hidden, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, mapdef::path, obj::x, and obj::y.
int command_tell | ( | object * | op, |
char * | params | ||
) |
int command_thank | ( | object * | op, |
char * | params | ||
) |
'thank' command.
op | player. |
params | message. |
Definition at line 1606 of file c_chat.c.
References basic_emote(), and EMOTE_THANK.
int command_think | ( | object * | op, |
char * | params | ||
) |
'think' command.
op | player. |
params | message. |
Definition at line 1723 of file c_chat.c.
References basic_emote(), and EMOTE_THINK.
int command_throw | ( | object * | op, |
char * | params | ||
) |
'throw' command.
A little special because we do want to pass the full params along as it includes the object to throw.
op | player. |
params | what to throw. |
Definition at line 198 of file c_object.c.
References do_skill(), draw_ext_info(), obj::facing, find_skill_by_name(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, SK_THROWING, and skill_names.
int command_time | ( | object * | op, |
char * | params | ||
) |
Players asks for the time.
op | player asking for information. |
params | unused. |
Definition at line 900 of file c_misc.c.
References time_info().
int command_title | ( | object * | op, |
char * | params | ||
) |
Player wishes to change her title.
op | player asking for change. |
params | new title. |
Definition at line 2250 of file c_misc.c.
References obj::contr, draw_ext_info(), FALSE, get_language(), I18N_MSG_CMISC_197, I18N_MSG_CMISC_198, I18N_MSG_CMISC_199, I18N_MSG_CMISC_200, I18N_MSG_CMISC_201, I18N_MSG_CMISC_202, I18N_MSG_CMISC_203, i18n_translate(), is_dragon_pl(), MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, pl::own_title, replace_unprintable_chars(), Settings::set_title, settings, snprintf(), and pl::title.
int command_toggle_shout | ( | object * | op, |
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 459 of file c_wiz.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), EVENT_MUZZLE, execute_global_event(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ORANGE, NDI_RED, NDI_UNIQUE, pl::no_shout, and pl::ob.
int command_twiddle | ( | object * | op, |
char * | params | ||
) |
'twiddle' command.
op | player. |
params | message. |
Definition at line 1619 of file c_chat.c.
References basic_emote(), and EMOTE_TWIDDLE.
int command_unloadplugin | ( | object * | op, |
char * | params | ||
) |
Unloads the given plugin. The DM specified the ID of the library to unload. Note that some things may behave strangely if the correct plugins are not loaded.
op | DM unloading a plugin. |
params | should be the plugin's internal name, eg Python |
Definition at line 2298 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), llevInfo, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, and plugins_remove_plugin().
int command_use | ( | object * | op, |
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 2282 of file c_object.c.
References obj::arch, decrease_ob, draw_ext_info(), draw_ext_info_format(), find_archetype(), find_best_object_match(), get_ob_key_value(), insert_ob_in_ob(), llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, obj::name, archt::name, NDI_UNIQUE, obj::nrof, object_create_arch(), PLAYER, snprintf(), obj::subtype, and obj::type.
int command_usekeys | ( | object * | op, |
char * | params | ||
) |
Player wants to change how keys are used.
op | player asking for information. |
params | unused. |
Definition at line 1692 of file c_misc.c.
References containers, obj::contr, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_165, I18N_MSG_CMISC_166, I18N_MSG_CMISC_167, i18n_translate(), key_inventory, keyrings, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, and pl::usekeys.
int command_uskill | ( | object * | pl, |
char * | params | ||
) |
'use_skill' command.
pl | player. |
params | skill to use, and optional parameters. |
Definition at line 113 of file c_object.c.
References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and use_skill().
int command_version | ( | object * | op, |
char * | params | ||
) |
int command_wave | ( | object * | op, |
char * | params | ||
) |
'wave' command.
op | player. |
params | message. |
Definition at line 1632 of file c_chat.c.
References basic_emote(), and EMOTE_WAVE.
int command_west | ( | object * | op, |
char * | params | ||
) |
'west' command.
op | player. |
params | optional parameters for moving (fire, run). |
Definition at line 168 of file c_move.c.
References move_internal().
int command_whereabouts | ( | object * | op, |
char * | params | ||
) |
'whereabouts' command.
Displays how many players are in which regions.
op | player requesting information. |
params | unused. |
Definition at line 482 of file c_misc.c.
References regiondef::counter, draw_ext_info(), draw_ext_info_format(), first_player, first_region, get_language(), get_region_by_map(), get_region_longname(), I18N_MSG_CMISC_049, I18N_MSG_CMISC_050, i18n_translate(), llevError, LOG(), regiondef::longname, obj::map, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, regiondef::name, NDI_UNIQUE, pl::next, regiondef::next, pl::ob, and regiondef::parent.
int command_whereami | ( | object * | op, |
char * | params | ||
) |
'whereami' command.
op | player requesting the information. |
params | unused. |
Definition at line 848 of file c_misc.c.
References current_region_info().
int command_whistle | ( | object * | op, |
char * | params | ||
) |
'whistle' command.
op | player. |
params | message. |
Definition at line 1645 of file c_chat.c.
References basic_emote(), and EMOTE_WHISTLE.
int command_who | ( | object * | op, |
char * | params | ||
) |
'who' command.
op | player requesting the information. |
params | optional region to limit the information to. |
Definition at line 629 of file c_misc.c.
References get_region_from_string(), and list_players().
int command_wimpy | ( | object * | op, |
char * | params | ||
) |
Player wants to change how soon she'll flee.
op | player. |
params | new value. |
Definition at line 2353 of file c_misc.c.
References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_210, I18N_MSG_CMISC_211, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and obj::run_away.
int command_wink | ( | object * | op, |
char * | params | ||
) |
'wink' command.
op | player. |
params | message. |
Definition at line 1658 of file c_chat.c.
References basic_emote(), and EMOTE_WINK.
int command_wizcast | ( | object * | op, |
char * | params | ||
) |
Wizard toggling "cast everywhere" ability.
op | player asking for information. |
params | unused. |
Definition at line 1039 of file c_misc.c.
References CLEAR_FLAG, draw_ext_info(), FLAG_WIZCAST, get_language(), I18N_MSG_CMISC_097, I18N_MSG_CMISC_098, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.
int command_wizpass | ( | object * | op, |
char * | params | ||
) |
Wizard toggling wall-crossing.
op | player asking for information. |
params | unused. |
Definition at line 1006 of file c_misc.c.
References CLEAR_FLAG, draw_ext_info(), FLAG_WIZPASS, get_language(), I18N_MSG_CMISC_095, I18N_MSG_CMISC_096, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.
int command_yawn | ( | object * | op, |
char * | params | ||
) |
'yawn' command.
op | player. |
params | message. |
Definition at line 1671 of file c_chat.c.
References basic_emote(), and EMOTE_YAWN.
void communicate | ( | object * | op, |
const char * | txt | ||
) |
This function looks for an object or creature that is listening to said text.
There is a rare event that the orig_map is used for - basically, if a player says the magic word that gets him teleported off the map, it can result in the new map putting the object count too high, which forces the swap out of some other map. In some cases, the map the player was just on now gets swapped out - thus, the object on that map are no longer in memory. So check to see if the players map changes, and if so, don't process any further. If it does change, most likely we don't care about the results of further conversation. Also, depending on the value of i, the conversation would continue on the new map, which probably isn't what is really wanted either.
op | who is saying something. |
txt | what is said. |
Definition at line 1831 of file monster.c.
References obj::above, ext_info_map(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, llevDebug, LOG(), obj::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_SAY, obj::name, NDI_WHITE, P_OUT_OF_MAP, PLAYER, SIZEOFFREE2, snprintf(), talk_to_npc(), obj::type, obj::x, and obj::y.
Referenced by command_say().
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.
source | what wants to move. |
target | target to go to. |
default_dir | general direction from source to target. |
Definition at line 371 of file monster.c.
References absdir(), fatal(), freearr_x, freearr_y, mapdef::height, obj::map, MAX_EXPLORE, ob_blocked(), OUT_OF_MEMORY, OUT_OF_REAL_MAP, mapdef::width, obj::x, and obj::y.
Referenced by move_monster(), and move_to().
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 369 of file spell_attack.c.
References add_refcount(), arch_to_object(), free_string(), insert_ob_in_map(), obj::level, obj::map, obj::other_arch, obj::owner, set_owner(), obj::skill, obj::x, and obj::y.
Referenced by cast_cone(), and move_cone().
int confirm_party_password | ( | object * | op | ) |
Is the password the player entered to join a party the right one?
op | player. Must have party_to_join correctly set. |
0 | password is correct. |
1 | invalid password or party not found. |
Definition at line 228 of file c_party.c.
References obj::contr, party_struct::next, pl::party_to_join, party_struct::partyname, party_struct::passwd, and pl::write_buf.
Referenced by receive_party_password().
void confirm_password | ( | object * | op | ) |
Ask the player to confirm her password during creation.
op | player. |
Definition at line 877 of file player.c.
References obj::contr, CS_QUERY_HIDEINPUT, send_query(), pl::socket, ST_CONFIRM_PASSWORD, pl::state, and pl::write_buf.
Referenced by check_login().
Confuse a living thing.
op | victim. |
hitter | who is attacking. |
dam | damage to deal. |
Definition at line 2237 of file attack.c.
References add_string(), ATNR_CONFUSION, create_archetype(), draw_ext_info(), obj::duration, FLAG_CONFUSED, FORCE, FORCE_CONFUSION, FORCE_NAME, free_string(), insert_ob_in_ob(), MAX, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, NDI_UNIQUE, PLAYER, present_in_ob_by_name(), QUERY_FLAG, obj::resist, SET_FLAG, obj::speed, obj::subtype, and obj::type.
Referenced by charge_mana_effect(), hit_with_one_attacktype(), prayer_failure(), scroll_failure(), spell_failure(), and write_scroll().
void control_golem | ( | object * | op, |
int | dir | ||
) |
Makes the golem go in specified direction. This is a really stupid function when you get down and look at it. Keep it here for the time being - makes life easier if we ever decide to do more interesting thing with controlled golems.
op | golem. |
dir | desired direction. |
Definition at line 648 of file pets.c.
References obj::direction.
Referenced by animate_weapon(), and fire().
int coords_in_shop | ( | mapstruct * | map, |
int | x, | ||
int | y | ||
) |
Check if given map coords are in a shop.
map | |
x | |
y | coordinates to check. |
Definition at line 1429 of file shop.c.
References obj::above, GET_MAP_OB, SHOP_FLOOR, and obj::type.
Referenced by is_in_shop().
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 2795 of file spell_effect.c.
References obj::above, AT_COUNTERSPELL, AT_MAGIC, obj::attacktype, FLAG_MONSTER, liv::food, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, liv::hp, obj::level, obj::map, obj::owner, P_OUT_OF_MAP, QUERY_FLAG, remove_ob(), rndm(), RUNE, obj::speed_left, SPELL_EFFECT, obj::stats, obj::type, obj::x, and obj::y.
Referenced by hit_map().
Create an aura spell object and put it in the player's inventory.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
Definition at line 3213 of file spell_effect.c.
References arch_to_object(), obj::attacktype, caster_level(), liv::dam, draw_ext_info(), obj::duration, insert_ob_in_ob(), obj::level, MSG_TYPE_SPELL, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, obj::other_arch, PLAYER, present_arch_in_ob(), set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), obj::stats, store_spell_expiry(), and obj::type.
Referenced by cast_spell().
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 552 of file spell_attack.c.
References arch_to_object(), obj::attacktype, liv::dam, draw_ext_info(), obj::duration, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::map, MOVE_WALK, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, obj::other_arch, P_OUT_OF_MAP, obj::range, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
char* crypt_string | ( | char * | str, |
char * | salt | ||
) |
Encrypt a string. Used for password storage on disk.
Really, there is no reason to crypt the passwords any system. But easier to just leave this enabled for backward compatibility. Put the simple case at top - no encryption - makes it easier to read.
str | string to crypt. |
salt | salt to crypt with. |
Definition at line 130 of file server.c.
Referenced by check_password(), and receive_player_password().
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. |
0 | no disease was cured. |
1 | at least one disease was cured. |
Definition at line 715 of file disease.c.
References obj::below, change_exp(), obj::chosen_skill, DISEASE, draw_ext_info(), draw_ext_info_format(), liv::exp, FLAG_STARTEQUIP, free_object(), obj::inv, obj::level, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_SPELL, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, PREFER_LOW, QUERY_FLAG, random_roll(), remove_ob(), remove_symptoms(), obj::skill, obj::stats, and obj::type.
Referenced by cast_heal(), and kill_player().
void current_map_info | ( | object * | op | ) |
'mapinfo' command.
op | player requesting the information. |
Definition at line 421 of file c_misc.c.
References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_language(), get_region_by_map(), get_region_longname(), I18N_MSG_CMISC_046, i18n_translate(), obj::map, MAP_ENTER_X, MAP_ENTER_Y, MAP_HEIGHT, MAP_TIMEOUT, MAP_WIDTH, mapdef::msg, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, mapdef::name, NDI_UNIQUE, mapdef::path, mapdef::players, and QUERY_FLAG.
Referenced by command_mapinfo().
void current_region_info | ( | object * | op | ) |
'whereami' command.
Pretty much identical to current map_info(), but on a bigger scale
This function returns the name of the players current region, and a description of it. It is there merely for flavour text.
op | player wanting information. |
Definition at line 398 of file c_misc.c.
References draw_ext_info_format(), get_language(), get_name_of_region_for_map(), get_region_by_name(), get_region_longname(), get_region_msg(), I18N_MSG_CMISC_045, i18n_translate(), obj::map, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.
Referenced by command_whereami().
void dead_player | ( | object * | op | ) |
Kill a player on a permanent death server with resurrection.
op | player to kill. |
Definition at line 291 of file resurrection.c.
References llevError, Settings::localdir, LOG(), MAX_BUF, obj::name, Settings::playerdir, settings, snprintf(), and strerror_local().
Referenced by kill_player().
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 97 of file login.c.
References Settings::localdir, MAX_BUF, Settings::playerdir, remove_directory(), settings, and snprintf().
Referenced by key_confirm_quit(), and kill_player().
int describe_shop | ( | const object * | op | ) |
Gives a desciption of the shop on their current map to the player op.
op | player to describe the shop for. Mustn't be NULL. |
Definition at line 1311 of file shop.c.
References cost_string_from_value(), draw_ext_info(), draw_ext_info_format(), shopitem::index, make_list_like(), obj::map, MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_LISTING, MSG_TYPE_SHOP_MISC, shopitem::name, shopitem::name_pl, NDI_UNIQUE, PLAYER, mapdef::shopgreed, mapdef::shopitems, shopkeeper_approval(), mapdef::shopmax, mapdef::shopmin, mapdef::shoprace, snprintf(), shopitem::strength, stringbuffer_finish(), and obj::type.
Referenced by do_skill().
void destroy_object | ( | object * | op | ) |
Recursively free_object() op and its inventory.
op | object to totally free_object(). |
Definition at line 201 of file login.c.
References FLAG_REMOVED, free_object(), obj::inv, QUERY_FLAG, and remove_ob().
Referenced by save_player(), and trap_disarm().
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 118 of file gods.c.
References add_string(), obj::below, first_god, FLAG_ALIVE, get_god_for_race(), glnk::id, obj::inv, lookup_god_by_name(), glnk::name, glnk::next, PLAYER, QUERY_FLAG, obj::race, rndm(), SK_PRAYING, SKILL, SPELL, SPELL_EFFECT, obj::subtype, obj::title, and obj::type.
Referenced by become_follower(), cast_bless(), cast_consecrate(), cast_curse(), cast_detection(), cast_smite_spell(), cast_spell(), cfapi_object_get_property(), hit_player(), hit_with_one_attacktype(), kill_player(), mood_change(), perceive_self(), pray_at_altar(), prayer_failure(), show_skills(), summon_golem(), summon_object(), and tailor_god_spell().
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 782 of file gods.c.
References BOOK, archt::clone, obj::invisible, treasurestruct::item, treasureliststruct::items, llevError, LOG(), obj::name, treasurestruct::next, obj::other_arch, obj::randomitems, rndm(), and obj::type.
Referenced by summon_golem().
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 1551 of file spell_effect.c.
References obj::contr, pl::count, draw_ext_info(), FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::map, map_newmap_cmd(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_BLOCKSVIEW, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, obj::range, remove_ob(), pl::socket, SP_level_range_adjust(), obj::speed, obj::speed_left, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
Someone is trying to disarm a rune. The actual attempt is done in trap_disarm().
op | object trying to disarm. |
caster | object casting the disarm spell. |
spell | actual spell for casting. |
skill | skill to disarm runes. |
dir | direction to disarm. |
0 | rune wasn't disarmed. |
1 | a rune was disarmed. |
Definition at line 323 of file rune.c.
References obj::above, obj::arch, obj::below, draw_ext_info(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::inv, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, archt::name, NDI_UNIQUE, P_OUT_OF_MAP, remove_ob(), RUNE, SIGN, TRAP, trap_disarm(), obj::type, obj::x, and obj::y.
Referenced by cast_spell().
void display_high_score | ( | 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 set, will only print players with name or title containing the string (non case-sensitive). |
Definition at line 402 of file hiscore.c.
References close_and_delete(), draw_ext_info(), draw_one_high_score(), get_score(), HIGHSCORE, HIGHSCORE_LENGTH, llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, scr::name, NDI_UNIQUE, open_and_uncompress(), scr::position, settings, snprintf(), strcasestr_local(), strerror_local(), and scr::title.
Referenced by command_hiscore(), showscores(), and showscoresparm().
void display_motd | ( | const object * | op | ) |
Sends the message of the day to the player.
op | player to send to. |
Definition at line 112 of file player.c.
References close_and_delete(), Settings::confdir, draw_ext_info(), HUGE_BUF, MAX_BUF, Settings::motd, MSG_SUBTYPE_NONE, MSG_TYPE_MOTD, NDI_GREEN, NDI_UNIQUE, open_and_uncompress(), settings, and snprintf().
Referenced by add_player(), command_motd(), and receive_player_password().
Display a line of 'who' to op, about pl, using the formatting specified by format.
op | player getting the information. |
pl | player to display information for. |
format | format to display. |
Definition at line 648 of file c_misc.c.
References draw_ext_info(), get_who_escape_code_value(), llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, NDI_UNIQUE, and snprintf().
Referenced by list_players().
Get current stack top item for player. Returns NULL if no stacked item. If stacked item disappeared (freed), remove it.
Ryo, august 2004
pl | wizard. |
Definition at line 2373 of file c_wiz.c.
References dm_stack_pop(), draw_ext_info(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, and pl::stack_position.
Referenced by get_dm_object().
void dm_stack_pop | ( | player * | pl | ) |
Remove an item from the wizard's item stack.
pl | wizard. |
Definition at line 2347 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, and pl::stack_position.
Referenced by command_create(), command_diff(), command_free(), command_insert_into(), command_remove(), command_stack_pop(), and dm_stack_peek().
Push specified item on player stack. Inform player of position. Initializes variables if needed.
pl | wizard. |
item | item to put on stack. |
Definition at line 2403 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, pl::stack_position, and STACK_SIZE.
Referenced by command_create(), command_dumpbelow(), command_stack_push(), and get_dm_object().
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 440 of file apply.c.
References check_spell_known(), obj::contr, draw_ext_info_format(), esrv_remove_spell(), free_object(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, NDI_NAVY, NDI_UNIQUE, PLAYER, player_unready_range_ob(), remove_ob(), and obj::type.
Referenced by cfapi_object_forget_spell(), check_special_prayers(), command_forget_spell(), and spellbook_type_apply().
Player is trying to harvest something.
pl | player trying to harvest. |
dir | direction. |
skill | skill being used. |
Definition at line 2472 of file c_misc.c.
References obj::above, obj::below, change_exp(), obj::chosen_skill, copy_object_with_inv(), draw_ext_info_format(), find_free_spot(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_ob_key_value(), get_object(), insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::level, llevError, LOG(), obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, obj::name, NDI_WHITE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, random_roll(), remove_ob(), rndm(), set_ob_key_value(), SIZEOFFREE, SK_EXP_ADD_SKILL, obj::skill, obj::slaying, obj::speed, obj::speed_left, obj::type, obj::x, and obj::y.
Referenced by do_skill().
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 3796 of file player.c.
References calc_skill_exp(), change_exp(), obj::contr, mapdef::difficulty, draw_ext_info(), find_obj_by_type_subtype(), hide(), hideability(), obj::invisible, obj::level, make_visible(), obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, PREFER_LOW, random_roll(), pl::run_on, SK_HIDING, SKILL, obj::skill, and obj::type.
Referenced by move_monster(), and move_player().
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 398 of file apply.c.
References check_spell_known(), obj::contr, copy_object(), draw_ext_info_format(), esrv_add_spells(), FLAG_STARTEQUIP, get_object(), insert_ob_in_ob(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, obj::name, NDI_UNIQUE, play_sound_player_only(), PLAYER, QUERY_FLAG, SET_FLAG, SOUND_TYPE_SPELL, and obj::type.
Referenced by cfapi_object_learn_spell(), command_learn_spell_or_prayer(), dragon_ability_gain(), god_intervention(), and spellbook_type_apply().
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 373 of file skill_util.c.
References obj::anim_suffix, apply_anim_suffix(), attack_hth(), attack_melee_weapon(), obj::below, change_exp(), obj::chosen_skill, CLEAR_FLAG, describe_shop(), do_harvest(), draw_ext_info(), find_traps(), fix_object(), FLAG_APPLIED, give_skill_by_name(), hide(), obj::inv, jump(), llevDebug, LOG(), MAX_BUF, meditate(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, pick_lock(), PLAYER, pray(), QUERY_FLAG, query_name(), remove_trap(), SET_FLAG, singing(), SK_ALCHEMY, SK_BARGAINING, SK_BOWYER, SK_CLAWING, SK_CLIMBING, SK_DET_CURSE, SK_DET_MAGIC, SK_DISARM_TRAPS, SK_EVOCATION, SK_FIND_TRAPS, SK_FLAME_TOUCH, SK_HARVESTING, SK_HIDING, SK_INSCRIPTION, SK_JEWELER, SK_JUMPING, SK_KARATE, SK_LEVITATION, SK_LITERACY, SK_LOCKPICKING, SK_MEDITATION, SK_MISSILE_WEAPON, SK_ONE_HANDED_WEAPON, SK_ORATORY, SK_PRAYING, SK_PUNCHING, SK_PYROMANCY, SK_SET_TRAP, SK_SINGING, SK_SMITHERY, SK_SORCERY, SK_STEALING, SK_SUBTRACT_SKILL_EXP, SK_SUMMONING, SK_THAUMATURGY, SK_THROWING, SK_TWO_HANDED_WEAPON, SK_USE_MAGIC_ITEM, SK_WOODSMAN, SK_WRAITH_FEED, SKILL, obj::skill, skill_ident(), skill_throw(), liv::sp, obj::speed_left, obj::stats, steal(), obj::subtype, obj::type, use_alchemy(), use_oratory(), and write_on_item().
Referenced by command_throw(), fire(), monster_use_skill(), and use_skill().
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 3017 of file player.c.
References Output_Buf::buf, obj::contr, Output_Buf::first_update, flush_output_element(), liv::food, pl::gen_hp, pl::gen_sp, liv::maxhp, liv::maxsp, NUM_OUTPUT_BUFS, pl::outputs, pl::outputs_sync, pticks, ST_PLAYING, pl::state, and obj::stats.
Referenced by command_possess(), and process_players1().
int do_wizard_dm | ( | object * | op, |
char * | params, | ||
int | silent | ||
) |
Actually changes a player to wizard.
op | player. |
params | password. |
silent | if zero, don't inform players of the mode change. |
0 | no mode change. |
1 | op is now a wizard. |
Definition at line 1932 of file c_wiz.c.
References checkdm(), clear_los(), obj::contr, draw_ext_info(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, socket_struct::host, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ALL, NDI_LT_GREEN, NDI_UNIQUE, QUERY_FLAG, SET_FLAG, pl::socket, and pl::write_buf.
Referenced by command_dm(), and command_dmhide().
void do_wizard_hide | ( | object * | op, |
int | silent_dm | ||
) |
Actually hides or unhides specified player (obviously a DM).
op | DM hiding. |
silent_dm | if non zero, other players are informed of DM entering/leaving, else they just think someone left/entered. |
Definition at line 147 of file c_wiz.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), pl::hidden, obj::invisible, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_LT_GREEN, NDI_UNIQUE, and mapdef::players.
Referenced by command_dmhide(), and command_hide().
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 203 of file standalone.c.
References obj::anim_speed, animate_object(), obj::animation_id, obj::arch, arch_to_object(), AT_PHYSICAL, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_POISON, obj::attacktype, obj::below, check_spell_known(), archt::clone, obj::direction, do_learn_spell(), draw_ext_info(), draw_ext_info_format(), esrv_send_item(), obj::face, find_skill_by_name(), find_treasurelist(), FLAG_SEE_IN_DARK, FLAG_STEALTH, FLAG_XRAYS, FORCE, HUGE_BUF, insert_ob_in_ob(), obj::inv, obj::invisible, treasurestruct::item, treasureliststruct::items, obj::last_anim, llevDebug, LOG(), MAX_BUF, obj::msg, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_RACE, MSG_TYPE_ITEM, MSG_TYPE_ITEM_ADD, obj::name, archt::name, NDI_BLUE, NDI_UNIQUE, NRSPELLPATHS, obj::path_attuned, PLAYER, QUERY_FLAG, query_short_name(), SET_FLAG, SK_CLAWING, obj::skill, SKILL_TOOL, snprintf(), SPELL, SPELLBOOK, spellpathnames, obj::state, obj::subtype, and obj::type.
Referenced by dragon_level_gain().
void drain_rod_charge | ( | object * | rod | ) |
Drain charges from a rod.
rod | rod to drain. |
Definition at line 743 of file spell_util.c.
References liv::hp, obj::inv, SP_level_spellpoint_cost(), SPELL_HIGHEST, and obj::stats.
Referenced by fire_misc_object(), and monster_use_range().
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 753 of file spell_util.c.
References obj::arch, CLEAR_FLAG, archt::clone, esrv_update_item(), obj::face, FLAG_ANIMATE, liv::food, get_player_container(), obj::speed, obj::stats, obj::type, UPD_ANIM, update_ob_speed(), and WAND.
Referenced by fire_misc_object(), and monster_use_range().
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 943 of file c_object.c.
References obj::above, obj::below, obj::container, obj::contr, obj::count, pl::count, draw_ext_info(), drop_object(), obj::env, FLAG_INV_LOCKED, FLAG_NO_DROP, free_object(), obj::invisible, pl::last_used, pl::last_used_id, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, put_object_in_sack(), QUERY_FLAG, remove_ob(), and obj::type.
Referenced by cfapi_object_drop(), command_drop(), command_dropall(), empty_container(), and handle_apply_yield().
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 847 of file c_object.c.
References AP_NO_MERGE, AP_UNAPPLY, apply_special(), obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), EVENT_DROP, execute_event(), fix_object(), FLAG_APPLIED, FLAG_NO_DROP, FLAG_NO_FIX_PLAYER, FLAG_STARTEQUIP, FLAG_UNPAID, free_object(), get_split_ob(), insert_ob_in_map(), is_in_shop(), obj::map, MAX_BUF, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, obj::nrof, PLAYER, QUERY_FLAG, query_name(), remove_ob(), save_player(), SCRIPT_FIX_ALL, sell_item(), obj::type, UPD_WEIGHT, obj::value, was_destroyed, obj::x, and obj::y.
Referenced by drop(), esrv_move_object(), and transport_type_apply().
void dump_spells | ( | void | ) |
Dumps all the spells - now also dumps skill associated with the spell. not sure what this would be used for, as the data seems pretty minimal, but easy enough to keep around.
Definition at line 157 of file spell_util.c.
References archt::clone, first_archetype, obj::level, obj::name, archt::name, archt::next, obj::other_arch, obj::skill, SPELL, and obj::type.
Referenced by init_beforeplay().
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 191 of file standalone.c.
References check_score(), draw_ext_info(), first_map_path, first_player, llevError, llevInfo, LOG(), obj::map, pl::maplevel, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, obj::name, NDI_UNIQUE, pl::next, pl::ob, save_player(), trying_emergency_save, obj::x, and obj::y.
Referenced by fatal(), fatal_signal(), LOG(), and server_main().
Tries to move 'op' to exit_ob.
This is used when loading the player.
Largely redone by MSW 2001-01-21 - this function was overly complex and had some obscure bugs.
op | character or monster that is using the exit. |
exit_ob | exit object (boat, door, teleporter, etc.). if null, then op->contr->maplevel contains that map to move the object to. |
Definition at line 740 of file server.c.
References AP_UNAPPLY, obj::attacktype, pl::bed_x, pl::bed_y, obj::below, obj::contr, liv::dam, draw_ext_info_format(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_fixed_template_map(), enter_map(), enter_random_map(), enter_random_template_map(), enter_unique_map(), EXIT_PATH, EXIT_X, EXIT_Y, FLAG_DAMNED, FLAG_UNIQUE, flags, FORCE, free_object(), hit_player(), HUGE_BUF, obj::inv, llevDebug, llevError, Settings::localdir, LOG(), obj::map, MAP_ENTER_X, MAP_ENTER_Y, MAP_PLAYER_UNIQUE, pl::maplevel, obj::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, obj::name, NDI_UNIQUE, ob_apply(), mapdef::path, path_combine_and_normalize(), PLAYER, PORTAL_DESTINATION_NAME, QUERY_FLAG, ready_map_name(), remove_ob(), save_player(), pl::savebed_map, settings, obj::slaying, obj::stats, pl::transport, obj::type, obj::x, and obj::y.
Referenced by check_login(), command_arrest(), command_goto(), command_reset(), command_summon(), command_teleport(), enter_player_savebed(), execute_word_of_recall(), exit_type_apply(), exit_type_move_on(), key_change_class(), move_teleporter(), player_changer_type_process(), and set_first_map().
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 175 of file server.c.
References add_string(), pl::bed_x, pl::bed_y, obj::contr, Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, free_object(), free_string(), get_object(), llevDebug, LOG(), obj::map, obj::name, mapdef::path, pl::savebed_map, and settings.
Referenced by kill_player(), and save_life().
Player examines some object.
op | player. |
tmp | object to examine. |
Definition at line 1481 of file c_object.c.
References obj::body_info, body_locations, BOOK, CLOSE_CON, CONTAINER, CORPSE, obj::custom_name, draw_ext_info(), draw_ext_info_format(), examine_monster(), EXIT, F_APPROX, F_BUY, F_SELL, F_SHOP, FLAG_IDENTIFIED, FLAG_IS_BUILDABLE, FLAG_MONSTER, FLAG_NO_PICK, FLAG_STARTEQUIP, FLAG_UNPAID, liv::food, get_levelnumber(), obj::inv, is_in_shop(), obj::level, obj::materialname, obj::move_on, obj::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, obj::name, NDI_UNIQUE, need_identify(), obj::nrof, NUM_BODY_LOCATIONS, ob_describe(), query_cost_string(), QUERY_FLAG, obj::race, obj::skill, snprintf(), SPELLBOOK, obj::stats, liv::Str, stringbuffer_finish(), strncasecmp(), obj::type, obj::value, VERY_BIG_BUF, WAND, obj::weight, and obj::weight_limit.
Referenced by command_examine(), and examine_cmd().
Player examine a monster.
op | player. |
tmp | monster being examined. |
Definition at line 1424 of file c_object.c.
References AT_ACID, obj::attacktype, draw_ext_info(), FLAG_UNDEAD, obj::head, liv::hp, obj::level, liv::maxhp, mon, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, NDI_UNIQUE, POISONING, present_in_ob(), QUERY_FLAG, and obj::stats.
Referenced by examine(), and probe().
int execute_event | ( | object * | op, |
int | eventcode, | ||
object * | activator, | ||
object * | third, | ||
const char * | message, | ||
int | fix | ||
) |
Definition at line 225 of file standalone.c.
References obj::below, EVENT_CONNECTOR, _crossfire_plugin::eventfunc, FLAG_UNIQUE, free_object(), obj::inv, llevDebug, llevError, LOG(), obj::map, obj::name, mapdef::name, object_get_env_recursive(), plugins_find_plugin(), QUERY_FLAG, remove_ob(), obj::slaying, obj::subtype, obj::title, obj::type, obj::x, and obj::y.
Referenced by apply_container(), attack_ob_simple(), cftimer_process_event(), common_pre_ob_move_on(), do_throw(), drop_object(), free_object2(), hit_with_arrow(), kill_object(), kill_player(), manual_apply(), move_teleporter(), pick_up_object(), player_changer_type_process(), pray_at_altar(), process_object(), stop_projectile(), talk_to_npc(), trigger_connected(), user_event(), write_note(), and write_scroll().
int execute_global_event | ( | int | eventcode, |
... | |||
) |
Definition at line 229 of file standalone.c.
References EVENT_BORN, EVENT_CLOCK, EVENT_CRASH, EVENT_GKILL, EVENT_KICK, EVENT_LOGIN, EVENT_LOGOUT, EVENT_MAPENTER, EVENT_MAPLEAVE, EVENT_MAPLOAD, EVENT_MAPRESET, EVENT_MAPUNLOAD, EVENT_MUZZLE, EVENT_PLAYER_DEATH, EVENT_REMOVE, EVENT_SHOUT, EVENT_TELL, _crossfire_plugin::gevent, and _crossfire_plugin::next.
Referenced by apply_savebed(), check_login(), command_kick(), command_tell_all(), command_toggle_shout(), do_tell(), enter_map(), flush_old_maps(), free_map(), key_change_class(), key_confirm_quit(), kill_object(), kill_player(), load_original_map(), server_main(), and swap_map().
int execute_newserver_command | ( | object * | pl, |
char * | command | ||
) |
Player issued a command, let's handle it.
This function is called from the new client/server code.
pl | player who is issuing the command |
command | the actual command with its arguments. |
Definition at line 98 of file c_new.c.
References Commands, CommandsSize, CommunicationCommands, CommunicationCommandSize, obj::contr, draw_ext_info_format(), find_command_element(), find_plugin_command(), FLAG_WIZ, command_array_struct::func, pl::has_hit, llevDebug, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, obj::speed_left, command_array_struct::time, tolower, WizCommands, and WizCommandsSize.
Referenced by new_player_cmd().
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 144 of file spell_attack.c.
References add_refcount(), arch_to_object(), AT_GODPOWER, AT_HOLYWORD, AT_MAGIC, obj::attacktype, copy_owner(), obj::count, liv::dam, obj::dam_modifier, obj::direction, obj::duration, obj::env, FREE_AND_CLEAR_STR, free_object(), get_owner(), hit_map(), liv::hp, INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), llevError, LOG(), obj::map, liv::maxhp, obj::move_on, object_get_env_recursive(), obj::other_arch, out_of_map(), obj::range, remove_ob(), obj::skill, liv::sp, SP_BOMB, SP_CONE, SPELL_EFFECT, obj::stats, obj::subtype, tailor_god_spell(), obj::type, was_destroyed, obj::x, and obj::y.
Referenced by animate_bomb(), check_bullet(), and move_bullet().
const object* find_god | ( | const char * | name | ) |
Returns pointer to specified god's object through pntr_to_god_obj().
name | god's name. |
Definition at line 92 of file gods.c.
References first_god, glnk::name, glnk::next, and pntr_to_god_obj().
Referenced by become_follower(), cast_bless(), cast_consecrate(), cast_curse(), cast_detection(), cast_smite_spell(), command_setgod(), hit_player(), hit_with_one_attacktype(), mood_change(), perceive_self(), pray_at_altar(), summon_golem(), summon_object(), and tailor_god_spell().
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 2278 of file player.c.
References obj::below, CONTAINER, obj::contr, DOOR, draw_ext_info_format(), FLAG_APPLIED, obj::inv, KEY, key_inventory, keyrings, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, NDI_BROWN, NDI_UNIQUE, QUERY_FLAG, query_name(), obj::race, obj::slaying, SPECIAL_KEY, obj::type, and pl::usekeys.
Referenced by apply_container(), and player_attack_door().
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 1339 of file c_object.c.
References obj::below, obj::contr, obj::count, obj::inv, obj::invisible, pl::mark, and pl::mark_count.
Referenced by animate_weapon(), apply_map_builder(), armour_improver_type_apply(), cast_item_curse_or_curse(), cfapi_object_get_property(), command_mark(), command_rename_item(), find_throw_ob(), identify_altar_type_move_on(), lighter_type_apply(), recharge(), weapon_improver_type_apply(), and write_on_item().
Definition at line 1978 of file monster.c.
References obj::below, obj::count, FLAG_APPLIED, FLAG_IS_THROWN, obj::head, obj::inv, obj::invisible, llevDebug, LOG(), MAX_BUF, obj::name, QUERY_FLAG, and query_name().
Referenced by skill_throw().
Returns the nearest living creature (monster or generator). Modified to deal with tiled maps properly. Also fixed logic so that monsters in the lower directions were more likely to be skipped - instead of just skipping the 'start' number of direction, revisit them after looking at all the other spaces.
Note that being this may skip some number of spaces, it will not necessarily find the nearest living creature - it basically chooses one from within a 3 space radius, and since it skips the first few directions, it could very well choose something 3 spaces away even though something directly north is closer.
This function is map tile aware.
npc | monster to consider |
Definition at line 162 of file monster.c.
References obj::above, can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_search_arr(), llevDebug, LOG(), obj::map, P_IS_ALIVE, P_OUT_OF_MAP, mapdef::path, PLAYER, QUERY_FLAG, SIZEOFFREE, obj::type, obj::x, and obj::y.
Referenced by find_enemy(), and get_pet_enemy().
player* find_player | ( | const char * | plname | ) |
Find a player by her full name.
plname | name to find. |
Definition at line 62 of file player.c.
References first_player, MAX_BUF, pl::next, pl::ob, and query_name().
Referenced by command_reply(), and list_players().
player* find_player_partial_name | ( | const char * | plname | ) |
Find a player by a partial name.
plname | name to match. |
Definition at line 84 of file player.c.
References first_player, obj::name, pl::next, pl::ob, and strncasecmp().
Referenced by cfapi_player_find(), command_follow(), command_stats(), command_teleport(), do_tell(), and process_players1().
command_array_struct* find_plugin_command | ( | char * | cmd, |
object * | op | ||
) |
Definition at line 4568 of file plugins.c.
References _crossfire_plugin::next, and _crossfire_plugin::propfunc.
Referenced by execute_newserver_command().
racelink* find_racelink | ( | const char * | name | ) |
Find the race information for the specified name.
name | race to search for. |
Definition at line 1468 of file init.c.
References first_race, ralnk::name, and ralnk::next.
Referenced by add_to_racelist(), and choose_cult_monster().
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 60 of file spell_util.c.
References obj::below, obj::inv, obj::skill, SPELL, and obj::type.
Referenced by cast_spell(), and write_scroll().
This returns the skill pointer of the given name (the one that accumlates exp, has the level, etc).
It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.
This code is basically the same as find_skill_by_number() below, but instead of a skill number, we search by the name.
who | Player to get skill. |
name | skill to find. Needs not to be a shared string. |
Definition at line 207 of file skill_util.c.
References adjust_skill_tool(), obj::below, FLAG_APPLIED, obj::inv, QUERY_FLAG, SKILL, SKILL_TOOL, and strncasecmp().
Referenced by apply_special(), attempt_do_alchemy(), attempt_recipe(), book_type_apply(), cast_destruction(), cast_dust(), cast_spell(), command_addexp(), command_cast_spell(), command_rskill(), command_throw(), do_skill_attack(), dragon_ability_gain(), inscribe_scroll_cmd(), scroll_type_apply(), spellbook_type_apply(), and write_on_item().
This returns the skill pointer of the given name (the one that accumlates exp, has the level, etc).
It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.
This code is basically the same as find_skill_by_name() above, but instead of a skill name, we search by matching number.
who | player applying a skill. |
skillno | skill subtype. |
Definition at line 209 of file standalone.c.
References adjust_skill_tool(), obj::below, FLAG_APPLIED, obj::inv, NUM_SKILLS, QUERY_FLAG, SKILL, and SKILL_TOOL.
Referenced by can_detect_enemy(), check_move_on(), find_best_player_hth_skill(), god_enchants_weapon(), query_cost(), and query_cost_string().
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 779 of file spell_util.c.
References obj::above, obj::below, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), obj::inv, obj::map, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, TRANSPORT, obj::type, obj::x, and obj::y.
Referenced by cast_bless(), cast_change_ability(), and cast_heal().
Checks for traps on the spaces around the player or in certain objects.
pl | player searching. |
skill | find trap skill object. |
Definition at line 1207 of file skills.c.
References obj::above, obj::below, calc_skill_exp(), liv::Cha, draw_ext_info(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::inv, obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, obj::owner, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, obj::stats, TRAP, trap_see(), trap_show(), obj::type, obj::x, and obj::y.
Referenced by do_skill().
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 2204 of file player.c.
References action_makes_visible(), apply_map_builder(), cast_spell(), obj::chosen_skill, obj::contr, control_golem(), obj::count, do_skill(), draw_ext_info(), fire_misc_object(), pl::golem_count, make_visible(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, player_fire_bow(), range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_skill, pl::ranges, pl::shoottype, pl::spellparam, and obj::type.
Referenced by command_stay(), and move_player().
int fire_arch_from_position | ( | object * | op, |
object * | caster, | ||
sint16 | x, | ||
sint16 | 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 653 of file spell_util.c.
References arch_to_object(), AT_GODPOWER, AT_HOLYWORD, obj::attacktype, caster_level(), copy_owner(), liv::dam, obj::direction, draw_ext_info(), obj::duration, FLAG_IS_TURNABLE, liv::food, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_owner(), insert_ob_in_map(), obj::level, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, ob_process(), OB_TYPE_MOVE_BLOCK, obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, SET_ANIMATION, set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, tailor_god_spell(), obj::type, obj::x, and obj::y.
Referenced by alchemy_failure_effect(), cast_spell(), and move_swarm_spell().
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. |
skill | skill to credit kill experience to. |
0 | no bolt could be fired. |
1 | bolt was fired (but may have been destroyed already). |
Definition at line 78 of file spell_attack.c.
References absdir(), add_refcount(), arch_to_object(), obj::attacktype, liv::Con, liv::dam, liv::Dex, obj::direction, DIRX, DIRY, obj::duration, FLAG_IS_TURNABLE, FLAG_REFLECTING, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::map, ob_process(), OB_TYPE_MOVE_BLOCK, obj::other_arch, P_OUT_OF_MAP, QUERY_FLAG, obj::range, SET_ANIMATION, set_owner(), set_spell_skill(), obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
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 1922 of file player.c.
References add_refcount(), add_string(), AT_PHYSICAL, obj::attacktype, obj::below, BOW, bow_bestarrow, pl::bowtype, obj::chosen_skill, CLEAR_FLAG, obj::contr, obj::count, liv::dam, dam_bonus, liv::Dex, dex_bonus, obj::direction, draw_ext_info(), draw_ext_info_format(), FABS, find_arrow(), fix_object(), FLAG_NO_STRENGTH, FLAG_READY_BOW, free_object(), free_string(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_split_ob(), liv::grace, liv::hp, insert_ob_in_map(), obj::inv, obj::level, llevError, LOG(), obj::magic, obj::map, MOVE_FLY_LOW, obj::move_on, obj::move_type, MOVE_WALK, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, obj::nrof, ob_process(), P_OUT_OF_MAP, play_sound_map(), PLAYER, QUERY_FLAG, obj::race, range_bow, pl::ranges, remove_ob(), SET_ANIMATION, set_owner(), obj::skill, obj::slaying, SOUND_TYPE_ITEM, liv::sp, obj::speed, obj::speed_left, obj::spellarg, obj::stats, liv::Str, strdup_local(), thaco_bonus, obj::type, update_ob_speed(), was_destroyed, liv::wc, obj::x, and obj::y.
Referenced by monster_use_bow(), and player_fire_bow().
Casts a bullet-like spell.
We remove the magic flag - that can be derived from spob->attacktype. This function sets up the appropriate owner and skill pointers.
op | who is casting. |
caster | what object is really casting. |
dir | casting direction. |
spob | spell object for the bullet. |
0 | no bullet could be fired. |
1 | bullet was fired (but may have been destroyed already). |
Definition at line 301 of file spell_attack.c.
References absdir(), add_refcount(), arch_to_object(), obj::attacktype, check_bullet(), liv::dam, obj::dam_modifier, obj::direction, obj::duration, FLAG_IS_TURNABLE, FLAG_REFLECTING, liv::food, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, liv::hp, insert_ob_in_map(), obj::map, liv::maxhp, OB_TYPE_MOVE_BLOCK, obj::other_arch, P_OUT_OF_MAP, QUERY_FLAG, obj::range, SET_ANIMATION, set_owner(), set_spell_skill(), obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, obj::x, and obj::y.
Referenced by cast_spell(), and move_swarm_spell().
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 1185 of file spell_attack.c.
References arch_to_object(), AT_GODPOWER, AT_HOLYWORD, obj::attacktype, caster_level(), create_archetype(), die_roll(), obj::direction, obj::duration, insert_ob_in_map(), obj::invisible, obj::level, obj::map, obj::other_arch, PREFER_HIGH, set_owner(), set_spell_skill(), SP_level_duration_adjust(), obj::spell, SWARM_SPELL, tailor_god_spell(), obj::x, and obj::y.
Referenced by cast_spell().
void fix_auto_apply | ( | mapstruct * | m | ) |
Go through the entire map (only the first time when an original map is loaded) and performs special actions for certain objects (most initialization of chests and creation of treasures and stuff). Calls auto_apply() if appropriate.
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 130 of file standalone.c.
References obj::above, ALTAR, obj::arch, auto_apply(), obj::below, check_trigger(), CLASS, CONTAINER, create_treasure(), mapdef::difficulty, FIREWALL, FLAG_AUTO_APPLY, FLAG_IS_LINKED, GET_MAP_OB, GT_APPLY, HAS_RANDOM_ITEMS, obj::head, HORN, liv::hp, obj::inv, MAP_HEIGHT, MAP_WIDTH, PLAYER, PLAYER_CHANGER, POTION, QUERY_FLAG, obj::randomitems, ROD, SCROLL, obj::speed, SPELL, SPELLBOOK, obj::stats, TIMED_GATE, TREASURE, TRIGGER_BUTTON, TRIGGER_PEDESTAL, obj::type, update_ob_speed(), and WAND.
Referenced by enter_fixed_template_map(), enter_unique_map(), generate_random_map(), load_temporary_map(), ready_map_name(), and START_TEST().
void fix_luck | ( | void | ) |
Fixes luck of players, slowly move it towards 0.
Definition at line 3661 of file player.c.
References change_luck(), obj::contr, first_player, pl::next, pl::ob, and pl::state.
Referenced by do_specials().
An ARROW stops moving.
op | arrow stopping. |
Definition at line 483 of file time.c.
References add_string(), obj::arch, obj::attacktype, archt::clone, liv::dam, obj::direction, obj::face, liv::food, FREE_AND_CLEAR_STR, free_no_drop(), free_object(), liv::grace, liv::hp, obj::level, obj::move_on, obj::move_type, obj::owner, remove_ob(), rndm(), obj::skill, obj::slaying, liv::sp, obj::speed, obj::spellarg, obj::stats, UP_OBJ_FACE, update_ob_speed(), update_object(), and liv::wc.
Referenced by hit_with_arrow(), stop_item(), and stop_projectile().
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 466 of file time.c.
References ARROW, FLAG_REMOVED, insert_ob_in_map(), merge_ob(), QUERY_FLAG, and obj::type.
Referenced by save_throw_object().
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 3645 of file player.c.
References obj::carrying, first_player, fix_object(), llevDebug, LOG(), obj::name, pl::next, pl::ob, and sum_weight().
Referenced by do_specials().
void flush_old_maps | ( | void | ) |
Removes tmp-files of maps which are going to be reset next time they are visited. This is very useful if the tmp-disk is very full.
Definition at line 305 of file swap.c.
References clean_tmp_map(), delete_map(), EVENT_MAPRESET, execute_global_event(), first_map, mapdef::in_memory, mapdef::is_template, llevDebug, LOG(), MAP_IN_MEMORY, MAP_SWAPPED, mapdef::next, mapdef::path, players_on_map(), seconds(), set_map_timeout(), mapdef::timeout, mapdef::tmpname, TRUE, and mapdef::unique.
Referenced by block_until_new_connection(), command_reset(), and do_specials().
A pet is trying to follow its owner.
ob | pet trying to follow. Will be remove_ob()'d if can't follow. |
owner | owner of ob. |
Definition at line 306 of file pets.c.
References obj::arch, archt::clone, draw_ext_info(), find_free_spot(), FLAG_REMOVED, freearr_x, freearr_y, get_map_from_coord(), mapdef::in_memory, insert_ob_in_map(), llevError, llevMonster, LOG(), obj::map, MAP_IN_MEMORY, obj::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, obj::name, NDI_UNIQUE, OUT_OF_REAL_MAP, PLAYER, QUERY_FLAG, remove_ob(), SIZEOFFREE, obj::type, obj::x, and obj::y.
Referenced by move_monster(), pet_move(), and remove_all_pets().
int forbid_play | ( | void | ) |
Checks if server should be started.
Definition at line 1296 of file server.c.
References close_and_delete(), Settings::confdir, days, llevDebug, LOG(), logfile, MAX_BUF, open_and_uncompress(), PERM_FILE, settings, and snprintf().
Referenced by init_startup().
Forms the party struct for a party called 'params'. it is the responsibility of the caller to ensure that the name is unique. New item is placed on the party list.
op | party creator. |
params | party name. |
Definition at line 65 of file c_party.c.
References obj::contr, draw_ext_info_format(), firstparty, party_struct::kills, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, party_struct::next, pl::party, party_struct::partyleader, party_struct::partyname, party_struct::passwd, replace_unprintable_chars(), send_party_message(), snprintf(), strdup_local(), and party_struct::total_exp.
Referenced by check_login(), command_party(), and START_TEST().
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 536 of file time.c.
References FLAG_NO_DROP, FLAG_REMOVED, free_object2(), QUERY_FLAG, and remove_ob().
Referenced by fix_stopped_arrow(), hit_with_arrow(), and stop_item().
void free_server | ( | void | ) |
Frees all memory allocated around here:
Definition at line 955 of file init.c.
References free_materials(), and free_races().
Referenced by cleanup().
Find out if this is friendly fire (PVP and attacker is peaceful) or not
op | victim. |
hitter | attacker. |
Definition at line 1818 of file attack.c.
References obj::contr, DISEASE, get_owner(), obj::head, pl::peaceful, PLAYER, POISONING, RUNE, SPELL, and obj::type.
Referenced by hit_player().
Checks 'params' for object code.
Can be:
At function exit, params points to first non-object char
'from', if not NULL, contains at exit:
Ryo, august 2004
pl | wizard. |
params | object specified. |
from |
Definition at line 2450 of file c_wiz.c.
References obj::count, dm_stack_peek(), dm_stack_push(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, STACK_FROM_NONE, STACK_FROM_NUMBER, STACK_FROM_STACK, STACK_FROM_TOP, pl::stack_items, and pl::stack_position.
Referenced by command_diff(), command_dump(), command_free(), command_insert_into(), command_patch(), command_remove(), and command_stack_push().
partylist* get_firstparty | ( | void | ) |
Simple wrapper to get firstparty.
Definition at line 48 of file c_party.c.
References firstparty.
Referenced by cfapi_party_get_property(), check_login(), and START_TEST().
void get_name | ( | object * | op | ) |
Waiting for the player's name.
op | player. |
Definition at line 786 of file player.c.
References obj::contr, send_query(), pl::socket, ST_GET_NAME, pl::state, and pl::write_buf.
Referenced by add_player(), receive_play_again(), receive_player_name(), receive_player_password(), and wrong_password().
Finds the nearest visible player for some object.
mon | what object is searching a player. |
Definition at line 447 of file player.c.
References can_detect_enemy(), rv_vector::distance, first_friendly_object, first_player, FLAG_FREED, FLAG_FRIENDLY, llevDebug, LOG(), pl::next, oblnk::next, pl::ob, oblnk::ob, QUERY_FLAG, and remove_friendly_object().
Referenced by find_enemy(), and move_monster().
Ask the player for the password of the party she wants to join.
op | player. |
party | party op wishes to join. |
Definition at line 891 of file player.c.
References obj::contr, CS_QUERY_HIDEINPUT, llevError, LOG(), obj::name, pl::party_to_join, send_query(), pl::socket, ST_GET_PARTY_PASSWORD, pl::state, and pl::write_buf.
Referenced by command_party().
void get_password | ( | object * | op | ) |
Waiting for the player's password.
op | player. |
Definition at line 798 of file player.c.
References obj::contr, CS_QUERY_HIDEINPUT, send_query(), pl::socket, ST_GET_PASSWORD, pl::state, and pl::write_buf.
Referenced by receive_player_name().
Descends containers looking for unpaid items, and pays for them.
pl | player buying the stuff. |
op | object we are examining. If op has and inventory, we examine that. IF there are objects below op, we descend down. |
0 | player still has unpaid items. |
1 | player has paid for everything. |
Definition at line 992 of file shop.c.
References obj::below, CLEAR_FLAG, cost_string_from_value(), draw_ext_info_format(), esrv_update_item(), F_BUY, F_SHOP, FLAG_PLAYER_SOLD, FLAG_UNPAID, obj::inv, MAX_BUF, merge_ob(), MSG_TYPE_SHOP, MSG_TYPE_SHOP_PAYMENT, NDI_UNIQUE, pay_for_item(), PLAYER, query_cost(), query_cost_string(), QUERY_FLAG, query_money(), query_name(), SET_FLAG, stringbuffer_finish(), obj::type, UPD_FLAGS, and UPD_NAME.
Referenced by shop_mat_type_move_on().
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 67 of file pets.c.
References obj::above, obj::attack_movement, obj::attacked_by, obj::attacked_by_count, can_detect_enemy(), can_see_enemy(), check_enemy(), CLEAR_FLAG, obj::contr, obj::count, obj::enemy, find_nearest_living_creature(), FLAG_ALIVE, FLAG_CONFUSED, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), get_rangevector(), get_search_arr(), obj::head, obj::map, on_same_map(), P_IS_ALIVE, P_OUT_OF_MAP, pet_defend, pet_normal, pet_sad, pl::petmode, PETMOVE, PLAYER, QUERY_FLAG, remove_friendly_object(), should_arena_attack(), SIZEOFFREE, obj::type, obj::x, and obj::y.
Referenced by find_enemy().
void get_who_escape_code_value | ( | char * | return_val, |
int | size, | ||
const char | letter, | ||
player * | pl | ||
) |
Returns the value of the escape code used in the who format specifier.
Specifier values are:
[out] | return_val | buffer that will contain the information. |
size | length of return_val. | |
letter | format specifier. | |
pl | player to get information for. |
Definition at line 709 of file c_misc.c.
References obj::count, FLAG_AFK, FLAG_WIZ, get_name_of_region_for_map(), get_region_by_map(), get_region_longname(), socket_struct::host, socket_struct::is_bot, obj::level, obj::map, obj::name, mapdef::name, pl::ob, pl::own_title, mapdef::path, pl::peaceful, QUERY_FLAG, snprintf(), pl::socket, and pl::title.
Referenced by display_who_entry().
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 688 of file player.c.
References AP_NOPRINT, obj::below, CLEAR_FLAG, create_treasure(), liv::exp, FLAG_APPLIED, FLAG_CAN_USE_SKILL, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_INV_LOCKED, FLAG_NEUTRAL, FLAG_STARTEQUIP, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FORCE, free_object(), GT_ONLY_GOOD, GT_STARTEQUIP, obj::inv, IS_ARMOR, IS_SHIELD, IS_WEAPON, obj::level, link_player_skills(), llevError, LOG(), manual_apply(), obj::name, need_identify(), obj::nrof, PLAYER, QUERY_FLAG, obj::randomitems, remove_ob(), SET_FLAG, SKILL, SPELL, SPELLBOOK, obj::stats, and obj::type.
Referenced by apply_changes_to_player(), and key_change_class().
void handle_apply_yield | ( | object * | tmp | ) |
This checks whether the object has a "on_use_yield" field, and if so generated and drops matching item.
tmp | item that was applied. |
Definition at line 131 of file apply.c.
References create_archetype(), drop(), obj::env, get_ob_key_value(), INS_BELOW_ORIGINATOR, insert_ob_in_map(), insert_ob_in_ob(), obj::map, obj::x, and obj::y.
Referenced by food_type_apply(), poison_type_apply(), and potion_type_apply().
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 2826 of file player.c.
References obj::contr, obj::count, obj::direction, draw_ext_info(), pl::fire_on, FLAG_MAKE_INVIS, FLAG_REMOVED, FLAG_SCARED, flee_player(), pl::golem_count, handle_client(), pl::hidden, obj::invisible, make_visible(), move_player(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_END, NDI_UNIQUE, pticks, QUERY_FLAG, range_golem, pl::ranges, pl::run_on, pl::socket, and obj::speed_left.
Referenced by process_players1().
Main hide handling.
op | living trying to hide. |
skill | hiding skill. |
Definition at line 498 of file skills.c.
References attempt_hide(), calc_skill_exp(), draw_ext_info(), FLAG_MAKE_INVIS, obj::hide, obj::invisible, obj::level, make_visible(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_END, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, obj::type, UP_OBJ_FACE, and update_object().
Referenced by do_hidden_move(), and do_skill().
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 3755 of file player.c.
References mapdef::darkness, freearr_x, freearr_y, get_map_flags(), has_carried_lights(), obj::map, P_BLOCKSVIEW, P_OUT_OF_MAP, obj::x, and obj::y.
Referenced by attempt_hide(), and do_hidden_move().
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 292 of file attack.c.
References obj::above, obj::arch, AT_CHAOS, AT_COUNTERSPELL, AT_MAGIC, obj::below, obj::count, counterspell(), liv::dam, obj::env, FLAG_ALIVE, FLAG_FREED, FLAG_REMOVED, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, hit_player(), obj::inv, llevError, LOG(), obj::map, obj::material, obj::materialname, obj::move_block, obj::name, archt::name, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, save_throw_object(), shuffle_attack(), obj::stats, TRANSPORT, obj::type, UP_OBJ_FACE, update_object(), was_destroyed, obj::x, and obj::y.
Referenced by explode_bullet(), explosion(), move_aura(), move_ball_spell(), move_bolt(), move_cone(), move_missile(), and rune_attack().
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 1868 of file attack.c.
References abort_attack(), add_friendly_object(), obj::arch, arch_to_object(), AT_CHAOS, AT_DEATH, AT_DRAIN, AT_HOLYWORD, AT_MAGIC, AT_PARALYZE, AT_PHYSICAL, AT_SLOW, ATNR_MAGIC, attack_message(), obj::attack_movement, ATTACKS, Chaos_Attacks::attacktype, obj::below, CLEAR_FLAG, obj::count, determine_god(), did_make_save(), DOOR, obj::enemy, find_first_free_spot(), find_god(), FLAG_ALIVE, FLAG_FREED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_NO_DAMAGE, FLAG_ONE_HIT, FLAG_RUN_AWAY, FLAG_SPLITTING, FLAG_TEAR_DOWN, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, FLAG_WIZ, free_object(), freearr_x, freearr_y, friendly_fire(), get_attack_mode(), get_owner(), GRIMREAPER, obj::head, hit_with_one_attacktype(), liv::hp, insert_ob_in_map(), obj::inv, kill_object(), obj::level, llevDebug, llevError, LOG(), obj::map, liv::maxhp, archt::more, obj::name, archt::name, npc_call_help(), NROFATTACKS, NROFNEWOBJS, obj::other_arch, obj::owner, PETMOVE, PLAYER, QUERY_FLAG, obj::race, remove_friendly_object(), remove_ob(), obj::resist, rndm(), obj::run_away, RUNE, scare_creature(), SET_FLAG, Settings::set_friendly_fire, set_owner(), settings, obj::slaying, spring_trap(), obj::stats, tear_down_wall(), obj::title, TRAP, obj::type, undead_name, obj::value, was_destroyed, obj::x, and obj::y.
Referenced by attack_ob_simple(), cast_destruction(), cast_earth_to_dust(), cast_light(), check_bullet(), check_doors(), check_earthwalls(), eat_special_food(), enter_exit(), gate_type_process(), hit_map(), legacy_ob_process(), move_symptom(), player_attack_door(), poison_type_apply(), poisoning_type_process(), rune_attack(), spell_effect_type_move_on(), spell_failure(), and START_TEST().
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 975 of file attack.c.
References add_refcount(), attack_ob_simple(), obj::below, obj::count, liv::dam, obj::env, EVENT_ATTACK, EVENT_CONNECTOR, execute_event(), fix_stopped_arrow(), free_no_drop(), free_object(), free_string(), INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::map, merge_ob(), remove_ob(), SCRIPT_FIX_ALL, obj::skill, obj::speed, obj::stats, stick_arrow(), obj::type, was_destroyed, liv::wc, obj::x, and obj::y.
Referenced by common_process_projectile(), and common_projectile_move_on().
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 336 of file disease.c.
References add_refcount(), obj::below, copy_object(), DISEASE, draw_ext_info(), obj::env, FLAG_MONSTER, liv::food, free_string(), get_object(), get_owner(), obj::head, insert_ob_in_ob(), obj::inv, is_susceptible_to_disease(), obj::last_grace, obj::level, obj::map, liv::maxgrace, liv::maxhp, obj::move_block, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, NDI_RED, NDI_UNIQUE, op_on_battleground(), obj::owner, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), set_owner(), SIGN, obj::skill, snprintf(), obj::stats, obj::title, obj::type, obj::value, and liv::wc.
Referenced by cast_cause_disease(), check_infection(), check_physically_infect(), and rune_attack().
void init | ( | int | argc, |
char ** | argv | ||
) |
This is the main server initialisation function.
Called only once, when starting the program.
Definition at line 905 of file init.c.
References become_daemon(), cftimer_init(), Settings::daemonmode, Settings::dm_mail, FULL_VERSION, init_beforeplay(), init_commands(), init_done, init_library(), init_ob_methods(), init_server(), init_signals(), init_skills(), init_startup(), load_materials(), load_settings(), logfile, metaserver2_init(), metaserver_init(), parse_args(), read_map_log(), reset_sleep(), and settings.
Referenced by main(), and server_main().
void init_commands | ( | void | ) |
Sorts the command arrays for easy search through bsearch().
Definition at line 293 of file commands.c.
References CommandsSize, and compare_A().
Referenced by init().
void init_ob_methods | ( | void | ) |
Initializes the ob_method system. This means initializing legacy_type, base_type, and also calling init_ob_types() from ob_types.c
Definition at line 49 of file ob_methods.c.
References ob_methods::apply, ob_methods::describe, init_ob_method_struct(), init_ob_types(), legacy_ob_apply(), legacy_ob_describe(), legacy_ob_process(), ob_methods::move_on, ob_methods::process, and register_all_ob_types().
Referenced by init().
void init_skills | ( | void | ) |
This just sets up the skill_names table above. The index into the array is set up by the subtypes.
Definition at line 71 of file skill_util.c.
References add_refcount(), add_string(), archt::clone, first_archetype, llevError, LOG(), archt::next, NUM_SKILLS, SKILL, obj::skill, skill_names, obj::subtype, and obj::type.
Referenced by init().
int initPlugins | ( | void | ) |
Definition at line 4588 of file plugins.c.
References closedir(), dirent::d_name, LIBDIR, llevInfo, LOG(), MAX_BUF, opendir(), PLUGIN_SUFFIX, plugins_init_plugin(), readdir(), and snprintf().
Referenced by server_main().
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 1653 of file c_object.c.
References obj::below, CONTAINER, obj::count, draw_ext_info(), draw_ext_info_format(), FLAG_APPLIED, FLAG_WIZ, obj::inv, obj::invisible, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_INVENTORY, NDI_UNIQUE, QUERY_FLAG, query_name(), query_weight(), and obj::type.
Referenced by command_inventory(), and look_at().
int is_in_shop | ( | object * | ob | ) |
Check if an object is in a shop.
ob | object to check for. |
Definition at line 1414 of file shop.c.
References coords_in_shop(), obj::map, obj::x, and obj::y.
Referenced by convert_item(), drop_object(), examine(), kill_player(), shop_mat_type_move_on(), and transport_type_apply().
int is_true_undead | ( | object * | op | ) |
Is the object a true undead?
op | object to test. |
Definition at line 3731 of file player.c.
References obj::arch, obj::below, archt::clone, EXPERIENCE, FLAG_UNDEAD, obj::inv, PLAYER, QUERY_FLAG, obj::stats, obj::type, and liv::Wis.
Referenced by can_see_enemy(), and makes_invisible_to().
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 651 of file skills.c.
References attempt_jump(), obj::carrying, liv::Dex, draw_ext_info(), obj::level, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, obj::stats, and liv::Str.
Referenced by do_skill().
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 1156 of file player.c.
References add_statbonus(), add_string(), allowed_class(), obj::arch, pl::bed_x, pl::bed_y, obj::carrying, CLEAR_FLAG, archt::clone, obj::contr, copy_object(), create_treasure(), CS_QUERY_SINGLECHAR, draw_ext_info(), enter_exit(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, execute_global_event(), EXIT_PATH, EXIT_X, EXIT_Y, find_treasurelist(), first_map_ext_path, fix_object(), FLAG_WIZ, free_object(), free_string(), get_object(), get_player_archetype(), give_initial_items(), liv::grace, socket_struct::host, liv::hp, insert_ob_in_map(), link_player_skills(), llevDebug, Settings::localdir, LOG(), make_path_to_file(), obj::map, MAX_BUF, liv::maxhp, liv::maxsp, obj::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, obj::name, archt::name, obj::name_pl, NDI_BLUE, pl::orig_stats, play_again(), Settings::playerdir, pticks, obj::randomitems, remove_ob(), remove_statbonus(), pl::savebed_map, send_query(), SET_ANIMATION, settings, snprintf(), pl::socket, liv::sp, ST_PLAYING, start_info(), pl::state, obj::stats, pl::title, UP_OBJ_FACE, UPD_FACE, update_object(), obj::weight, obj::x, and obj::y.
Referenced by reply_cmd().
void key_confirm_quit | ( | object * | op, |
char | key | ||
) |
We receive the reply to the 'quit confirmation' message.
op | player. |
key | reply. |
Definition at line 1278 of file player.c.
References check_score(), obj::contr, delete_character(), delete_map(), obj::direction, draw_ext_info(), draw_ext_info_format(), EVENT_REMOVE, execute_global_event(), first_map, FLAG_WAS_WIZ, pl::killer, Settings::localdir, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, mapdef::next, pl::own_title, pl::party, mapdef::path, play_again(), Settings::playerdir, QUERY_FLAG, remove_ob(), Settings::set_title, settings, snprintf(), ST_PLAYING, pl::state, terminate_all_pets(), 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 1079 of file player.c.
References add_statbonus(), CHA, CON, obj::contr, CS_QUERY_SINGLECHAR, DEX, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, INT, llevError, LOG(), obj::map, obj::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_BLUE, NDI_UNIQUE, play_again(), POW, roll_stats(), send_query(), SET_ANIMATION, SET_FLAG, short_stat_name, pl::socket, ST_CHANGE_CLASS, pl::state, STR, pl::Swap_First, swap_stat(), and WIS.
Referenced by reply_cmd().
void kill_player | ( | object * | op | ) |
When a player should die (lack of hp, food, etc), we call this.
If the player can not be saved (permadeath, no lifesave), this will take care of removing the player file.
Will remove diseases, apply death penalties, and so on.
Takes battleground into account.
op | player in jeopardy. |
Definition at line 3238 of file player.c.
References obj::above, add_string(), apply_death_exp_penalty(), arch_to_object(), obj::attacktype, Settings::balanced_stat_loss, BALSL_LOSS_CHANCE_RATIO, BALSL_MAX_LOSS_RATIO, BALSL_NUMBER_LOSSES_RATIO, pl::braced, change_attr_value(), check_score(), check_stat_bounds(), obj::contr, create_archetype(), cure_disease(), dead_player(), delete_character(), determine_god(), obj::direction, draw_ext_info(), draw_ext_info_format(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_player_savebed(), EVENT_DEATH, EVENT_PLAYER_DEATH, execute_event(), execute_global_event(), liv::exp, pl::explore, find_archetype(), fix_object(), FLAG_APPLIED, FLAG_UNIQUE, FLAG_WAS_WIZ, FLESH, liv::food, FORCE_NAME, FREE_AND_COPY, free_object(), free_string(), get_attr_value(), GET_MAP_OB, pl::golem_count, liv::grace, gravestone_text(), liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::inv, is_in_shop(), pl::killer, obj::level, loot_object(), lose_msg, obj::map, pl::maplevel, obj::material, obj::materialname, MAX, MAX_BUF, liv::maxgrace, liv::maxhp, liv::maxsp, obj::msg, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_ATTRIBUTE_GOD, MSG_TYPE_ATTRIBUTE_STAT_LOSS, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_DIED, obj::name, obj::name_pl, NDI_ALL, NDI_NAVY, NDI_UNIQUE, Settings::not_permadeth, NROFATTACKS, op_on_battleground(), pl::orig_stats, pl::own_title, pl::party, play_again(), play_sound_player_only(), PREFER_LOW, present_arch_in_ob(), QUERY_FLAG, random_roll(), range_golem, pl::ranges, remove_friendly_object(), remove_ob(), remove_unpaid_objects(), obj::resist, Settings::resurrection, save_life(), save_player(), SCRIPT_FIX_ALL, SET_FLAG, Settings::set_title, settings, snprintf(), SOUND_TYPE_LIVING, liv::sp, obj::speed, obj::speed_left, SPELL_EFFECT, Settings::stat_loss_on_death, obj::stats, pl::title, transfer_ob(), TRUE, obj::type, obj::value, obj::x, and obj::y.
Referenced by check_login(), deep_swamp_type_process(), and kill_object().
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 690 of file skill_util.c.
References obj::below, FLAG_CAN_USE_SKILL, give_skill_by_name(), liv::Int, obj::inv, learn_spell, obj::level, link_player_skills(), llevError, LOG(), obj::name, PREFER_LOW, QUERY_FLAG, random_roll(), SET_FLAG, SKILL, obj::skill, obj::stats, strncasecmp(), and obj::type.
Referenced by skillscroll_type_apply().
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 1234 of file server.c.
References check_score(), obj::contr, DEAD_OBJECT, draw_ext_info_format(), FLAG_WIZ, pl::hidden, socket_struct::host, mapdef::in_memory, obj::inv, llevInfo, LOG(), obj::map, MAP_IN_MEMORY, MAP_TIMEOUT, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_PLAYER, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, Ns_Dead, pl::ob, mapdef::players, QUERY_FLAG, query_name(), pl::socket, ST_CONFIRM_PASSWORD, ST_GET_NAME, ST_GET_PASSWORD, pl::state, socket_struct::status, mapdef::timeout, pl::transport, and obj::type.
Referenced by attack_ob_simple(), check_login(), do_server(), receive_play_again(), and shop_mat_type_move_on().
void legacy_animate_trigger | ( | object * | op | ) |
Definition at line 772 of file time.c.
References animate_trigger().
Referenced by legacy_ob_process().
Definition at line 1872 of file apply.c.
References apply_container().
Referenced by container_type_move_on(), and legacy_ob_apply().
void legacy_move_hole | ( | object * | op | ) |
Definition at line 776 of file time.c.
References move_hole().
Referenced by legacy_ob_process().
void legacy_remove_force | ( | object * | op | ) |
Definition at line 768 of file time.c.
References 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 282 of file c_range.c.
References obj::chosen_skill, obj::contr, obj::count, pl::golem_count, range_bow, range_golem, range_magic, range_misc, range_none, range_skill, and pl::ranges.
Referenced by change_spell(), and check_login().
void link_player_skills | ( | object * | op | ) |
This function goes through the player inventory and sets up the last_skills[] array in the player object. The last_skills[] is used to more quickly lookup skills - mostly used for sending exp.
op | player to link skills for. Must be a player. |
Definition at line 112 of file skill_util.c.
References obj::below, obj::contr, obj::inv, pl::last_skill_exp, pl::last_skill_ob, llevError, LOG(), NUM_SKILLS, SKILL, obj::skill, obj::subtype, and obj::type.
Referenced by adjust_skill_tool(), become_follower(), check_login(), food_type_apply(), give_initial_items(), key_change_class(), and learn_skill().
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.c.
References display_who_entry(), draw_ext_info(), draw_ext_info_format(), find_player(), first_player, FLAG_AFK, FLAG_WIZ, get_language(), get_region_by_map(), pl::hidden, I18N_MSG_CMISC_052, I18N_MSG_CMISC_053, I18N_MSG_CMISC_054, I18N_MSG_CMISC_055, i18n_translate(), socket_struct::is_bot, chars_names::login_order, regiondef::longname, obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, obj::name, regiondef::name, name_cmp(), NDI_UNIQUE, pl::next, pl::ob, pl::party, party_struct::partyname, QUERY_FLAG, region_is_child_of_region(), settings, pl::socket, ST_GET_PARTY_PASSWORD, ST_PLAYING, pl::state, Settings::who_format, and Settings::who_wiz_format.
Referenced by command_party(), and command_who().
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 430 of file spell_util.c.
References obj::below, obj::inv, llevError, LOG(), 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 1391 of file spell_effect.c.
References arch_to_object(), obj::attacktype, caster_level(), archt::clone, copy_object(), liv::dam, draw_ext_info(), draw_ext_info_format(), obj::duration, obj::facing, find_archetype(), FLAG_ALIVE, FLAG_BLOCKSVIEW, FLAG_IS_USED_UP, FLAG_TEAR_DOWN, liv::food, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_object(), liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::level, llevError, LOG(), obj::map, MAX_BUF, liv::maxhp, obj::move_block, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, obj::name, NDI_UNIQUE, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::race, obj::range, SET_FLAG, set_owner(), set_spell_skill(), snprintf(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SPELL, SPELL_EFFECT, obj::stats, obj::type, update_all_los(), obj::x, and obj::y.
Referenced by cast_spell().
void make_visible | ( | object * | op | ) |
Makes an object visible again.
op | what to make visible. |
Definition at line 3712 of file player.c.
References obj::contr, FREE_AND_CLEAR_STR, obj::hide, pl::invis_race, obj::invisible, PLAYER, pl::tmp_invis, obj::type, UP_OBJ_FACE, and update_object().
Referenced by attack_ob_simple(), attempt_steal(), can_detect_enemy(), can_see_enemy(), do_hidden_move(), fire(), handle_newcs_player(), hide(), move_player_attack(), and player_attack_door().
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 774 of file spell_effect.c.
References obj::contr, FLAG_UNDEAD, pl::invis_race, obj::invisible, is_true_undead(), PLAYER, QUERY_FLAG, obj::race, and obj::type.
Referenced by can_see_enemy(), and cast_invisible().
void malloc_info | ( | object * | op | ) |
Sends various memory-related statistics.
op | player requesting the information. |
Definition at line 244 of file c_misc.c.
References animations, count_active(), count_free(), count_used(), draw_ext_info_format(), first_archetype, first_artifactlist, first_map, first_player, first_treasurelist, get_language(), I18N_MSG_CMISC_014, I18N_MSG_CMISC_015, I18N_MSG_CMISC_016, I18N_MSG_CMISC_017, I18N_MSG_CMISC_018, I18N_MSG_CMISC_019, I18N_MSG_CMISC_020, I18N_MSG_CMISC_021, I18N_MSG_CMISC_022, I18N_MSG_CMISC_023, I18N_MSG_CMISC_024, I18N_MSG_CMISC_025, I18N_MSG_CMISC_026, I18N_MSG_CMISC_027, I18N_MSG_CMISC_028, I18N_MSG_CMISC_029, I18N_MSG_CMISC_030, I18N_MSG_CMISC_031, I18N_MSG_CMISC_032, I18N_MSG_CMISC_033, I18N_MSG_CMISC_034, I18N_MSG_CMISC_035, I18N_MSG_CMISC_036, I18N_MSG_CMISC_037, I18N_MSG_CMISC_038, I18N_MSG_CMISC_039, I18N_MSG_CMISC_040, I18N_MSG_CMISC_041, I18N_MSG_CMISC_042, I18N_MSG_CMISC_043, I18N_MSG_CMISC_044, i18n_translate(), mapdef::in_memory, MAP_HEIGHT, MAP_IN_MEMORY, MAP_WIDTH, archt::more, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MALLOC, NDI_UNIQUE, artifactliststruct::next, treasureliststruct::next, pl::next, archt::next, mapdef::next, nrofallowedstr, nrofartifacts, nroftreasures, and num_animations.
Referenced by command_malloc().
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 512 of file apply.c.
References check_race_restrictions(), obj::contr, draw_ext_info(), EVENT_APPLY, execute_event(), FLAG_APPLIED, FLAG_UNPAID, obj::head, METHOD_OK, METHOD_SILENT_ERROR, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, ob_apply(), play_sound_player_only(), PLAYER, QUERY_FLAG, SCRIPT_FIX_ALL, SOUND_TYPE_ITEM, and obj::type.
Referenced by cfapi_object_apply(), give_initial_items(), monster_apply_below(), monster_check_apply(), player_apply(), polymorph_living(), transmute_item_to_flower(), and write_scroll().
void map_info | ( | object * | op, |
char * | search | ||
) |
This is the 'maps' command.
op | player requesting the information. |
search | optional substring to search for. |
Definition at line 55 of file c_misc.c.
References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FALSE, first_map, get_language(), I18N_MSG_CMISC_000, I18N_MSG_CMISC_001, I18N_MSG_CMISC_002, I18N_MSG_CMISC_003, I18N_MSG_CMISC_004, i18n_translate(), mapdef::in_memory, MAP_WHEN_RESET, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapdef::next, mapdef::path, mapdef::players, players_on_map(), seconds(), and mapdef::timeout.
Referenced by command_maps().
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 1390 of file skills.c.
References ARMOUR, obj::below, BOOTS, draw_ext_info(), FLAG_APPLIED, FLAG_READY_WEAPON, GLOVES, HELMET, liv::hp, obj::inv, obj::last_heal, obj::last_sp, obj::level, liv::maxhp, liv::maxsp, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, NDI_UNIQUE, PLAYER, QUERY_FLAG, SHIELD, liv::sp, obj::stats, and obj::type.
Referenced by do_skill().
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 207 of file spell_util.c.
References obj::level, MAX, obj::path_attuned, obj::path_denied, and obj::path_repelled.
Referenced by cast_spell(), SP_level_dam_adjust(), SP_level_duration_adjust(), and SP_level_range_adjust().
Definition at line 219 of file standalone.c.
References AP_APPLY, AP_IGNORE_CURSE, obj::arch, ARROW, obj::below, BOW, CAN_APPLY_NOT_MASK, can_apply_object(), check_good_armour(), check_good_weapon(), archt::clone, obj::count, FLAG_APPLIED, FLAG_CAST_SPELL, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SCROLL, FLAG_READY_SKILL, FLAG_USE_BOW, FLAG_USE_SCROLL, FOOD, HORN, obj::inv, IS_ARMOR, IS_SHIELD, llevDebug, llevMonster, LOG(), manual_apply(), monster_should_cast_spell(), QUERY_FLAG, obj::race, RING, ROD, SCROLL, SET_FLAG, SKILL, SPELLBOOK, TREASURE, obj::type, WAND, WEAPON, obj::will_apply, WILL_APPLY_FOOD, and WILL_APPLY_TREASURE.
Referenced by monster_check_pickup(), polymorph_living(), and put_treasure().
This covers the various spells that change the moods of monsters - makes them angry, peacful, friendly, etc.
op | who is casting. |
caster | what object is casting. |
spell | spell object to cast. |
Definition at line 1014 of file spell_attack.c.
References obj::above, add_friendly_object(), arch_to_object(), obj::attack_movement, obj::attacktype, caster_level(), CLEAR_FLAG, determine_god(), did_make_save(), obj::enemy, liv::exp, find_god(), FLAG_BERSERK, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_ATTACK, FLAG_SLEEP, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, get_map_flags(), GET_MAP_OB, obj::head, insert_ob_in_map(), obj::level, obj::map, MIN, NROFATTACKS, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, PREFER_LOW, QUERY_FLAG, obj::race, random_roll(), obj::range, remove_friendly_object(), obj::resist, SET_FLAG, set_owner(), set_spell_skill(), share_exp(), SK_EXP_ADD_SKILL, obj::skill, obj::slaying, SP_level_range_adjust(), obj::stats, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
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 192 of file disease.c.
References check_infection(), do_symptoms(), obj::env, FLAG_WIZ, liv::food, free_object(), grant_immunity(), is_susceptible_to_disease(), liv::maxhp, QUERY_FLAG, remove_ob(), remove_symptoms(), obj::stats, and obj::value.
Referenced by legacy_ob_process().
void move_firewall | ( | object * | op | ) |
Move for FIREWALL.
firewalls fire other spells. The direction of the wall is stored in op->stats.sp. walls can have hp, so they can be torn down.
op | firewall. |
Definition at line 188 of file standalone.c.
References cast_spell(), obj::inv, llevError, LOG(), obj::map, obj::name, mapdef::name, rndm(), liv::sp, obj::stats, obj::x, and obj::y.
Referenced by legacy_ob_process(), and trigger_connected().
void 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 541 of file pets.c.
References obj::above, attack_ob(), obj::contr, obj::count, obj::direction, draw_ext_info(), draw_ext_info_format(), FLAG_ALIVE, FLAG_MONSTER, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), pl::golem_count, obj::head, liv::hp, llevDebug, LOG(), obj::map, obj::more, move_ob(), obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, obj::name, NDI_UNIQUE, obj::owner, P_OUT_OF_MAP, QUERY_FLAG, obj::race, range_golem, pl::ranges, remove_friendly_object(), remove_ob(), obj::stats, UP_OBJ_FACE, update_object(), was_destroyed, obj::x, and obj::y.
Referenced by legacy_ob_process().
int move_monster | ( | 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 566 of file monster.c.
References absdir(), add_refcount(), ALLRUN, animate_object(), obj::animation_id, obj::attack_movement, obj::attacked_by, obj::attacked_by_count, can_hit(), check_wakeup(), compute_path(), obj::count, mapdef::darkness, obj::direction, rv_vector::direction, dist_att(), DISTATT, DISTHIT, disthit_att(), do_hidden_move(), obj::enemy, FABS, obj::face, obj::facing, find_enemy(), FLAG_BLIND, FLAG_CAST_SPELL, FLAG_CONFUSED, FLAG_FREED, FLAG_FRIENDLY, FLAG_NO_ATTACK, FLAG_ONLY_ATTACK, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SCROLL, FLAG_READY_SKILL, FLAG_REMOVED, FLAG_RUN_AWAY, FLAG_SCARED, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_SLEEP, FLAG_STAND_STILL, follow_owner(), free_object(), free_string(), get_nearest_player(), get_owner(), get_rangevector(), obj::head, HI4, obj::hide, HITRUN, hitrun_att(), llevDebug, LO4, LOG(), obj::map, MIN_ACTIVE_SPEED, monster_apply_below(), monster_cast_spell(), monster_check_pickup(), monster_do_living(), monster_move_no_enemy(), monster_use_bow(), monster_use_range(), monster_use_scroll(), monster_use_skill(), obj::more, move_object(), move_randomly(), obj::name, on_same_map(), rv_vector::part, PETMOVE, obj::pick_up, QUERY_FLAG, obj::race, remove_friendly_object(), remove_ob(), run_att(), RUNATT, RUSH, skill_attack(), obj::speed, obj::stats, WAIT2, wait_att(), wait_att2(), WAITATT, liv::wc, and obj::will_apply.
Referenced by process_object().
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 72 of file move.c.
References obj::below, blocked_link(), check_doors(), check_earthwalls(), obj::contr, obj::direction, pl::do_los, esrv_map_scroll(), FLAG_REMOVED, FLAG_WIZPASS, freearr_x, freearr_y, get_map_flags(), get_map_from_coord(), obj::head, insert_ob_in_map(), obj::inv, llevDebug, llevError, LOG(), socket_struct::look_position, obj::map, obj::more, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, remove_ob(), pl::socket, TRANSPORT, obj::type, socket_struct::update_look, obj::will_apply, WILL_APPLY_DOOR, WILL_APPLY_EARTHWALL, obj::x, and obj::y.
Referenced by cfapi_object_move(), flee_player(), move_golem(), move_object(), move_player_attack(), move_to(), pet_move(), and recursive_roll().
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 53 of file move.c.
References move_ob().
Referenced by check_spell_knockback(), circ1_move(), circ2_move(), move_monster(), move_player_mover(), move_randomly(), pace2_moveh(), pace2_movev(), pace_moveh(), pace_movev(), push_ob(), and rand_move().
int move_player | ( | object * | op, |
int | dir | ||
) |
Player gave us a direction, check whether to move or fire.
op | player. |
dir | direction to move/fire. |
Definition at line 2741 of file player.c.
References absdir(), animate_object(), check_pick(), obj::contr, obj::direction, do_hidden_move(), obj::facing, fire(), pl::fire_on, FLAG_CONFUSED, obj::hide, mapdef::in_memory, llevError, LOG(), obj::map, MAP_IN_MEMORY, move_player_attack(), QUERY_FLAG, pl::run_on, obj::speed_left, obj::state, pl::transport, and turn_transport().
Referenced by cfapi_object_move(), command_fire(), command_run(), handle_newcs_player(), move_internal(), move_player_mover(), and pray_at_altar().
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 2419 of file player.c.
References obj::above, action_makes_visible(), pl::braced, obj::contr, DOOR, draw_ext_info(), obj::enemy, FLAG_ALIVE, FLAG_CAN_ROLL, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_map_from_coord(), GET_MAP_OB, get_owner(), pl::has_hit, obj::head, obj::hide, liv::hp, LOCKED_DOOR, liv::luck, make_visible(), obj::map, mon, move_ob(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_NOATTACK, op_on_battleground(), out_of_map(), OUT_OF_REAL_MAP, pl::party, pl::peaceful, play_sound_map(), PLAYER, player_attack_door(), push_ob(), QUERY_FLAG, recursive_roll(), skill_attack(), SOUND_TYPE_LIVING, obj::speed, obj::speed_left, obj::stats, pl::tmp_invis, pl::transport, obj::type, pl::weapon_sp, obj::x, and obj::y.
Referenced by move_player().
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 639 of file time.c.
References obj::above, obj::attacktype, obj::contr, FABS, pl::fire_on, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, liv::hp, obj::level, llevError, LOG(), obj::map, liv::maxsp, move_object(), move_player(), obj::move_type, P_OUT_OF_MAP, mapdef::path, PLAYER, PLAYERMOVER, QUERY_FLAG, remove_ob(), rndm(), should_director_abort(), liv::sp, obj::speed, obj::speed_left, obj::stats, obj::type, obj::x, and obj::y.
Referenced by legacy_ob_process().
void move_symptom | ( | object * | symptom | ) |
Make the symptom do the nasty things it does.
symptom | symptom to move. |
Definition at line 615 of file disease.c.
References arch_to_object(), obj::attacktype, obj::count, liv::dam, draw_ext_info(), obj::env, FLAG_FREED, FREE_AND_COPY, free_object(), obj::head, hit_player(), insert_ob_in_map(), llevError, LOG(), obj::map, MAX, MAX_BUF, liv::maxhp, liv::maxsp, obj::more, obj::msg, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, obj::name_pl, NDI_RED, NDI_UNIQUE, obj::other_arch, QUERY_FLAG, remove_ob(), snprintf(), liv::sp, obj::stats, was_destroyed, obj::x, and obj::y.
Referenced by legacy_ob_process().
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 626 of file move.c.
References compute_path(), GET_MAP_FLAGS, GET_MAP_OB, obj::map, move_ob(), P_OUT_OF_MAP, obj::x, and obj::y.
Referenced by cfapi_object_transfer().
void npc_call_help | ( | object * | op | ) |
Definition at line 1632 of file monster.c.
References obj::above, obj::enemy, FLAG_ALIVE, FLAG_UNAGGRESSIVE, get_map_flags(), GET_MAP_OB, obj::map, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::x, and obj::y.
Referenced by alchemy_failure_effect(), attack_ob_simple(), attempt_steal(), and hit_player().
void 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 1933 of file monster.c.
References ext_info_map(), HUGE_BUF, obj::map, MAX_BUF, MSG_TYPE_DIALOG, MSG_TYPE_DIALOG_NPC, NDI_NAVY, NDI_UNIQUE, query_name(), and snprintf().
Referenced by cfapi_object_say(), and do_talk_npc().
void obsolete_parties | ( | void | ) |
Remove unused parties (no players), this could be made to scale a lot better.
Definition at line 165 of file c_party.c.
References first_player, party_struct::next, pl::next, pl::party, and remove_party().
Referenced by do_specials(), and START_TEST().
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 555 of file spell_util.c.
References obj::above, ARROW, AT_COUNTERSPELL, AT_MAGIC, obj::attacktype, BOW, FLAG_MONSTER, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, GOLEM, liv::maxhp, OB_SPELL_TAG_MATCH, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, Statistics::spell_suppressions, SPELL_TAG_SIZE, obj::spell_tags, statistics, obj::stats, obj::subtype, obj::type, and WEAPON.
Referenced by explosion(), and move_cone().
int onoff_value | ( | const char * | line | ) |
Utility function to convert a reply to a yes/no or on/off value.
line | string to check. |
1 | line is one of on y k s d. |
0 | other value. |
Definition at line 2026 of file c_misc.c.
Referenced by command_brace(), command_wizcast(), and command_wizpass().
Checks if the given object op (usually a player) is standing on a valid battleground-tile.
Function returns TRUE/FALSE. If true x, y returns the battleground -exit-coord. (and if x, y not NULL)
19 March 2005 - josh@ modifed to check if the battleground also has slaying, maxhp, and maxsp set and if those are all set and the player has a marker that matches the slaying send them to a different x, y Default is to do the same as before, so only people wanting to have different points need worry about this woos world .net
28 July 2008 - Modified to allow other archetypes than fingers as trophies. If other_arch is specified in the battleground floor, then that archetype will be used instead of the default ("finger"). -R.Q.
op | object to check. | |
[out] | x | |
[out] | y | if not null and if on battleground (return 1), will contain the exit coordinates for the battleground. |
[out] | trophy | if not null and if on battleground (return 1), will contain a pointer to the archetype that can be collected by the winner |
Definition at line 4002 of file player.c.
References BATTLEGROUND, obj::below, EXIT_ALT_X, EXIT_ALT_Y, EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FLAG_IS_FLOOR, FLAG_NO_PICK, FORCE, obj::inv, obj::name, obj::other_arch, QUERY_FLAG, obj::slaying, and obj::type.
Referenced by hit_with_one_attacktype(), infect_object(), kill_object(), kill_player(), move_player_attack(), should_arena_attack(), and spell_find_dir().
Paralyze a living thing.
op | victim. |
hitter | who is attacking. |
dam | damage to deal. |
Definition at line 2324 of file attack.c.
References ATNR_PARALYZE, FABS, obj::resist, obj::speed, and obj::speed_left.
Referenced by hit_with_one_attacktype(), prayer_failure(), scroll_failure(), and spell_failure().
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 556 of file player.c.
References absdir(), blocked_link(), DETOUR_AMOUNT, rv_vector::direction, rv_vector::distance, rv_vector::distance_x, rv_vector::distance_y, FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_rangevector(), get_rangevector_from_mapcoord(), obj::map, MAX, MAX_SPACES, MOVE_ALL, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, obj::x, and obj::y.
Referenced by monster_cast_spell(), monster_use_range(), monster_use_scroll(), and monster_use_skill().
int pay_for_amount | ( | uint64 | to_pay, |
object * | pl | ||
) |
Takes the amount of money from the the player inventory and from it's various pouches using the pay_from_container() function.
to_pay | amount to pay. |
pl | player paying. |
Definition at line 613 of file shop.c.
References obj::below, CONTAINER, fix_object(), FLAG_APPLIED, obj::inv, llevError, LOG(), pay_from_container(), QUERY_FLAG, query_money(), obj::race, and obj::type.
Referenced by cfapi_object_pay_amount().
DAMN: This is now a wrapper for pay_from_container, which is called for the player, then for each active container that can hold money until op is paid for. Change will be left wherever the last of the price was paid from.
op | object to buy. |
pl | player buying. |
Definition at line 652 of file shop.c.
References obj::below, change_exp(), CONTAINER, F_BUY, F_NO_BARGAIN, F_SHOP, FALSE, fix_object(), FLAG_APPLIED, FLAG_WAS_WIZ, obj::inv, llevError, LOG(), pay_from_container(), query_cost(), QUERY_FLAG, query_money(), obj::race, Settings::real_wiz, SET_FLAG, settings, SK_EXP_NONE, and obj::type.
Referenced by cfapi_object_pay_item(), and get_payment().
int perceive_self | ( | object * | op | ) |
Living thing wants to know information.
op | who wants information. |
Definition at line 1031 of file spell_effect.c.
References obj::arch, ARCH_DEPLETION, obj::below, change_resist_msg, describe_item(), determine_god(), draw_ext_info(), draw_ext_info_format(), liv::exp, find_archetype(), find_god(), FORCE, get_attr_value(), obj::glow_radius, obj::inv, is_dragon_pl(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PERCEIVE_SELF, obj::name, archt::name, NDI_UNIQUE, NUM_STATS, present_arch_in_ob(), snprintf(), statname, obj::stats, obj::type, and VERY_BIG_BUF.
Referenced by cast_spell().
void pet_move | ( | object * | ob | ) |
Handles a pet's movement.
ob | pet to move. |
Definition at line 348 of file pets.c.
References obj::above, absdir(), obj::contr, obj::count, obj::direction, draw_ext_info(), obj::enemy, find_dir_2(), FLAG_ALIVE, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, follow_owner(), free_object(), freearr_x, freearr_y, get_map_flags(), get_map_from_coord(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, get_owner(), obj::head, llevMonster, LOG(), obj::map, obj::more, move_ob(), MSG_SUBTYPE_NONE, MSG_TYPE_MISC, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, on_same_map(), obj::owner, P_OUT_OF_MAP, pet_sad, pl::petmode, PLAYER, QUERY_FLAG, remove_friendly_object(), remove_ob(), rndm(), obj::type, was_destroyed, obj::x, and obj::y.
Referenced by monster_move_no_enemy().
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 400 of file skills.c.
References obj::above, attempt_pick_lock(), calc_skill_exp(), DOOR, draw_ext_info(), obj::facing, freearr_x, freearr_y, GET_MAP_OB, LOCKED_DOOR, obj::map, obj::move_block, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, out_of_map(), obj::type, obj::x, and obj::y.
Referenced by do_skill().
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 462 of file c_object.c.
References obj::below, can_pick(), obj::container, CONTAINER, obj::contr, obj::count, pl::count, draw_ext_info(), draw_ext_info_format(), obj::env, FLAG_APPLIED, FLAG_STARTEQUIP, INS_NO_MERGE, insert_ob_in_map(), obj::inv, llevDebug, LOG(), obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, obj::nrof, pick_up_object(), PLAYER, QUERY_FLAG, obj::race, sack_can_hold(), stop_item(), and obj::type.
Referenced by attempt_steal(), cast_create_missile(), cfapi_object_pickup(), check_pick(), command_take(), and esrv_move_object().
void play_again | ( | object * | op | ) |
Ask the player whether to play again or disconnect.
op | player. |
Definition at line 810 of file player.c.
References obj::chosen_skill, obj::contr, CS_QUERY_SINGLECHAR, FLAG_REMOVED, obj::map, QUERY_FLAG, remove_ob(), send_query(), pl::socket, ST_PLAY_AGAIN, and pl::state.
Referenced by apply_savebed(), command_shutdown(), key_change_class(), key_confirm_quit(), key_roll_stat(), kill_player(), and receive_play_again().
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 player_apply_below(). There can still be "but you are floating high above the ground" messages. |
Definition at line 557 of file apply.c.
References obj::anim_suffix, apply_anim_suffix(), obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), obj::env, FLAG_WAS_WIZ, FLAG_WIZ, free_object(), pl::last_used, pl::last_used_id, manual_apply(), MAX_BUF, METHOD_ERROR, METHOD_OK, METHOD_SILENT_ERROR, METHOD_UNHANDLED, MOVE_FLYING, obj::move_type, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, play_sound_map(), PLAYER, QUERY_FLAG, query_name(), remove_ob(), SOUND_TYPE_ITEM, and obj::type.
Referenced by apply_cmd(), command_apply(), and player_apply_below().
void player_apply_below | ( | object * | pl | ) |
Attempt to apply the object 'below' the player. If the player has an open container, we use that for below, otherwise we use the ground.
pl | player. |
Definition at line 619 of file apply.c.
References obj::below, obj::container, obj::contr, FLAG_IS_FLOOR, obj::inv, obj::invisible, METHOD_OK, obj::move_on, obj::move_type, ob_apply(), player_apply(), QUERY_FLAG, TRANSPORT, pl::transport, and obj::type.
Referenced by cfapi_object_apply_below(), and command_apply().
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 3906 of file player.c.
References obj::arch, pl::blocked_los, archt::clone, obj::contr, rv_vector::distance_x, rv_vector::distance_y, FABS, get_rangevector(), obj::head, llevError, LOG(), socket_struct::mapx, socket_struct::mapy, obj::more, PLAYER, pl::socket, obj::type, obj::x, and obj::y.
Referenced by can_see_enemy().
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 4221 of file player.c.
References range_none, range_size, pl::ranges, and pl::shoottype.
Referenced by become_follower(), check_special_prayers(), and do_forget_spell().
int playername_ok | ( | const char * | cp | ) |
Is the player name valid.
cp | name to test. |
Definition at line 230 of file player.c.
Referenced by check_name().
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 287 of file swap.c.
References first_player, FLAG_REMOVED, pl::hidden, obj::map, pl::next, pl::ob, and QUERY_FLAG.
Referenced by flush_old_maps(), and map_info().
void plugins_display_list | ( | object * | op | ) |
Definition at line 622 of file plugins.c.
References draw_ext_info(), draw_ext_info_format(), _crossfire_plugin::fullname, _crossfire_plugin::id, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, and _crossfire_plugin::next.
Referenced by command_listplugins().
crossfire_plugin* plugins_find_plugin | ( | const char * | id | ) |
Definition at line 604 of file plugins.c.
References _crossfire_plugin::id, and _crossfire_plugin::next.
Referenced by cfapi_system_register_global_event(), cfapi_system_unregister_global_event(), and execute_event().
int plugins_init_plugin | ( | const char * | libfile | ) |
Definition at line 455 of file plugins.c.
References cfapi_get_hooks(), _crossfire_plugin::closefunc, _crossfire_plugin::eventfunc, _crossfire_plugin::fullname, _crossfire_plugin::gevent, _crossfire_plugin::id, _crossfire_plugin::libptr, LIBPTRTYPE, llevError, LOG(), _crossfire_plugin::next, NR_EVENTS, plugin_number, plugins_dlclose, plugins_dlerror, plugins_dlopen, plugins_dlsym, _crossfire_plugin::prev, and _crossfire_plugin::propfunc.
Referenced by command_loadplugin(), and initPlugins().
int plugins_remove_plugin | ( | const char * | id | ) |
Definition at line 566 of file plugins.c.
References _crossfire_plugin::closefunc, _crossfire_plugin::id, _crossfire_plugin::libptr, _crossfire_plugin::next, plugin_number, plugins_dlclose, and _crossfire_plugin::prev.
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 399 of file spell_effect.c.
References obj::arch, FABS, FLAG_ALIVE, FLAG_ANIMATE, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_PICK, obj::move_block, PLAYER, polymorph_item(), polymorph_living(), polymorph_melt(), QUERY_FLAG, rndm(), obj::speed, TREASURE, and obj::type.
Referenced by cast_polymorph().
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 1341 of file skills.c.
References obj::below, draw_ext_info(), liv::grace, HOLY_ALTAR, obj::last_grace, MAX_BUF, liv::maxgrace, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, obj::name, NDI_BLACK, obj::other_arch, PLAYER, pray_at_altar(), snprintf(), obj::stats, and obj::type.
Referenced by do_skill().
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 325 of file gods.c.
References absdir(), become_follower(), cast_magic_storm(), change_exp(), archt::clone, create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), EVENT_APPLY, execute_event(), liv::exp, obj::facing, find_god(), god_intervention(), liv::grace, obj::level, LOOSE_MANA, liv::luck, MAX, liv::maxgrace, move_player(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, obj::name, archt::name, NDI_NAVY, NDI_UNIQUE, obj::other_arch, PREFER_LOW, random_roll(), random_roll64(), SCRIPT_FIX_ALL, SK_SUBTRACT_SKILL_EXP, obj::skill, obj::stats, and liv::Wis.
Referenced by pray().
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. |
0 | nothing probed. |
1 | something was probed. |
Definition at line 715 of file spell_effect.c.
References obj::above, draw_ext_info(), examine_monster(), FLAG_ALIVE, FLAG_MONSTER, FLAG_WIZCAST, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::type, obj::x, and obj::y.
Referenced by cast_spell().
void process_events | ( | void | ) |
Process all active objects.
Definition at line 1026 of file server.c.
References obj::active_next, active_objects, obj::active_prev, obj::anim_speed, animate_object(), obj::arch, obj::casting_time, Settings::casting_time, obj::count, obj::direction, dump_object(), obj::env, FABS, obj::facing, FLAG_FREED, FLAG_REMOVED, free_object(), mapdef::in_memory, obj::last_anim, llevError, LOG(), MAP, obj::map, MAP_IN_MEMORY, MONSTER, obj::name, archt::name, mapdef::path, PLAYER, process_object(), process_players1(), process_players2(), QUERY_FLAG, settings, obj::speed, obj::speed_left, obj::state, stringbuffer_finish(), stringbuffer_new(), obj::temp_anim_speed, obj::temp_animation_id, TRUE, obj::type, update_ob_speed(), and was_destroyed.
Referenced by server_main(), and START_TEST().
int process_object | ( | object * | op | ) |
Main object move function.
op | object to move. |
Definition at line 724 of file time.c.
References obj::anim_speed, animate_object(), change_object(), obj::direction, EVENT_TIME, execute_event(), obj::facing, FLAG_ANIMATE, FLAG_APPLIED, FLAG_CHANGING, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_IS_A_TEMPLATE, FLAG_IS_USED_UP, FLAG_MONSTER, FLAG_SEE_ANYWHERE, liv::food, free_object(), generate_monster(), make_sure_not_seen(), make_sure_seen(), METHOD_OK, move_monster(), ob_process(), PLAYER, QUERY_FLAG, remove_force(), remove_ob(), SCRIPT_FIX_NOTHING, obj::state, obj::stats, obj::temp_anim_speed, obj::temp_animation_id, and obj::type.
Referenced by attack_ob_simple(), and process_events().
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 492 of file move.c.
References CLEAR_FLAG, obj::contr, draw_ext_info_format(), obj::enemy, esrv_map_scroll(), FLAG_FRIENDLY, FLAG_NEUTRAL, FLAG_SLEEP, FLAG_STAND_STILL, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_owner(), obj::head, insert_ob_in_map(), obj::level, socket_struct::look_position, obj::map, obj::more, move_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_PUSHED, obj::name, NDI_UNIQUE, pl::party, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), remove_ob(), pl::run_on, pl::socket, obj::stats, liv::Str, obj::type, socket_struct::update_look, obj::x, and obj::y.
Referenced by move_player_attack().
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 700 of file c_object.c.
References AP_NO_MERGE, AP_UNAPPLY, apply_special(), obj::below, CLEAR_FLAG, obj::container, CONTAINER, obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), obj::env, esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_STARTEQUIP, get_split_ob(), insert_ob_in_map_at(), insert_ob_in_ob(), obj::inv, obj::map, MAX_BUF, obj::move_off, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, obj::nrof, PLAYER, QUERY_FLAG, query_name(), remove_ob(), sack_can_hold(), set_object_face_main(), obj::slaying, pl::socket, TRANSPORT, transport_can_hold(), obj::type, UPD_WEIGHT, socket_struct::update_look, obj::x, and obj::y.
Referenced by drop(), esrv_move_object(), and START_TEST().
Return the price of an item for a character.
Price will vary based on the shop's specialization ration, the player's approval rate, ...
Added F_TRUE flag to define.h to mean that the price should not be adjusted by players charisma. With F_TRUE, it returns the amount that the item is worth, if it was sold, but unadjusted by charisma. This is needed for alchemy, to to determine what value of gold nuggets should be given (the gold nuggets, when sold, will have the adjustment by charisma done at that time). NULL could have been passed as the who parameter, but then the adjustment for expensive items (>10000) would not be done.
Added F_APPROX flag, which means that the price returned should be wrong by an amount related to the player's bargaining skill.
Added F_SHOP flag to mean that the specialisation of the shop on the player's current map should be taken into account when determining the price. Shops that specialise in what is being traded will give better prices than those that do not.
CF 0.91.4 - This function got changed around a bit. Now the number of object is multiplied by the value early on. This fixes problems with items worth very little. What happened before is that various divisions took place, the value got rounded to 0 (Being an int), and thus remained 0.
Mark Wedel (mwede) l@py ramid .com
tmp | object we're querying the price of. |
who | who is inquiring. Can be NULL, only meaningful if player. |
flag | combination of F_xxx flags. |
Definition at line 121 of file shop.c.
References obj::arch, liv::Cha, cha_bonus, archt::clone, obj::count, F_APPROX, F_BUY, F_IDENTIFIED, F_NO_BARGAIN, F_NOT_CURSED, F_SELL, F_SHOP, F_TRUE, find_skill_by_number(), FLAG_BEEN_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_PLAYER_SOLD, liv::food, GEM, get_ob_key_value(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, obj::level, llevDebug, llevError, LOG(), obj::magic, obj::map, Settings::max_level, MIN, MONEY, obj::name, need_identify(), obj::nrof, mapdef::path, PLAYER, POTION, QUERY_FLAG, settings, shop_greed(), shop_specialisation_ratio(), shopkeeper_approval(), SK_BARGAINING, obj::stats, obj::type, obj::value, value_limit(), and WAND.
Referenced by alchemy(), alchemy_object(), attempt_do_alchemy(), cfapi_object_query_cost(), check_pick(), count_unpaid(), get_payment(), pay_for_item(), query_cost_string(), and sell_item().
StringBuffer* query_cost_string | ( | const object * | tmp, |
object * | who, | ||
int | flag, | ||
StringBuffer * | buf | ||
) |
Finds the price of an item.
Price will be either an approximate value or the real value.
tmp | object to get the price of. |
who | who is getting the price. |
flag | combination of F_xxx values. |
buf | buffer to append to. If NULL, a newly allocated one will be used and returned. |
Definition at line 511 of file shop.c.
References archt::clone, cost_string_from_value(), F_APPROX, find_next_coin(), find_skill_by_number(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, LARGEST_COIN_GIVEN, MONEY, obj::name, obj::name_pl, query_cost(), real_money_value(), SK_BARGAINING, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_new(), obj::type, and obj::value.
Referenced by examine(), get_payment(), pick_up_object(), and sell_item().
uint64 query_money | ( | const object * | op | ) |
Finds out how much money the player is carrying, including what is in containers.
op | item to get money for. Must be a player or a container. |
Definition at line 581 of file shop.c.
References obj::below, CONTAINER, FLAG_APPLIED, obj::inv, llevError, LOG(), MONEY, obj::nrof, PLAYER, QUERY_FLAG, obj::race, obj::type, and obj::value.
Referenced by can_pay(), cfapi_object_query_money(), get_payment(), pay_for_amount(), and pay_for_item().
void read_map_log | ( | void | ) |
Reads temporary maps information from disk.
Will LOG() in case of error.
Definition at line 83 of file swap.c.
References mapdef::darkness, mapdef::difficulty, get_linked_map(), mapdef::in_memory, llevDebug, Settings::localdir, LOG(), MAP_MAXRESET, MAP_SWAPPED, MAX_BUF, mapdef::path, mapdef::reset_time, seconds(), settings, snprintf(), strdup_local(), mapdef::timeout, and mapdef::tmpname.
Referenced by init().
void receive_party_password | ( | object * | op | ) |
Player entered a party password.
op | player. |
Definition at line 248 of file c_party.c.
References confirm_party_password(), obj::contr, draw_ext_info(), draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, pl::party, pl::party_to_join, party_struct::partyname, send_party_message(), snprintf(), ST_PLAYING, and pl::state.
Referenced by reply_cmd().
void receive_play_again | ( | object * | op, |
char | key | ||
) |
Player replied to play again / disconnect.
op | player. |
key | received choice. |
Definition at line 839 of file player.c.
References add_friendly_object(), add_refcount(), add_string(), obj::contr, draw_ext_info(), FREE_AND_CLEAR_STR, free_object(), get_name(), get_player(), leave(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, obj::name, obj::name_pl, NDI_UNIQUE, pl::ob, pl::password, play_again(), remove_friendly_object(), and set_first_map().
Referenced by reply_cmd().
void receive_player_name | ( | object * | op | ) |
A player just entered her name.
Perhaps these should be in player.c, but that file is already a bit big.
op | player we're getting the name of. |
Definition at line 2142 of file c_misc.c.
References check_name(), obj::contr, draw_ext_info(), FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, obj::name, pl::name_changed, obj::name_pl, NDI_UNIQUE, and pl::write_buf.
Referenced by reply_cmd().
void receive_player_password | ( | object * | op | ) |
A player just entered her password, including for changing it.
op | player. |
Definition at line 2160 of file c_misc.c.
References check_login(), check_password(), checkbanned(), obj::contr, crypt_string(), CS_QUERY_HIDEINPUT, display_motd(), draw_ext_info(), get_language(), get_name(), socket_struct::host, I18N_MSG_CMISC_188, I18N_MSG_CMISC_189, I18N_MSG_CMISC_190, I18N_MSG_CMISC_191, I18N_MSG_CMISC_192, I18N_MSG_CMISC_193, I18N_MSG_CMISC_194, I18N_MSG_CMISC_195, I18N_MSG_CMISC_196, i18n_translate(), llevInfo, LOG(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, obj::name, NDI_RED, NDI_UNIQUE, pl::new_password, pl::password, roll_again(), send_query(), pl::socket, ST_CHANGE_PASSWORD_CONFIRM, ST_CHANGE_PASSWORD_NEW, ST_CHANGE_PASSWORD_OLD, ST_CONFIRM_PASSWORD, ST_PLAYING, ST_ROLL_STAT, pl::state, and pl::write_buf.
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 90 of file spell_effect.c.
References obj::arch, archt::clone, create_archetype(), liv::dam, draw_ext_info(), draw_ext_info_format(), find_marked_object(), FLAG_ANIMATE, liv::food, free_object(), liv::hp, insert_ob_in_map(), obj::inv, obj::level, obj::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, play_sound_map(), PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), remove_ob(), SET_FLAG, SOUND_TYPE_ITEM, SP_level_dam_adjust(), obj::speed, obj::stats, obj::type, update_ob_speed(), WAND, obj::x, and obj::y.
Referenced by cast_spell().
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 340 of file move.c.
References draw_ext_info_format(), MAX_BUF, move_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_BLACK, NDI_UNIQUE, query_name(), and roll_ob().
Referenced by move_player_attack().
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 490 of file spell_util.c.
References obj::above, FLAG_ALIVE, FLAG_REFL_SPELL, GET_MAP_OB, obj::level, OUT_OF_REAL_MAP, QUERY_FLAG, and rndm().
Referenced by move_bolt(), and move_bullet().
void regenerate_rod | ( | object * | rod | ) |
Regenerates a rod's charges.
rod | rod to regenerate. |
Definition at line 728 of file spell_util.c.
References liv::hp, liv::maxhp, and obj::stats.
Referenced by legacy_ob_process().
void register_all_ob_types | ( | void | ) |
Calls the intialization functions for all individual types.
Definition at line 45 of file ob_types.c.
References init_type_altar(), init_type_armour_improver(), init_type_arrow(), init_type_blindness(), init_type_book(), init_type_button(), init_type_cf_handle(), init_type_check_inv(), init_type_clock(), init_type_container(), init_type_converter(), init_type_creator(), init_type_deep_swamp(), init_type_detector(), init_type_director(), init_type_duplicator(), init_type_exit(), init_type_food(), init_type_gate(), init_type_hole(), init_type_identify_altar(), init_type_lamp(), init_type_lighter(), init_type_marker(), init_type_mood_floor(), init_type_peacemaker(), init_type_pedestal(), init_type_player_changer(), init_type_player_mover(), init_type_poison(), init_type_poisoning(), init_type_potion(), init_type_power_crystal(), init_type_rune(), init_type_savebed(), init_type_scroll(), init_type_shop_inventory(), init_type_shop_mat(), init_type_sign(), init_type_skillscroll(), init_type_spell_effect(), init_type_spellbook(), init_type_spinner(), init_type_teleporter(), init_type_thrown_object(), init_type_transport(), init_type_trap(), init_type_trapdoor(), init_type_treasure(), init_type_trigger(), init_type_trigger_altar(), init_type_trigger_button(), init_type_trigger_pedestal(), and init_type_weapon_improver().
Referenced by init_ob_methods().
void remove_all_pets | ( | void | ) |
This function checks all pets so they try to follow their master around the world.
Unfortunately, sometimes, the owner of a pet is in the process of entering a new map when this is called. Thus the map isn't loaded yet, and we have to remove the pet...
Definition at line 273 of file pets.c.
References FABS, first_friendly_object, FLAG_FRIENDLY, FLAG_REMOVED, follow_owner(), free_object(), get_owner(), llevMonster, LOG(), MIN_ACTIVE_SPEED, oblnk::next, oblnk::ob, on_same_map(), PLAYER, QUERY_FLAG, remove_friendly_object(), obj::speed, and obj::type.
Referenced by enter_map(), and swap_map().
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 2317 of file spell_effect.c.
References obj::below, caster_level(), CLEAR_FLAG, draw_ext_info(), esrv_update_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, obj::inv, obj::level, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, obj::type, UPD_FLAGS, and obj::value.
Referenced by cast_spell().
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 51 of file time.c.
References arch_to_object(), DOOR, free_object(), freearr_x, freearr_y, insert_ob_in_map(), obj::level, obj::map, obj::other_arch, present(), remove_ob(), obj::speed, obj::speed_left, update_ob_speed(), obj::x, and obj::y.
Referenced by attempt_pick_lock(), and legacy_ob_process().
void remove_locked_door | ( | object * | op | ) |
Same as remove_door() but for locked doors.
op | door to remove. |
Definition at line 80 of file time.c.
References arch_to_object(), free_object(), freearr_x, freearr_y, insert_ob_in_map(), obj::level, LOCKED_DOOR, obj::map, obj::other_arch, present(), remove_ob(), obj::slaying, obj::speed, obj::speed_left, update_ob_speed(), obj::x, and obj::y.
Referenced by legacy_ob_process(), and player_attack_door().
void remove_party | ( | partylist * | target_party | ) |
Remove and free party.
target_party | party to remove. |
Definition at line 106 of file c_party.c.
References first_player, llevError, LOG(), party_struct::next, pl::next, pl::party, party_struct::partyleader, and party_struct::partyname.
Referenced by command_party(), obsolete_parties(), and START_TEST().
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 1272 of file skills.c.
References obj::above, obj::below, calc_skill_exp(), liv::Cha, liv::exp, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::inv, obj::level, obj::map, obj::owner, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, obj::stats, TRAP, trap_disarm(), trap_show(), obj::type, obj::x, and obj::y.
Referenced by do_skill().
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 2943 of file player.c.
References obj::below, FLAG_UNPAID, free_object(), insert_ob_in_map(), obj::inv, obj::map, QUERY_FLAG, remove_ob(), obj::x, and obj::y.
Referenced by check_login(), and kill_player().
void roll_again | ( | object * | op | ) |
Ask the player what to do with the statistics.
op | player. |
Definition at line 1006 of file player.c.
References obj::contr, CS_QUERY_SINGLECHAR, esrv_new_player(), send_query(), and pl::socket.
Referenced by receive_player_password().
int roll_stat | ( | void | ) |
This rolls four 1-6 rolls and sums the best 3 of the 4.
Definition at line 908 of file player.c.
Referenced by roll_stats().
void roll_stats | ( | object * | op | ) |
Roll the initial player's statistics.
op | player to roll for. |
Definition at line 932 of file player.c.
References liv::ac, liv::Cha, liv::Con, obj::contr, liv::Dex, liv::exp, fix_object(), liv::grace, liv::hp, liv::Int, obj::level, pl::levgrace, pl::levhp, pl::levsp, liv::maxgrace, liv::maxhp, liv::maxsp, pl::orig_stats, liv::Pow, roll_stat(), liv::sp, obj::stats, liv::Str, and liv::Wis.
Referenced by get_player(), and key_roll_stat().
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 282 of file c_object.c.
References obj::carrying, CONTAINER, draw_ext_info_format(), FLAG_APPLIED, liv::food, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, query_name(), obj::race, obj::slaying, SPECIAL_KEY, obj::stats, liv::Str, obj::type, obj::weight, and obj::weight_limit.
Referenced by esrv_move_object(), pick_up(), and put_object_in_sack().
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 223 of file login.c.
References pl::bed_x, pl::bed_y, pl::bowtype, liv::Cha, CLEAR_FLAG, liv::Con, obj::container, obj::contr, copy_file(), destroy_object(), liv::Dex, pl::digestion, draw_ext_info(), draw_ext_info_format(), Settings::emergency_mapname, esrv_send_inventory(), liv::exp, pl::explore, FLAG_NO_FIX_PLAYER, FLAG_WIZ, pl::gen_grace, pl::gen_hp, pl::gen_sp, liv::Int, obj::inv, key_inventory, keyrings, pl::language, pl::last_level, obj::level, pl::levgrace, pl::levhp, pl::levsp, pl::listening, llevDebug, Settings::localdir, LOG(), make_path_to_file(), obj::map, MAX_BUF, MIN, pl::mode, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, obj::name, pl::name_changed, NDI_ALL_DMS, NDI_RED, NDI_UNIQUE, pl::no_shout, pl::orig_stats, pl::outputs_count, pl::outputs_sync, pl::own_title, pl::party, party_struct::partyname, party_struct::passwd, pl::password, mapdef::path, pl::peaceful, pl::petmode, PLAYER, Settings::playerdir, liv::Pow, QUERY_FLAG, range_none, pl::rejoin_party, SAVE_ERROR_OK, SAVE_FLAG_NO_REMOVE, SAVE_FLAG_SAVE_UNPAID, SAVE_MODE, save_object(), pl::savebed_map, SET_FLAG, Settings::set_title, settings, pl::shoottype, snprintf(), ST_GET_PARTY_PASSWORD, ST_PLAYING, pl::state, obj::stats, liv::Str, tempnam_secure(), terminate_all_pets(), Settings::tmpdir, TRUE, obj::type, pl::unapply, unapply_never, unapply_nochoice, unlink, pl::usekeys, pl::weapon_sp, liv::Wis, obj::x, and obj::y.
Referenced by apply_savebed(), check_login(), command_kick(), command_save(), command_shutdown(), do_server(), drop_object(), emergency_save(), enter_exit(), kill_player(), player_changer_type_process(), and process_players1().
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 171 of file attack.c.
References arch_to_object(), AT_CANCELLATION, AT_COLD, AT_ELECTRICITY, AT_FIRE, ATNR_COLD, obj::below, cancellation(), create_archetype(), decrease_ob_nr(), did_make_save_item(), obj::env, find_archetype(), fix_stopped_item(), FLAG_IS_LIGHTABLE, FLAG_NO_PICK, FLAG_REMOVED, free_object(), insert_ob_in_map(), insert_ob_in_ob(), obj::inv, obj::map, obj::move_slow, obj::move_slow_penalty, archt::name, obj::nrof, obj::other_arch, present_arch(), QUERY_FLAG, remove_ob(), replace_insert_ob_in_map(), obj::resist, rndm(), RUNE, spring_trap(), stop_item(), obj::type, obj::x, and obj::y.
Referenced by hit_map(), lighter_type_apply(), and spell_effect_type_move_on().
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 1708 of file apply.c.
References blind_living(), cast_magic_storm(), cast_wonder(), confuse_living(), create_archetype(), draw_ext_info(), free_object(), LOOSE_MANA, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, NDI_UNIQUE, paralyze_living(), PREFER_LOW, random_roll(), settings, liv::sp, Settings::spell_failure_effects, SPELL_WONDER, obj::stats, and TRUE.
Referenced by scroll_type_apply(), and spellbook_type_apply().
Player is selling an item. Give money, print appropriate messages.
This function uses the coins[] array to know what coins are available.
Modified to fill available race: gold containers before dumping remaining coins in character's inventory.
op | object to sell. |
pl | player. Shouldn't be NULL or non player. |
Definition at line 1059 of file shop.c.
References obj::below, obj::carrying, change_exp(), archt::clone, coins, CONTAINER, copy_object(), obj::custom_name, draw_ext_info_format(), esrv_update_item(), F_NO_BARGAIN, F_SELL, F_SHOP, find_archetype(), FLAG_APPLIED, FLAG_PLAYER_SOLD, FLAG_UNPAID, FREE_AND_CLEAR_STR, get_object(), identify(), insert_ob_in_ob(), obj::inv, LARGEST_COIN_GIVEN, llevDebug, llevError, LOG(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_SELL, NDI_UNIQUE, obj::nrof, PLAYER, query_cost(), query_cost_string(), QUERY_FLAG, query_name(), obj::race, SET_FLAG, SK_EXP_NONE, obj::stats, liv::Str, stringbuffer_finish(), obj::type, UPD_WEIGHT, obj::value, obj::weight, weight_limit, and obj::weight_limit.
Referenced by drop_object().
void send_news | ( | const object * | op | ) |
Send the news to a player.
op | player to send to. |
Definition at line 176 of file player.c.
References close_and_delete(), Settings::confdir, draw_ext_info_format(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, NDI_GREEN, NDI_UNIQUE, Settings::news, open_and_uncompress(), settings, snprintf(), and strip_endline().
Referenced by add_player(), and command_news().
void send_party_message | ( | object * | op, |
char * | msg | ||
) |
Send a message to all party members except the speaker.
op | player talking. |
msg | message to send. |
Definition at line 285 of file c_party.c.
References obj::contr, draw_ext_info(), first_player, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_WHITE, pl::next, pl::ob, and pl::party.
Referenced by check_login(), command_party(), form_party(), and receive_party_password().
void send_rules | ( | const object * | op | ) |
Send the rules to a player.
op | player to send rules to. |
Definition at line 142 of file player.c.
References close_and_delete(), Settings::confdir, draw_ext_info(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_RULES, NDI_GREEN, NDI_UNIQUE, open_and_uncompress(), Settings::rules, settings, and snprintf().
Referenced by add_player(), and command_rules().
int server_main | ( | int | argc, |
char ** | argv | ||
) |
Server main function.
argc | length of argv. |
argv | command-line options. |
Definition at line 1399 of file server.c.
References Settings::argc, Settings::argv, bRunning, cftimer_process_timers(), check_active_maps(), cleanup(), do_server(), do_specials(), emergency_save(), EVENT_CLOCK, execute_global_event(), init(), initPlugins(), nroferrors, process_events(), settings, and sleep_delta().
Referenced by main().
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 206 of file standalone.c.
References change_map_light(), mapdef::darkness, get_tod(), _timeofday::hour, HOURS_PER_DAY, mapdef::outdoor, _timeofday::season, and season_timechange.
Referenced by ready_map_name().
void set_map_timeout | ( | mapstruct * | oldmap | ) |
Applies the map timeout.
oldmap | map to process. |
Definition at line 77 of file standalone.c.
References MAP_MAXTIMEOUT, MAP_MINTIMEOUT, MAP_TIMEOUT, swap_map(), and mapdef::timeout.
Referenced by enter_map(), flush_old_maps(), and place_exits().
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 160 of file apply.c.
References obj::arch, archt::clone, obj::face, FALSE, find_face(), get_ob_key_value(), new_faces, new_face_struct::number, and TRUE.
Referenced by apply_container(), and put_object_in_sack().
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 105 of file spell_util.c.
References add_refcount(), FREE_AND_CLEAR_STR, and obj::skill.
Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_smite_spell(), create_aura(), create_bomb(), fire_arch_from_position(), fire_bolt(), fire_bullet(), fire_swarm(), magic_wall(), mood_change(), summon_golem(), summon_object(), and write_rune().
Returns a double based on how much the shopkeeper approves of the player. this is based on the race of the shopkeeper and that of the player.
map | shop to get ratio for. |
player | player to get ratio of. |
Definition at line 1243 of file shop.c.
References NEUTRAL_RATIO, obj::race, and mapdef::shoprace.
Referenced by describe_shop(), query_cost(), and shop_mat_type_move_on().
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 1146 of file pets.c.
References obj::contr, get_real_owner(), llevError, LOG(), op_on_battleground(), pl::party, pet_arena, pl::petmode, PLAYER, and obj::type.
Referenced by check_enemy(), and get_pet_enemy().
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 81 of file apply.c.
References obj::arch, obj::name, archt::name, obj::race, obj::slaying, and obj::subtype.
Referenced by director_type_move_on(), move_player_mover(), and player_mover_type_move_on().
void show_skills | ( | object * | op, |
const char * | search | ||
) |
Displays a player's skill list, and some other non skill related info (god, max weapon improvments, item power).
This shows the amount of exp they have in the skills.
Note this function is a bit more complicated because we we want ot sort the skills before printing them. If we just dumped this as we found it, this would be a bit simpler.
op | player wanting to examine skills. |
search | optional string to restrict skills to show. |
Definition at line 773 of file skill_util.c.
References obj::below, clipped_percent(), obj::contr, determine_god(), draw_ext_info(), draw_ext_info_format(), liv::exp, obj::expmul, obj::inv, pl::item_power, obj::level, level_exp(), MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_LIST, obj::name, NDI_RED, NDI_UNIQUE, NUM_SKILLS, obj::perm_exp, Settings::permanent_exp_ratio, settings, SKILL, snprintf(), obj::stats, and obj::type.
Referenced by command_skills().
void shuffle_attack | ( | object * | op, |
int | change_face | ||
) |
This routine shuffles the attack of op to one of the ones in the list. It does this at random. It also chooses a face appropriate to the attack that is being committed by that square at the moment.
right now it's being used by color spray and create pool of chaos.
This could really be a better implementation - the faces and attacktypes above are hardcoded, which is never good. The faces refer to faces in the animation sequence. Not sure how to do better - but not having it hardcoded would be nice.
I also fixed a bug here in that attacktype was |= - to me, that would be that it would quickly get all attacktypes, which probably wasn't the intent. MSW 2003-06-03
op | object to change. |
change_face | if set, also changes the face, else only changes the attacktype. |
Definition at line 1004 of file spell_util.c.
References AT_MAGIC, ATTACKS, Chaos_Attacks::attacktype, obj::attacktype, rndm(), and SET_ANIMATION.
Referenced by hit_map().
int similar_direction | ( | int | a, |
int | b | ||
) |
Is direction a similar to direction b? Find out in this exciting function below.
a | |
b | directions to compare. |
Definition at line 132 of file weather.c.
Referenced by player_fire_bow().
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 1123 of file skills.c.
References obj::above, calc_skill_exp(), liv::Cha, draw_ext_info_format(), FLAG_FRIENDLY, FLAG_HITBACK, FLAG_MONSTER, FLAG_NO_STEAL, FLAG_SPLITTING, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, liv::Int, obj::level, obj::map, MAX_BUF, MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, SIZEOFFREE, obj::stats, obj::type, obj::x, and obj::y.
Referenced by do_skill().
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 1126 of file skill_util.c.
References obj::above, obj::contr, do_skill_attack(), draw_ext_info(), obj::facing, FLAG_ALIVE, FLAG_CAN_ROLL, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, liv::hp, LOCKED_DOOR, obj::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, pl::party, PLAYER, QUERY_FLAG, obj::stats, obj::type, obj::x, and obj::y.
Referenced by attack_hth(), attack_melee_weapon(), attempt_jump(), move_monster(), and move_player_attack().
Main identification skill handling.
pl | player identifying. |
skill | identification skill. |
Definition at line 872 of file skills.c.
References AMULET, ARMOUR, ARROW, BOOK, BOOTS, BOW, BRACERS, CLOAK, CONTAINER, do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), draw_ext_info(), DRINK, FLESH, FOOD, GEM, GIRDLE, GLOVES, HELMET, HORN, INORGANIC, llevError, LOG(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, PLAYER, POISON, POTION, RING, ROD, SCROLL, SHIELD, SK_ALCHEMY, SK_BOWYER, SK_DET_CURSE, SK_DET_MAGIC, SK_JEWELER, SK_LITERACY, SK_SMITHERY, SK_THAUMATURGY, SK_WOODSMAN, SPELLBOOK, obj::subtype, obj::type, WAND, and WEAPON.
Referenced by do_skill().
Throwing skill handling.
op | object throwing. |
part | actual part of op throwing. |
dir | direction to throw into. |
params | optional message, used to find object to throw. |
skill | throwing skill. |
0 | skill use failed. |
1 | skill was successfully used. |
Definition at line 2181 of file skills.c.
References do_throw(), find_mon_throw_ob(), find_throw_ob(), PLAYER, and obj::type.
Referenced by do_skill().
Returns adjusted damage based on the caster.
caster | who is casting. |
spob | spell we are adjusting. |
Definition at line 332 of file spell_util.c.
References caster_level(), obj::dam_modifier, and min_casting_level().
Referenced by alchemy(), animate_weapon(), append_spell(), cast_cause_disease(), cast_change_ability(), cast_cone(), cast_create_missile(), cast_destruction(), cast_identify(), cast_light(), cast_smite_spell(), cast_transfer(), create_aura(), create_bomb(), esrv_update_spells(), fire_arch_from_position(), fire_bolt(), fire_bullet(), magic_wall(), recharge(), summon_golem(), and summon_object().
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 357 of file spell_util.c.
References caster_level(), obj::duration_modifier, and min_casting_level().
Referenced by alchemy(), animate_weapon(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_cone(), cast_create_food(), cast_create_missile(), cast_curse(), cast_destruction(), cast_invisible(), cast_light(), cast_word_of_recall(), create_aura(), create_bomb(), fire_arch_from_position(), fire_bolt(), fire_bullet(), fire_swarm(), magic_wall(), and summon_golem().
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 383 of file spell_util.c.
References caster_level(), min_casting_level(), and obj::range_modifier.
Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_light(), cast_polymorph(), cast_smite_spell(), create_bomb(), dimension_door(), fire_arch_from_position(), fire_bolt(), fire_bullet(), magic_wall(), mood_change(), probe(), and summon_golem().
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 281 of file spell_util.c.
References caster_level(), liv::grace, obj::level, llevError, LOG(), MAX, liv::maxgrace, liv::maxsp, PATH_SP_MULT, settings, liv::sp, SPELL_GRACE, SPELL_HIGHEST, SPELL_MANA, Settings::spellpoint_level_depend, obj::stats, and TRUE.
Referenced by append_spell(), cast_spell(), drain_rod_charge(), esrv_update_spells(), fire_misc_object(), monster_cast_spell(), show_matching_spells(), write_rune(), and write_scroll().
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 182 of file spell_util.c.
References arch_to_object(), insert_ob_in_map(), obj::other_arch, obj::x, and obj::y.
Referenced by cast_identify(), and cast_spell().
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 1078 of file spell_util.c.
References AT_INTERNAL, cast_cone(), confuse_living(), obj::count, create_archetype(), liv::dam, draw_ext_info(), FALSE, free_object(), get_map_flags(), hit_player(), insert_ob_in_map(), isqrt(), obj::level, LOOSE_MANA, obj::map, liv::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, P_NO_MAGIC, paralyze_living(), obj::range, settings, Settings::spell_failure_effects, SPELL_WONDER, obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
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 852 of file spell_util.c.
References obj::above, can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, freedir, get_map_flags(), GET_MAP_OB, obj::head, op_on_battleground(), P_BLOCKSVIEW, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, rndm(), SIZEOFFREE, and obj::type.
Referenced by move_ball_spell(), and move_missile().
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 227 of file rune.c.
References arch_to_object(), cast_spell(), archt::clone, obj::count, obj::direction, rv_vector::distance, draw_ext_info(), FLAG_ALIVE, FLAG_IS_LINKED, FLAG_IS_USED_UP, liv::food, free_object(), get_rangevector(), liv::hp, insert_ob_in_map(), obj::inv, obj::map, MAX, liv::maxhp, obj::msg, MSG_TYPE_APPLY, MSG_TYPE_APPLY_TRAP, NDI_UNIQUE, object_get_env_recursive(), obj::other_arch, PLAYER, QUERY_FLAG, remove_ob(), rune_attack(), SET_FLAG, SIGN, SPELL, obj::stats, trap_show(), obj::type, use_trigger(), was_destroyed, obj::x, and obj::y.
Referenced by attempt_pick_lock(), cfapi_object_spring_trap(), common_trap_type_move_on(), hit_player(), player_attack_door(), save_throw_object(), trap_disarm(), and treasure_type_apply().
int stand_in_light | ( | object * | op | ) |
Definition at line 2159 of file monster.c.
References get_map_flags(), GET_MAP_LIGHT, obj::glow_radius, isqrt(), obj::map, MAX_LIGHT_RADII, P_OUT_OF_MAP, obj::x, and obj::y.
Referenced by adj_attackroll(), can_see_enemy(), and check_wakeup().
int stand_near_hostile | ( | object * | who | ) |
Determine if who is standing near a hostile creature.
who | object to check. |
Definition at line 3837 of file player.c.
References obj::above, obj::contr, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, pl::hidden, obj::map, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::type, obj::x, and obj::y.
Referenced by attempt_hide().
void start_info | ( | object * | op | ) |
Gives basic start information to player.
op | player. |
Definition at line 97 of file server.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, obj::name, pl::name_changed, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, and VERSION.
Referenced by key_change_class().
Main stealing function.
op | thief. |
dir | direction to steal from. |
skill | stealing skill. |
Definition at line 290 of file skills.c.
References obj::above, obj::attack_movement, attempt_steal(), obj::below, calc_skill_exp(), obj::contr, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, get_owner(), obj::head, pl::hidden, obj::map, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, QUERY_FLAG, obj::type, obj::x, and obj::y.
Referenced by do_skill().
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 426 of file time.c.
References ARROW, fix_stopped_arrow(), free_no_drop(), free_object(), obj::inv, obj::map, MIN_ACTIVE_SPEED, remove_ob(), obj::speed, THROWN_OBJ, and obj::type.
Referenced by pick_up(), and save_throw_object().
void store_spell_expiry | ( | object * | spell | ) |
Stores in the spell when to warn player of expiration.
spell | spell we're considering. |
Definition at line 1829 of file spell_util.c.
References obj::duration, set_ob_key_value(), and snprintf().
Referenced by cast_change_ability(), and create_aura().
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 669 of file pets.c.
References add_friendly_object(), add_string(), AT_PHYSICAL, obj::attack_movement, obj::attacktype, caster_level(), archt::clone, obj::contr, obj::count, liv::dam, determine_god(), determine_holy_arch(), obj::direction, draw_ext_info(), draw_ext_info_format(), obj::duration, liv::exp, FABS, find_free_spot(), find_god(), fix_summon_pet(), FLAG_FRIENDLY, FLAG_MONSTER, FREE_AND_CLEAR_STR, free_object(), free_string(), freearr_x, freearr_y, get_owner(), GOLEM, pl::golem_count, liv::hp, insert_ob_in_map(), llevError, LOG(), obj::map, MAX, MAX_BUF, liv::maxgrace, MIN, obj::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_PET, obj::name, NDI_UNIQUE, ob_blocked(), obj::other_arch, PETMOVE, PLAYER, QUERY_FLAG, obj::race, range_golem, pl::ranges, remove_ob(), obj::resist, SET_FLAG, set_owner(), set_spell_skill(), pl::shoottype, SIZEOFFREE1, obj::slaying, snprintf(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::speed, obj::speed_left, obj::stats, obj::type, liv::wc, obj::x, and obj::y.
Referenced by cast_spell().
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 970 of file spell_util.c.
References put_a_monster().
Referenced by alchemy_failure_effect(), and cast_raise_dead_spell().
int 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 929 of file pets.c.
References absdir(), add_friendly_object(), obj::arch, arch_to_object(), obj::attack_movement, caster_level(), choose_cult_monster(), CLEAR_FLAG, archt::clone, create_treasure(), liv::dam, determine_god(), die_roll(), draw_ext_info(), draw_ext_info_format(), obj::enemy, find_free_spot(), find_god(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_SLEEP, freearr_x, freearr_y, freedir, get_map_from_coord(), get_owner(), GT_APPLY, GT_STARTEQUIP, insert_ob_in_map(), treasurestruct::item, treasureliststruct::items, obj::level, llevError, LOG(), obj::map, mark_inventory_as_no_drop(), MIN_ACTIVE_SPEED, mon, obj::more, archt::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, treasureliststruct::name, obj::name, archt::name, NDI_UNIQUE, treasurestruct::next, treasurestruct::nrof, ob_blocked(), obj::other_arch, PLAYER, PREFER_HIGH, QUERY_FLAG, obj::race, random_roll(), obj::randomitems, SET_FLAG, set_owner(), set_spell_skill(), SIZEOFFREE, SP_level_dam_adjust(), obj::stats, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
void swap_below_max | ( | const char * | except_level | ) |
Tries to swap out maps which are still in memory, because of MAP_TIMEOUT until used objects is below MAX_OBJECTS or there are no more maps to swap.
except_level | path of map to ignore for reset. Musn't be NULL. |
Definition at line 253 of file swap.c.
References llevDebug, LOG(), map_least_timeout(), MAX_OBJECTS, nrofallocobjects, nroffreeobjects, mapdef::path, swap_map(), and mapdef::timeout.
Referenced by enter_map().
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 146 of file swap.c.
References delete_map(), draw_ext_info_format(), EVENT_MAPRESET, execute_global_event(), first_player, mapdef::fixed_resettime, FLAG_REMOVED, free_map(), mapdef::in_memory, llevDebug, llevError, LOG(), obj::map, MAP_IN_MEMORY, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, NDI_ALL_DMS, NDI_RED, NDI_UNIQUE, pl::next, mapdef::next, pl::ob, mapdef::path, QUERY_FLAG, Settings::recycle_tmp_maps, remove_all_pets(), mapdef::reset_time, SAVE_ERROR_NOT_IN_MEMORY, SAVE_ERROR_OK, SAVE_ERROR_PLAYER, save_map(), SAVE_MODE_NORMAL, seconds(), set_map_reset_time(), settings, TRUE, and write_map_log().
Referenced by check_active_maps(), clean_tmp_files(), command_reset(), set_map_timeout(), and swap_below_max().
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 1394 of file gods.c.
References add_string(), AT_GODPOWER, AT_HOLYWORD, obj::attacktype, determine_god(), draw_ext_info(), find_god(), FREE_AND_COPY, free_object(), free_string(), get_owner(), llevError, LOG(), MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, obj::name, obj::name_pl, NDI_UNIQUE, obj::race, obj::slaying, snprintf(), SPELL, SPELL_EFFECT, obj::title, and obj::type.
Referenced by cast_cone(), cast_smite_spell(), explode_bullet(), fire_arch_from_position(), and fire_swarm().
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 244 of file move.c.
References obj::above, obj::arch, archt::clone, obj::contr, find_free_spot(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::head, insert_ob_in_map(), llevError, LOG(), obj::map, map_newmap_cmd(), obj::more, obj::name, OB_TYPE_MOVE_BLOCK, OUT_OF_REAL_MAP, P_OUT_OF_MAP, PLAYER, remove_ob(), SHOP_MAT, pl::socket, obj::type, obj::x, and obj::y.
Referenced by initteleport(), move_teleporter(), runteleport(), and shop_mat_type_move_on().
void terminate_all_pets | ( | object * | owner | ) |
Removes all pets someone owns.
owner | player we wish to remove all pets of. |
Definition at line 250 of file pets.c.
References first_friendly_object, FLAG_REMOVED, free_object(), get_owner(), oblnk::next, oblnk::ob, QUERY_FLAG, remove_friendly_object(), and remove_ob().
Referenced by apply_savebed(), check_login(), command_kill_pets(), do_server(), key_confirm_quit(), and save_player().
void tick_the_clock | ( | void | ) |
This performs the basic function of advancing the clock one tick forward. Every 20 ticks, the clock is saved to disk. It is also saved on shutdown. Any time dependant functions should be called from this function, and probably be passed tod as an argument. Please don't modify tod in the dependant function.
Definition at line 111 of file weather.c.
References dawn_to_dusk(), get_tod(), todtick, and write_todclock().
Referenced by block_until_new_connection(), and do_specials().
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 find_free_spot() to find the destination, otherwise use find_first_free_spot(). |
originator | what is causing op to move. |
1 | op was destroyed. |
0 | op was moved. |
Definition at line 197 of file move.c.
References obj::arch, archt::clone, obj::contr, find_first_free_spot(), find_free_spot(), freearr_x, freearr_y, obj::head, insert_ob_in_map(), obj::map, map_newmap_cmd(), obj::more, PLAYER, remove_ob(), SIZEOFFREE, pl::socket, obj::type, obj::x, and obj::y.
Referenced by cfapi_object_transfer(), hole_type_move_on(), kill_player(), move_teleporter(), shop_mat_type_move_on(), and trapdoor_type_move_on().
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 64 of file apply.c.
References obj::carrying, obj::weight, and obj::weight_limit.
Referenced by esrv_move_object(), put_object_in_sack(), and transport_type_apply().
void trap_adjust | ( | object * | trap, |
int | difficulty | ||
) |
Adjust trap difficulty to the map. The default traps are too strong for wimpy level 1 players, and unthreatening to anyone of high level
trap | trap to adjust. |
difficulty | map difficulty. |
Definition at line 222 of file standalone.c.
References AT_DEATH, AT_POISON, obj::attacktype, liv::Cha, liv::dam, obj::inv, obj::level, obj::other_arch, rndm(), and obj::stats.
Referenced by fix_generated_item().
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 459 of file rune.c.
References liv::dam, destroy_object(), liv::Dex, mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), obj::inv, obj::level, obj::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, obj::owner, PLAYER, PREFER_LOW, random_roll(), spring_trap(), sqr, obj::stats, and obj::type.
Referenced by dispel_rune(), and remove_trap().
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 403 of file rune.c.
References liv::Cha, mapdef::difficulty, draw_ext_info_format(), obj::level, obj::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, PREFER_HIGH, random_roll(), and obj::stats.
Referenced by find_traps().
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 431 of file rune.c.
References create_archetype(), obj::face, GET_ANIMATION, insert_ob_in_map(), obj::map, new_faces, obj::x, and obj::y.
Referenced by find_traps(), remove_trap(), and spring_trap().
int use_alchemy | ( | object * | op | ) |
Handle use_skill for alchemy-like items.
op | player trying to do alchemy. |
Definition at line 1006 of file alchemy.c.
References obj::above, attempt_do_alchemy(), obj::below, draw_ext_info_format(), esrv_send_inventory(), FLAG_APPLIED, FLAG_IS_CAULDRON, FLAG_UNPAID, GET_MAP_OB, obj::inv, obj::map, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, NDI_UNIQUE, query_base_name(), QUERY_FLAG, obj::x, and obj::y.
Referenced by do_skill().
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 976 of file skills.c.
References obj::above, add_friendly_object(), obj::attack_movement, calc_skill_exp(), liv::Cha, CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), liv::exp, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FREE_AND_COPY, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), obj::head, liv::Int, obj::level, obj::map, MAX_BUF, obj::more, obj::msg, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), remove_friendly_object(), SET_FLAG, set_owner(), obj::skill, obj::stats, obj::type, obj::x, and obj::y.
Referenced by do_skill().
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 863 of file skill_util.c.
References obj::below, do_skill(), draw_ext_info_format(), obj::facing, FLAG_CAN_USE_SKILL, obj::inv, llevDebug, LOG(), MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, QUERY_FLAG, SKILL, obj::skill, SKILL_TOOL, strncasecmp(), and obj::type.
Referenced by command_disarm(), command_search(), and command_uskill().
Definition at line 209 of file plugins.c.
References EVENT_USER, and execute_event().
Referenced by cfapi_object_user_event().
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 120 of file login.c.
References check_password(), close_and_delete(), llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, open_and_uncompress(), Settings::playerdir, settings, and snprintf().
void version | ( | object * | op | ) |
Displays basic game version information.
op | who is requesting the verison information. |
Definition at line 81 of file server.c.
References draw_ext_info(), draw_ext_info_format(), FULL_VERSION, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_VERSION, and NDI_UNIQUE.
Referenced by call_version(), and command_version().
This writes a rune that contains the appropriate message. There really isn't any adjustments we make.
op | who is casting. |
spell | actual spell cast. |
msg | message to write. |
0 | failure. |
1 | success. |
Definition at line 3257 of file spell_effect.c.
References add_string(), arch_to_object(), draw_ext_info(), HUGE_BUF, INS_BELOW_ORIGINATOR, insert_ob_in_map(), llevInfo, LOG(), obj::map, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, obj::other_arch, obj::race, strcasestr_local(), obj::x, and obj::y.
Referenced by cast_spell().
Writing skill handling.
Wrapper for write_note() and write_scroll().
pl | player writing. |
params | message to inscribe. |
skill | writing skill. |
Definition at line 1695 of file skills.c.
References BOOK, archt::clone, draw_ext_info(), draw_ext_info_format(), find_marked_object(), find_skill_by_name(), FLAG_BLIND, FLAG_UNPAID, FLAG_WIZ, get_archetype_by_type_subtype(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, PLAYER, QUERY_FLAG, SCROLL, SK_LITERACY, SKILL, obj::skill, obj::type, write_note(), and write_scroll().
Referenced by do_skill(), and inscribe_scroll_cmd().
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 66 of file rune.c.
References obj::above, add_string(), arch_to_object(), obj::below, blank_face, caster_level(), liv::Cha, copy_object(), create_archetype(), obj::direction, draw_ext_info(), draw_ext_info_format(), obj::face, freearr_x, freearr_y, GENERIC_RUNE, get_map_flags(), GET_MAP_OB, get_object(), liv::grace, insert_ob_in_map(), insert_ob_in_ob(), obj::inv, item_matched_string(), obj::level, obj::map, MAX_BUF, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, obj::other_arch, obj::path_attuned, obj::path_denied, RUNE, set_owner(), set_spell_skill(), obj::skill, snprintf(), liv::sp, SP_level_spellpoint_cost(), SPELL, SPELL_GRACE, SPELL_MANA, obj::stats, obj::type, obj::x, and obj::y.
Referenced by cast_spell().