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

Go to the source code of this file.

Functions

int account_change_password (const char *account_name, const char *current_password, const char *new_password)
 
Account_Characcount_char_add (Account_Char *chars, player *pl)
 
void account_char_free (Account_Char *chars)
 
Account_Characcount_char_load (const char *account_name)
 
Account_Characcount_char_remove (Account_Char *chars, const char *pl_name)
 
void account_char_save (const char *account, Account_Char *chars)
 
int account_check_string (const char *str)
 
const char * account_exists (const char *account_name)
 
const char * account_get_account_for_char (const char *charname)
 
socket_structaccount_get_logged_in_init_socket (const char *name)
 
playeraccount_get_logged_in_player (const char *name)
 
char ** account_get_players_for_account (const char *account_name)
 
int account_is_logged_in (const char *name)
 
int account_link (const char *account_name, const char *player_name)
 
int account_login (const char *account_name, const char *account_password)
 
int account_new (const char *account_name, const char *account_password)
 
int account_remove_player (const char *account_name, const char *player_name)
 
void accounts_clear (void)
 
void accounts_load (void)
 
void accounts_save (void)
 
playeradd_player (socket_struct *ns, int flags)
 
int alchemy (object *op, object *caster, object *spell_ob)
 
int animate_weapon (object *op, object *caster, object *spell, int dir)
 
int apply_auto (object *op)
 
void apply_auto_fix (mapstruct *m)
 
void apply_builder_remove (object *pl, int dir)
 
int apply_by_living (object *pl, object *op, int aflag, int quiet)
 
void apply_by_living_below (object *pl)
 
int apply_can_apply_object (const object *who, const object *op)
 
void apply_changes_to_player (object *pl, object *change, int limit_stats)
 
int apply_check_weapon_power (const object *who, int improves)
 
int apply_container (object *op, object *sack)
 
void apply_handle_yield (object *tmp)
 
int apply_manual (object *op, object *tmp, int aflag)
 
void apply_map_builder (object *pl, int dir)
 
int apply_race_and_class (object *op, archetype *race, archetype *opclass, living *stats)
 
int apply_special (object *who, object *op, int aflags)
 
int attack_ob (object *op, object *hitter)
 
int become_follower (object *op, const object *new_god)
 
void blind_living (object *op, object *hitter, int dam)
 
int64_t calc_skill_exp (const object *who, const object *op, const object *skill)
 
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)
 
int cftimer_create (int id, long delay, object *ob, int mode)
 
int cftimer_destroy (int id)
 
int cftimer_find_free_id (void)
 
void cftimer_init (void)
 
void cftimer_process_timers (void)
 
void change_object (object *op)
 
int change_skill (object *who, object *new_skill, int flag)
 
void check_active_maps (void)
 
void check_bullet (object *op)
 
void check_login (object *op, int check_pass)
 
int check_name (player *me, const char *name)
 
bool check_password (const char *typed, const char *crypted)
 
void check_physically_infect (object *victim, object *hitter)
 
int check_pick (object *op)
 
int check_race_and_class (living *stats, archetype *race, archetype *opclass)
 
void check_spell_expiry (object *spell)
 
objectcheck_spell_known (object *op, const char *name)
 
void check_spells (void)
 
int checkbanned (const char *login, const char *host)
 
void clean_tmp_files (void)
 
void cleanup (void)
 
void cleanupPlugins (void)
 
void clear_skill (object *who)
 
void command_abil (object *op, const char *params)
 
void command_accuse (object *op, const char *params)
 
void command_addexp (object *op, const char *params)
 
void command_afk (object *op, const char *params)
 
void command_apply (object *op, const char *params)
 
void command_applymode (object *op, const char *params)
 
void command_archs (object *op, const char *params)
 
void command_arrest (object *op, const char *params)
 
void command_banish (object *op, const char *params)
 
void command_beg (object *op, const char *params)
 
void command_bleed (object *op, const char *params)
 
void command_blush (object *op, const char *params)
 
void command_body (object *op, const char *params)
 
void command_bounce (object *op, const char *params)
 
void command_bow (object *op, const char *params)
 
void command_bowmode (object *op, const char *params)
 
void command_brace (object *op, const char *params)
 
void command_burp (object *op, const char *params)
 
void command_cackle (object *op, const char *params)
 
void command_cast (object *op, const char *params)
 
void command_cast_spell (object *op, const char *params, char command)
 
void command_chat (object *op, const char *params)
 
void command_chuckle (object *op, const char *params)
 
void command_clap (object *op, const char *params)
 
void command_cointoss (object *op, const char *params)
 
void command_cough (object *op, const char *params)
 
void command_create (object *op, const char *params)
 
void command_cringe (object *op, const char *params)
 
void command_cry (object *op, const char *params)
 
void command_dance (object *op, const char *params)
 
void command_debug (object *op, const char *params)
 
void command_diff (object *op, const char *params)
 
void command_disarm (object *op, const char *params)
 
void command_dm (object *op, const char *params)
 
void command_dmhide (object *op, const char *params)
 
void command_dmtell (object *op, const char *params)
 
void command_drop (object *op, const char *params)
 
void command_dropall (object *op, const char *params)
 
void command_dump (object *op, const char *params)
 
void command_dumpallarchetypes (object *op, const char *params)
 
void command_dumpallmaps (object *op, const char *params)
 
void command_dumpallobjects (object *op, const char *params)
 
void command_dumpbelow (object *op, const char *params)
 
void command_dumpfriendlyobjects (object *op, const char *params)
 
void command_dumpmap (object *op, const char *params)
 
void command_east (object *op, const char *params)
 
void command_empty (object *op, const char *params)
 
void command_examine (object *op, const char *params)
 
void command_fire (object *op, const char *params)
 
void command_fire_stop (object *op, const char *params)
 
void command_fix_me (object *op, const char *params)
 
void command_flip (object *op, const char *params)
 
void command_follow (object *op, const char *params)
 
void command_forget_spell (object *op, const char *params)
 
void command_free (object *op, const char *params)
 
void command_freeze (object *op, const char *params)
 
void command_frown (object *op, const char *params)
 
void command_gasp (object *op, const char *params)
 
void command_giggle (object *op, const char *params)
 
void command_glare (object *op, const char *params)
 
void command_goto (object *op, const char *params)
 
void command_grin (object *op, const char *params)
 
void command_groan (object *op, const char *params)
 
void command_growl (object *op, const char *params)
 
void command_gsay (object *op, const char *params)
 
void command_help (object *op, const char *params)
 
void command_hiccup (object *op, const char *params)
 
void command_hide (object *op, const char *params)
 
void command_hiscore (object *op, const char *params)
 
void command_hug (object *op, const char *params)
 
void command_insert_into (object *op, const char *params)
 
void command_inventory (object *op, const char *params)
 
void command_invisible (object *op, const char *params)
 
void command_invoke (object *op, const char *params)
 
void command_kick (object *op, const char *params)
 
void command_kill_pets (object *op, const char *params)
 
void command_kiss (object *op, const char *params)
 
void command_knowledge (object *pl, const char *params)
 
void command_language (object *op, const char *params)
 
void command_laugh (object *op, const char *params)
 
void command_learn_special_prayer (object *op, const char *params)
 
void command_learn_spell (object *op, const char *params)
 
void command_lick (object *op, const char *params)
 
void command_listen (object *op, const char *params)
 
void command_listplugins (object *op, const char *params)
 
void command_loadplugin (object *op, const char *params)
 
void command_loadtest (object *op, const char *params)
 
void command_lock_item (object *op, const char *params)
 
void command_malloc (object *op, const char *params)
 
void command_mapinfo (object *op, const char *params)
 
void command_maps (object *op, const char *params)
 
void command_mark (object *op, const char *params)
 
void command_me (object *op, const char *params)
 
void command_mon_aggr (object *op, const char *params)
 
void command_motd (object *op, const char *params)
 
void command_news (object *op, const char *params)
 
void command_nod (object *op, const char *params)
 
void command_north (object *op, const char *params)
 
void command_northeast (object *op, const char *params)
 
void command_northwest (object *op, const char *params)
 
void command_nowiz (object *op, const char *params)
 
void command_orcknuckle (object *op, const char *params)
 
void command_overlay_reset (object *op, const char *params)
 
void command_overlay_save (object *op, const char *params)
 
void command_party (object *op, const char *params)
 
void command_party_rejoin (object *op, const char *params)
 
void command_passwd (object *pl, const char *params)
 
void command_patch (object *op, const char *params)
 
void command_peaceful (object *op, const char *params)
 
void command_petmode (object *op, const char *params)
 
void command_pickup (object *op, const char *params)
 
void command_players (object *op, const char *params)
 
void command_poke (object *op, const char *params)
 
void command_possess (object *op, const char *params)
 
void command_pout (object *op, const char *params)
 
void command_prepare (object *op, const char *params)
 
void command_printlos (object *op, const char *params)
 
void command_puke (object *op, const char *params)
 
void command_purge_quest (object *op, const char *param)
 
void command_purge_quest_definitions (object *op, const char *param)
 
void command_quest (object *op, const char *params)
 
void command_quit (object *op, const char *params)
 
void command_remove (object *op, const char *params)
 
void command_rename_item (object *op, const char *params)
 
void command_reply (object *op, const char *params)
 
void command_reset (object *op, const char *params)
 
void command_resistances (object *op, const char *params)
 
void command_rotateshoottype (object *op, const char *params)
 
void command_rskill (object *pl, const char *params)
 
void command_rules (object *op, const char *params)
 
void command_run (object *op, const char *params)
 
void command_run_stop (object *op, const char *params)
 
void command_save (object *op, const char *params)
 
void command_say (object *op, const char *params)
 
void command_scream (object *op, const char *params)
 
void command_search (object *op, const char *params)
 
void command_search_items (object *op, const char *params)
 
void command_setgod (object *op, const char *params)
 
void command_settings (object *op, const char *ignored)
 
void command_shake (object *op, const char *params)
 
void command_shiver (object *op, const char *params)
 
void command_shout (object *op, const char *params)
 
void command_showpets (object *op, const char *params)
 
void command_shrug (object *op, const char *params)
 
void command_shutdown (object *op, const char *params)
 
void command_sigh (object *op, const char *params)
 
void command_skills (object *op, const char *params)
 
void command_slap (object *op, const char *params)
 
void command_smile (object *op, const char *params)
 
void command_smirk (object *op, const char *params)
 
void command_snap (object *op, const char *params)
 
void command_sneeze (object *op, const char *params)
 
void command_snicker (object *op, const char *params)
 
void command_sniff (object *op, const char *params)
 
void command_snore (object *op, const char *params)
 
void command_sound (object *op, const char *params)
 
void command_south (object *op, const char *params)
 
void command_southeast (object *op, const char *params)
 
void command_southwest (object *op, const char *params)
 
void command_speed (object *op, const char *params)
 
void command_spit (object *op, const char *params)
 
void command_ssdumptable (object *op, const char *params)
 
void command_stack_clear (object *op, const char *params)
 
void command_stack_list (object *op, const char *params)
 
void command_stack_pop (object *op, const char *params)
 
void command_stack_push (object *op, const char *params)
 
void command_statistics (object *pl, const char *params)
 
void command_stats (object *op, const char *params)
 
void command_stay (object *op, const char *params)
 
void command_strings (object *op, const char *params)
 
void command_strut (object *op, const char *params)
 
void command_style_map_info (object *op, const char *params)
 
void command_sulk (object *op, const char *params)
 
void command_summon (object *op, const char *params)
 
void command_take (object *op, const char *params)
 
void command_teleport (object *op, const char *params)
 
void command_tell (object *op, const char *params)
 
void command_thank (object *op, const char *params)
 
void command_think (object *op, const char *params)
 
void command_throw (object *op, const char *params)
 
void command_time (object *op, const char *params)
 
void command_title (object *op, const char *params)
 
void command_toggle_shout (object *op, const char *params)
 
void command_twiddle (object *op, const char *params)
 
void command_unarmed_skill (object *op, const char *params)
 
void command_unloadplugin (object *op, const char *params)
 
void command_use (object *op, const char *params)
 
void command_usekeys (object *op, const char *params)
 
void command_uskill (object *pl, const char *params)
 
void command_version (object *op, const char *params)
 
void command_wave (object *op, const char *params)
 
void command_west (object *op, const char *params)
 
void command_whereabouts (object *op, const char *params)
 
void command_whereami (object *op, const char *params)
 
void command_whistle (object *op, const char *params)
 
void command_who (object *op, const char *params)
 
void command_wimpy (object *op, const char *params)
 
void command_wink (object *op, const char *params)
 
void command_wizcast (object *op, const char *params)
 
void command_wizpass (object *op, const char *params)
 
void command_yawn (object *op, const char *params)
 
void 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 counterspell (object *op, int dir)
 
int create_aura (object *op, object *caster, object *spell)
 
int create_bomb (object *op, object *caster, int dir, object *spell)
 
int cure_disease (object *sufferer, object *caster, sstring skill)
 
void current_map_info (object *op)
 
void current_region_info (object *op)
 
void dead_player (object *op)
 
void delete_character (const char *name)
 
void destroy_object (object *op)
 
int detect_curse_on_item (object *pl, object *tmp, object *skill)
 
int detect_magic_on_item (object *pl, object *tmp, object *skill)
 
const char * determine_god (object *op)
 
archetypedetermine_holy_arch (const object *god, const char *type)
 
int dimension_door (object *op, object *caster, object *spob, int dir)
 
int dispel_rune (object *op, object *caster, object *spell, object *skill, int dir)
 
void display_motd (const object *op)
 
void display_who_entry (object *op, player *pl, const char *format)
 
void do_forget_spell (object *op, const char *spell)
 
void do_harvest (object *pl, int dir, object *skill)
 
void do_hidden_move (object *op)
 
void do_learn_spell (object *op, object *spell, int special_prayer)
 
int do_skill (object *op, object *part, object *skill, int dir, const char *string)
 
void do_some_living (object *op)
 
void dragon_ability_gain (object *who, int atnr, int level)
 
void drain_rod_charge (object *rod)
 
void drain_wand_charge (object *wand)
 
void drop (object *op, object *tmp)
 
objectdrop_object (object *op, object *tmp, uint32_t nrof)
 
void dump_quests (void)
 
void dump_spells (void)
 
void emergency_save (int flag)
 
void enter_exit (object *op, object *exit_ob)
 
void enter_player_maplevel (object *op)
 
void enter_player_savebed (object *op)
 
void examine (object *op, object *tmp)
 
void examine_monster (object *op, object *tmp, int level)
 
int execute_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix)
 
int execute_global_event (int eventcode,...)
 
void execute_newserver_command (object *pl, char *command)
 
void explode_bullet (object *op)
 
const objectfind_god (const char *name)
 
objectfind_key (object *pl, object *container, object *door)
 
objectfind_marked_object (object *op)
 
playerfind_player (const char *plname)
 
playerfind_player_options (const char *plname, int options, const mapstruct *map)
 
playerfind_player_partial_name (const char *plname)
 
playerfind_player_socket (const socket_struct *ns)
 
command_array_structfind_plugin_command (const char *cmd, command_array_struct *command)
 
racelinkfind_racelink (const char *name)
 
objectfind_random_spell_in_ob (object *ob, const char *skill)
 
objectfind_skill_by_name (object *who, const char *name)
 
objectfind_skill_by_number (object *who, int skillno)
 
objectfind_target_for_friendly_spell (object *op, int dir)
 
int find_traps (object *pl, object *skill)
 
void fire (object *op, int dir)
 
int fire_arch_from_position (object *op, object *caster, int16_t x, int16_t y, int dir, object *spell)
 
int fire_bolt (object *op, object *caster, int dir, object *spob)
 
int fire_bow (object *op, object *arrow, int dir, int wc_mod, int16_t sx, int16_t sy)
 
int fire_swarm (object *op, object *caster, object *spell, int dir)
 
void fix_luck (void)
 
objectfix_stopped_arrow (object *op)
 
void fix_stopped_item (object *op, mapstruct *map, object *originator)
 
void fix_weight (void)
 
void flush_old_maps (void)
 
int forbid_play (void)
 
void free_knowledge (void)
 
int free_no_drop (object *op)
 
void free_quest (void)
 
void free_quest_definitions (void)
 
void free_server (void)
 
int friendly_fire (object *op, object *hitter)
 
void get_name (object *op)
 
objectget_nearest_player (object *mon)
 
int get_party_password (object *op, partylist *party)
 
void get_password (object *op)
 
playerget_player (player *p)
 
void get_who_escape_code_value (char *return_val, int size, const char letter, player *pl)
 
void give_initial_items (object *pl, treasurelist *items)
 
int handle_newcs_player (object *op)
 
int hide (object *op, object *skill)
 
int hideability (object *ob)
 
void hiscore_check (object *op, int quiet)
 
void hiscore_display (object *op, int max, const char *match)
 
void hiscore_init (void)
 
int hit_map (object *op, int dir, uint32_t type, int full_hit)
 
int hit_player (object *op, int dam, object *hitter, uint32_t type, int full_hit)
 
objecthit_with_arrow (object *op, object *victim)
 
int identify_object_with_skill (object *tmp, object *pl, object *skill, int print_on_success)
 
int infect_object (object *victim, object *disease, int force)
 
void init (int argc, char **argv)
 
void init_commands (void)
 
void init_ob_methods (void)
 
void init_skills (void)
 
void initPlugins (void)
 
void inventory (object *op, object *inv)
 
int is_true_undead (object *op)
 
int jump (object *pl, int dir, object *skill)
 
void key_change_class (object *op, char key)
 
void key_confirm_quit (object *op, char key)
 
void key_roll_stat (object *op, char key)
 
void kill_player (object *op, const object *killer)
 
void knowledge_first_player_save (player *pl)
 
void knowledge_give (player *pl, const char *marker, const object *book)
 
void knowledge_item_can_be_used_alchemy (object *op, const object *item)
 
int knowledge_player_knows (const player *pl, const char *knowledge)
 
void knowledge_process_incremental (void)
 
void knowledge_read (player *pl, object *book)
 
void knowledge_send_info (socket_struct *ns)
 
void knowledge_send_known (player *pl)
 
void knowledge_show_monster_detail (object *op, const char *name)
 
int learn_skill (object *pl, object *scroll)
 
void leave (player *pl, int draw_exit)
 
void legacy_animate_trigger (object *op)
 
void legacy_apply_container (object *op, object *sack)
 
void legacy_move_hole (object *op)
 
void legacy_remove_force (object *op)
 
int legal_range (object *op, int r)
 
void link_player_skills (object *op)
 
void list_players (object *op, region *reg, partylist *party)
 
objectlookup_spell_by_name (object *op, const char *spname)
 
int magic_wall (object *op, object *caster, int dir, object *spell_ob)
 
void make_visible (object *op)
 
int makes_invisible_to (object *pl, object *mon)
 
void map_info (object *op, const char *search)
 
void meditate (object *pl, object *skill)
 
int min_casting_level (const object *caster, const object *spell)
 
int monster_can_detect_enemy (object *op, object *enemy, rv_vector *rv)
 
int monster_can_see_enemy (object *op, object *enemy)
 
void monster_check_apply_all (object *monster)
 
void monster_check_doors (object *op, mapstruct *m, int x, int y)
 
void monster_check_earthwalls (object *op, mapstruct *m, int x, int y)
 
objectmonster_check_enemy (object *npc, rv_vector *rv)
 
void monster_communicate (object *op, const char *txt)
 
int monster_compute_path (object *source, object *target, int default_dir)
 
void monster_do_living (object *op)
 
void monster_do_say (const mapstruct *map, const char *message)
 
objectmonster_find_nearest_living_creature (object *npc)
 
objectmonster_find_throw_ob (object *op)
 
int monster_move (object *op)
 
void monster_npc_call_help (object *op)
 
void monster_npc_say (object *npc, const char *cp)
 
int monster_stand_in_light (object *op)
 
int mood_change (object *op, object *caster, object *spell)
 
int move_disease (object *disease)
 
void move_firewall (object *op)
 
int move_ob (object *op, int dir, object *originator)
 
int move_object (object *op, int dir)
 
int move_player (object *op, int dir)
 
void move_player_attack (object *op, int dir)
 
void move_player_mover (object *op)
 
void move_symptom (object *symptom)
 
int move_to (object *op, int x, int y)
 
char const * newhash (char const *password)
 
int ok_to_put_more (mapstruct *m, int16_t x, int16_t y, object *op, uint32_t 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, int dam)
 
int party_confirm_password (const partylist *party, const char *password)
 
partylistparty_find (const char *partyname)
 
partylistparty_form (object *op, const char *partyname)
 
partylistparty_get_first (void)
 
const char * party_get_leader (const partylist *party)
 
partylistparty_get_next (const partylist *party)
 
const char * party_get_password (const partylist *party)
 
void party_join (object *op, partylist *party)
 
void party_leave (object *op)
 
void party_obsolete_parties (void)
 
void party_remove (partylist *party)
 
void party_send_message (object *op, const char *message)
 
void party_set_password (partylist *party, const char *password)
 
int path_to_player (object *mon, object *pl, unsigned mindiff)
 
int perceive_self (object *op)
 
void pets_control_golem (object *op, int dir)
 
void pets_follow_owner (object *ob, object *owner)
 
objectpets_get_enemy (object *pet, rv_vector *rv)
 
void pets_move (object *ob)
 
void pets_move_golem (object *op)
 
void pets_remove_all (void)
 
int pets_should_arena_attack (object *pet, object *owner, object *target)
 
int pets_summon_golem (object *op, object *caster, int dir, object *spob)
 
int pets_summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 
void pets_terminate_all (object *owner)
 
int pick_lock (object *pl, int dir, object *skill)
 
void pick_up (object *op, object *alt)
 
void play_again (object *op)
 
int player_arrest (object *who)
 
int player_can_view (object *pl, object *op)
 
void player_set_state (player *pl, uint8_t state)
 
void player_unready_range_ob (player *pl, object *ob)
 
int playername_ok (const char *cp)
 
int players_on_map (mapstruct *m, int show_all)
 
int plugin_event_say (object *npc, talk_info *talk)
 
void plugins_display_list (object *op)
 
int plugins_init_plugin (const char *libfile)
 
int plugins_remove_plugin (const char *id)
 
void polymorph (object *op, object *who, int level)
 
int pray (object *pl, object *skill)
 
void pray_at_altar (object *pl, object *altar, object *skill)
 
int probe (object *op, object *caster, object *spell_ob, int dir, int level)
 
void process_events (void)
 
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_t nrof)
 
void quest_first_player_save (player *pl)
 
int quest_get_player_state (player *pl, sstring quest_code)
 
void quest_send_initial_states (player *pl)
 
void quest_set_player_state (player *pl, sstring quest_code, int state)
 
void quest_start (player *pl, sstring quest_code, int state)
 
int quest_was_completed (player *pl, sstring quest_code)
 
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)
 
int remove_curse (object *op, object *caster, object *spell)
 
void remove_door (object *op)
 
void remove_locked_door (object *op)
 
int remove_trap (object *op, object *skill)
 
void remove_unpaid_objects (object *op, object *env, int free_items)
 
void rod_adjust (object *rod)
 
void roll_again (object *op)
 
int roll_stat (void)
 
void roll_stats (object *op)
 
int sack_can_hold (const object *pl, const object *sack, const object *op, uint32_t nrof)
 
int save_player (object *op, int flag)
 
void save_throw_object (object *op, uint32_t type, object *originator)
 
void scroll_failure (object *op, int failure, int power)
 
void send_news (const object *op)
 
void send_rules (const object *op)
 
void server_main (int argc, char *argv[])
 
void set_darkness_map (mapstruct *m)
 
void set_first_map (object *op)
 
void set_map_timeout (mapstruct *oldmap)
 
int set_object_face_main (object *op)
 
void set_spell_skill (object *op, object *caster, object *spob, object *dest)
 
int should_director_abort (const object *op, const object *victim)
 
void show_skills (object *op, const char *search)
 
void shuffle_attack (object *op, int change_face)
 
int singing (object *pl, int dir, object *skill)
 
void skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill)
 
int skill_ident (object *pl, object *skill)
 
int skill_throw (object *op, object *part, int dir, object *skill)
 
int SP_level_dam_adjust (const object *caster, const object *spob)
 
int SP_level_duration_adjust (const object *caster, const object *spob)
 
int SP_level_range_adjust (const object *caster, const object *spob)
 
int16_t SP_level_spellpoint_cost (object *caster, object *spell, int flags)
 
int SP_level_wc_adjust (const object *caster, const object *spob)
 
void spell_effect (object *spob, int x, int y, mapstruct *map, object *originator)
 
void spell_failure (object *op, int failure, int power, object *skill)
 
int spell_find_dir (mapstruct *m, int x, int y, object *exclude)
 
void spring_trap (object *trap, object *victim)
 
int stand_near_hostile (object *who)
 
int steal (object *op, int dir, object *skill)
 
objectstop_item (object *op)
 
void store_spell_expiry (object *spell)
 
int summon_hostile_monsters (object *op, int n, const char *monstername)
 
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_t tele_type, object *user)
 
int tick_length (float seconds)
 
void tick_the_clock (void)
 
int transfer_ob (object *op, int x, int y, int randomly, object *originator)
 
int transport_can_hold (const object *transport, const object *op, int nrof)
 
int trap_disarm (object *disarmer, object *trap, int risk, object *skill)
 
int trap_see (object *op, object *trap)
 
int trap_show (object *trap, object *where)
 
int use_alchemy (object *op)
 
int use_oratory (object *pl, int dir, object *skill)
 
int use_skill (object *op, const char *string)
 
int user_event (object *op, object *activator, object *third, const char *message, int fix)
 
int verify_player (const char *name, char *password)
 
int write_mark (object *op, object *spell, const char *msg)
 
int write_on_item (object *pl, const char *params, object *skill)
 
int write_rune (object *op, object *caster, object *spell, int dir, const char *runename)
 

Function Documentation

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

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

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

Definition at line 657 of file account.c.

References account_check_string(), check_password(), account_struct::name, newhash(), account_struct::next, account_struct::password, strcasecmp(), and strdup_local.

Referenced by account_password().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Account_Char* account_char_add ( Account_Char chars,
player pl 
)

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

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

Definition at line 192 of file account_char.c.

References add_string(), obj::arch, account_char_struct::character_class, archt::clone, account_char_struct::face, obj::face, free_string(), account_char_struct::isDead, account_char_struct::level, obj::level, account_char_struct::map, obj::map, pl::maplevel, new_face_struct::name, account_char_struct::name, obj::name, mapdef::name, account_char_struct::next, pl::ob, account_char_struct::party, pl::party, party_struct::partyname, and account_char_struct::race.

Referenced by save_player(), and START_TEST().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void account_char_free ( Account_Char chars)

This frees all data associated with the character information.

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

Definition at line 332 of file account_char.c.

References account_char_struct::character_class, account_char_struct::face, free_string(), account_char_struct::map, account_char_struct::name, account_char_struct::next, account_struct::next, account_char_struct::party, and account_char_struct::race.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Account_Char* account_char_load ( const char *  account_name)

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

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

Definition at line 79 of file account_char.c.

References ACCOUNT_DIR, add_string(), llevError, llevInfo, Settings::localdir, LOG(), MAX_BUF, NUM_ACCOUNT_CHAR_FIELDS, settings, snprintf, split_string(), and VERY_BIG_BUF.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Account_Char* account_char_remove ( Account_Char chars,
const char *  pl_name 
)

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

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

Definition at line 296 of file account_char.c.

References account_char_struct::character_class, account_char_struct::face, free_string(), account_char_struct::map, account_char_struct::name, account_char_struct::next, account_char_struct::party, and account_char_struct::race.

+ Here is the call graph for this function:

void account_char_save ( const char *  account,
Account_Char chars 
)

Saves the character information for the given account.

Parameters
accountaccount name to save data for.
charspreviously loaded/generated list of character information for this account.

Definition at line 145 of file account_char.c.

References ACCOUNT_DIR, account_char_struct::character_class, account_char_struct::face, account_char_struct::isDead, account_char_struct::level, Settings::localdir, account_char_struct::map, MAX_BUF, account_char_struct::name, account_char_struct::next, of_close(), of_open(), account_char_struct::party, account_char_struct::race, settings, snprintf, and unlink.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int account_check_string ( const char *  str)

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

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

Definition at line 368 of file account.c.

References MAX_NAME.

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

+ Here is the caller graph for this function:

const char* account_exists ( const char *  account_name)

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

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

Definition at line 308 of file account.c.

References account_struct::name, account_struct::next, and strcasecmp().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* account_get_account_for_char ( const char *  charname)

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

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

Definition at line 561 of file account.c.

References account_struct::character_names, account_struct::name, account_struct::next, and account_struct::num_characters.

Referenced by account_add_player_cmd(), and save_player().

+ Here is the caller graph for this function:

socket_struct* account_get_logged_in_init_socket ( const char *  name)

This is like the above routine, but checks the init_sockets (account in process of logging in).

Parameters
nameaccount name to check against
Returns
index value into init_sockets[] of matching socket, or -1 if no match.

Definition at line 607 of file account.c.

References Socket_Info::allocated_sockets, init_sockets, Ns_Add, socket_info, and strcasecmp().

Referenced by account_is_logged_in(), and account_login_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

player* account_get_logged_in_player ( const char *  name)

This checks to see if the account is logged in with a player attached If so, it returns the player object.

Parameters
nameaccount name to check against.
Returns
player structure of matching account, or NULL if no match.

Definition at line 586 of file account.c.

References socket_struct::account_name, first_player, pl::next, pl::socket, and strcasecmp().

Referenced by account_is_logged_in(), and account_login_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char** account_get_players_for_account ( const char *  account_name)

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

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

Definition at line 542 of file account.c.

References account_struct::character_names, account_struct::name, account_struct::next, and strcasecmp().

Referenced by account_play_cmd(), send_account_players(), and START_TEST().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int account_is_logged_in ( const char *  name)

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

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

Definition at line 629 of file account.c.

References account_get_logged_in_init_socket(), and account_get_logged_in_player().

Referenced by account_add_player_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Parameters
account_namename of the account we are adding this player to.
player_namename of this player.
Return values
0player name added successfully.
1could not find account of that name.
2number of characters on this account has reached a maximum.

Definition at line 460 of file account.c.

References account_struct::character_names, MAX_CHARACTERS_PER_ACCOUNT, account_struct::name, account_struct::next, account_struct::num_characters, strcasecmp(), and strdup_local.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

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

Definition at line 332 of file account.c.

References check_password(), account_struct::last_login, account_struct::name, account_struct::next, account_struct::password, and strcasecmp().

Referenced by account_login_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Definition at line 407 of file account.c.

References account_check_string(), account_exists(), accounts, accounts_loaded, account_struct::character_names, account_struct::created, account_struct::last_login, MAX_CHARACTERS_PER_ACCOUNT, account_struct::name, newhash(), account_struct::next, account_struct::num_characters, account_struct::password, and strdup_local.

Referenced by account_new_cmd(), and START_TEST().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Definition at line 496 of file account.c.

References account_struct::character_names, account_struct::name, account_struct::next, account_struct::num_characters, and strcasecmp().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void accounts_clear ( void  )

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

Definition at line 112 of file account.c.

References accounts_loaded.

Referenced by START_TEST().

+ Here is the caller graph for this function:

void accounts_load ( void  )

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

Definition at line 121 of file account.c.

References ACCOUNT_FILE, accounts_loaded, account_struct::character_names, account_struct::created, account_struct::last_login, llevError, llevInfo, Settings::localdir, LOG(), MAX_BUF, MAX_CHARACTERS_PER_ACCOUNT, account_struct::name, account_struct::next, NUM_ACCOUNT_FIELDS, account_struct::num_characters, account_struct::password, settings, snprintf, split_string(), strdup_local, and VERY_BIG_BUF.

Referenced by init(), and START_TEST().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void accounts_save ( void  )

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

Definition at line 267 of file account.c.

References ACCOUNT_FILE, account_write_entry(), accounts_loaded, account_struct::created, Settings::localdir, MAX_BUF, account_struct::next, account_struct::num_characters, of_close(), of_open(), settings, and snprintf.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

player* add_player ( socket_struct ns,
int  flags 
)

Tries to add player on the connection passwd in ns.

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

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

Definition at line 453 of file player.c.

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

Referenced by add_me_cmd(), and create_player_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Change items to gold nuggets. Only works for players.

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

Definition at line 2254 of file spell_effect.c.

References alchemy_object(), obj::contr, obj::duration, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, socket_struct::look_position, obj::map, MOVE_WALK, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, QUERY_FLAG, pl::socket, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::type, obj::x, and obj::y.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Definition at line 3016 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, 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_marked_object(), fix_object(), FLAG_ANIMATE, FLAG_APPLIED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_REMOVED, FLAG_UNPAID, FLAG_USE_WEAPON, free_string(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GOLEM, pl::golem_count, liv::hp, 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, object_find_free_spot(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_owner(), object_split(), object_update_speed(), obj::other_arch, P_OUT_OF_MAP, pets_control_golem(), PLAYER, QUERY_FLAG, query_name(), obj::race, range_golem, pl::ranges, obj::resist, _materialtype::save, SET_FLAG, 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, liv::wc, WEAPON, obj::x, and obj::y.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int apply_auto ( object op)

Map was just loaded, handle op's initialization.

Generates shop floor's item, and treasures.

Parameters
opobject to initialize.
Returns
1 if object was initialized, 0 else.
Note
auto_apply() has been renamed to apply_auto()

Definition at line 214 of file main.c.

References BOOK, CLEAR_FLAG, create_treasure(), mapdef::difficulty, obj::env, liv::exp, FLAG_AUTO_APPLY, FLAG_BLESSED, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_A_TEMPLATE, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, FREE_OBJ_NO_DESTROY_CALLBACK, generate_treasure(), GT_ENVIRONMENT, GT_ONLY_GOOD, HAS_RANDOM_ITEMS, liv::hp, identify(), obj::map, MAX, object_free2(), object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), QUERY_FLAG, obj::randomitems, SET_FLAG, SHOP_FLOOR, obj::stats, TREASURE, obj::type, obj::x, and obj::y.

Referenced by apply_auto_fix(), and do_auto_apply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void apply_auto_fix ( mapstruct m)

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

Parameters
mmap to fix.
Note
fix_auto_apply() has been renamed to apply_auto_fix()

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

Definition at line 261 of file main.c.

References obj::above, ALTAR, apply_auto(), obj::arch, check_trigger(), CLASS, CONTAINER, create_treasure(), mapdef::difficulty, FIREWALL, FLAG_AUTO_APPLY, FLAG_IS_LINKED, FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, GET_MAP_OB, HAS_RANDOM_ITEMS, HEAD, liv::hp, MAP_HEIGHT, MAP_WIDTH, monster_check_apply_all(), object_update_speed(), PLAYER, PLAYER_CHANGER, POTION, QUERY_FLAG, obj::randomitems, ROD, SCROLL, SPELL, SPELLBOOK, obj::stats, TIMED_GATE, TREASURE, TRIGGER_BUTTON, TRIGGER_PEDESTAL, obj::type, and WAND.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void apply_builder_remove ( object pl,
int  dir 
)

Item remover.

Removes first buildable item, either under or above the floor

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

Definition at line 889 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, 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, object_free_drop_inventory(), object_remove(), mapdef::path, PEDESTAL, QUERY_FLAG, query_name(), remove_button_link(), SIGN, TIMED_GATE, obj::type, WALL, obj::x, and obj::y.

Referenced by apply_map_builder().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Living thing is applying an object.

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

Definition at line 557 of file apply.c.

References obj::anim_suffix, apply_anim_suffix(), apply_manual(), draw_ext_info(), draw_ext_info_format(), obj::env, FLAG_WAS_WIZ, FLAG_WIZ, MAX_BUF, METHOD_ERROR, METHOD_OK, METHOD_SILENT_ERROR, METHOD_UNHANDLED, MOVE_FLYING, obj::move_type, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, account_struct::name, NDI_UNIQUE, object_free2(), object_remove(), play_sound_map(), PLAYER, QUERY_FLAG, query_name(), SOUND_TYPE_ITEM, and obj::type.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void apply_by_living_below ( object pl)

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

Parameters
plplayer.
Note
player_apply_below() has been renamed to apply_by_living_below()

Definition at line 618 of file apply.c.

References apply_by_living(), obj::below, obj::container, obj::contr, FLAG_IS_FLOOR, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, obj::inv, obj::invisible, METHOD_OK, obj::move_on, obj::move_type, ob_apply(), QUERY_FLAG, TRANSPORT, pl::transport, and obj::type.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int apply_can_apply_object ( const object who,
const object op 
)

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

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

Definition at line 942 of file apply.c.

References 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_USE_ARMOUR, FLAG_USE_BOW, FLAG_USE_RANGE, FLAG_USE_RING, FLAG_USE_SHIELD, FLAG_USE_WEAPON, get_item_from_body_location(), obj::inv, IS_ARMOR, IS_SHIELD, IS_WEAPON, NUM_BODY_LOCATIONS, object_find_by_type_applied(), PLAYER, QUERY_FLAG, RING, ROD, SHIELD, obj::type, WAND, and WEAPON.

Referenced by apply_check_apply_restrictions(), and monster_check_apply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Applies (race) changes to a player.

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

Definition at line 1581 of file apply.c.

References AC_PLAYER_STAT_LIMIT, AC_PLAYER_STAT_NO_CHANGE, obj::anim_speed, obj::anim_suffix, animate_object(), obj::animation_id, animations, obj::arch, change_attr_value(), CHARISMA, CLASS, CLEAR_FLAG, archt::clone, obj::contr, obj::face, obj::facing, FLAG_ANIMATE, FLAG_USE_WEAPON, FORCE, GET_ANIM_ID, get_attr_value(), give_initial_items(), MAX_BUF, animations_struct::name, NUM_STATS, object_find_by_name(), object_present_in_ob_by_name(), pl::orig_stats, QUERY_FLAG, obj::randomitems, rndm(), set_attr_value(), SET_FLAG, snprintf, obj::stats, try_find_animation(), and obj::type.

Referenced by apply_race_and_class(), and player_changer_type_process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int apply_check_weapon_power ( const object who,
int  improves 
)

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

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

Definition at line 1057 of file apply.c.

References obj::level.

Referenced by apply_special(), and improve_weapon().

+ Here is the caller graph for this function:

int apply_container ( object op,
object sack 
)

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

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

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

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

Definition at line 216 of file apply.c.

References CLEAR_FLAG, CONTAINER, obj::container, socket_struct::container_position, obj::contr, obj::count, draw_ext_info_format(), obj::env, esrv_send_inventory(), esrv_send_item(), esrv_update_item(), EVENT_CLOSE, execute_event(), find_key(), FLAG_APPLIED, INS_NO_MERGE, 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, object_insert_in_map_at(), object_insert_in_ob(), object_split(), object_was_destroyed, PLAYER, QUERY_FLAG, query_name(), SCRIPT_FIX_ALL, SET_FLAG, set_object_face_main(), set_object_face_other(), obj::slaying, pl::socket, obj::type, UPD_FACE, UPD_FLAGS, obj::x, and obj::y.

Referenced by legacy_apply_container(), and loot_object().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void apply_handle_yield ( object tmp)

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

Parameters
tmpitem that was applied.
Note
handle_apply_yield() has been renamed to apply_handle_yield()

Definition at line 125 of file apply.c.

References create_archetype(), drop(), obj::env, INS_BELOW_ORIGINATOR, obj::map, object_get_value(), object_insert_in_map_at(), object_insert_in_ob(), obj::x, and obj::y.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Main apply handler.

Checks for unpaid items before applying.

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

Definition at line 510 of file apply.c.

References apply_check_race_restrictions(), obj::contr, draw_ext_info(), EVENT_APPLY, execute_event(), FLAG_APPLIED, FLAG_UNPAID, 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 apply_by_living(), cfapi_object_apply(), give_initial_items(), monster_apply_below(), monster_check_apply(), polymorph_living(), transmute_item_to_flower(), and write_scroll().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void apply_map_builder ( object pl,
int  dir 
)

Global building function

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

Parameters
plplayer building or removing.
dirbuilding direction.

Definition at line 959 of file build_map.c.

References apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), obj::arch, can_build_over(), obj::contr, draw_ext_info(), find_archetype(), find_marked_object(), FLAG_IS_BUILDABLE, FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, freearr_x, freearr_y, GET_MAP_OB, IS_PLAYER(), llevError, LOG(), obj::map, MAP_HEIGHT, MAP_WIDTH, MATERIAL, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, archt::name, NDI_UNIQUE, object_create_arch(), object_decrease_nrof_by_one, mapdef::path, QUERY_FLAG, range_builder, pl::ranges, SET_FLAG, SIGN, obj::slaying, ST_BD_BUILD, ST_BD_REMOVE, ST_MAT_FLOOR, ST_MAT_ITEM, ST_MAT_WALL, ST_MAT_WINDOW, obj::subtype, obj::type, obj::x, and obj::y.

Referenced by fire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Definition at line 1450 of file player.c.

References AC_PLAYER_STAT_NO_CHANGE, add_statbonus(), add_string(), allowed_class(), apply_changes_to_player(), obj::arch, obj::carrying, CLEAR_FLAG, archt::clone, obj::contr, create_treasure(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, execute_global_event(), find_treasurelist(), fix_object(), FLAG_WIZ, free_string(), get_attr_value(), give_initial_items(), liv::grace, socket_struct::host, liv::hp, obj::inv, link_player_skills(), Settings::localdir, make_path_to_file(), MAX_BUF, liv::maxhp, liv::maxsp, obj::name, obj::name_pl, NUM_STATS, object_copy(), object_free2(), object_remove(), object_set_msg(), object_update(), pl::orig_stats, Settings::playerdir, pticks, obj::randomitems, SET_ANIMATION, set_attr_value(), settings, snprintf, pl::socket, liv::sp, obj::stats, pl::title, UP_OBJ_FACE, UPD_FACE, and obj::weight.

Referenced by create_player_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Apply an object.

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

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

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

Definition at line 1082 of file apply.c.

References AMULET, AP_APPLY, AP_BASIC_FLAGS, AP_IGNORE_CURSE, AP_NOPRINT, AP_UNAPPLY, apply_check_apply_restrictions(), apply_check_item_power(), apply_check_owner(), apply_check_personalized_blessings(), apply_check_weapon_power(), apply_update_ranged_skill(), ARMOUR, BOOTS, BOW, BRACERS, BUILDER, change_abil(), change_skill(), obj::chosen_skill, CLOAK, obj::contr, draw_ext_info(), draw_ext_info_format(), obj::env, esrv_update_item(), find_skill_by_name(), fix_object(), FLAG_APPLIED, FLAG_BEEN_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SKILL, FLAG_READY_WEAPON, GIRDLE, GLOVES, HELMET, obj::last_eat, llevError, LOG(), MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, NDI_UNIQUE, obj::nrof, object_insert_in_ob(), object_split(), PLAYER, QUERY_FLAG, query_name(), obj::race, range_bow, range_builder, range_misc, pl::ranges, RING, ROD, SET_FLAG, SHIELD, pl::shoottype, SKILL, obj::skill, SKILL_TOOL, obj::type, unapply_special(), UPD_FLAGS, UPD_NROF, UPD_WEIGHT, WAND, and WEAPON.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int attack_ob ( object op,
object hitter 
)

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

Parameters
opvictim.
hitterattacker.
Returns
dealt damage.

Definition at line 903 of file attack.c.

References attack_ob_simple(), liv::dam, HEAD, obj::stats, and liv::wc.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int become_follower ( object op,
const object new_god 
)

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

Parameters
opplayer switching cults.
new_godnew god to worship.
Returns
1 if successfully converted, 0 if the god doesn't like the race, or something else.
Todo:

isn't there duplication with remove_special_prayers() for spell removing?

split the check to make this function only actually become follower

Definition at line 473 of file gods.c.

References add_string(), ARMOUR, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_POISON, BOOK, BOOTS, cast_magic_storm(), change_abil(), CLEAR_FLAG, archt::clone, obj::contr, create_archetype(), determine_god(), draw_ext_info_format(), find_god(), FLAG_APPLIED, FLAG_BLIND, FLAG_MAKE_INVIS, FLAG_REFL_MISSILE, FLAG_REFL_SPELL, FLAG_SEE_IN_DARK, FLAG_STARTEQUIP, FLAG_STEALTH, FLAG_UNDEAD, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FLAG_XRAYS, follower_remove_given_items(), liv::food, FOR_INV_FINISH, FOR_INV_PREPARE, FORCE, free_string(), get_archetype_by_type_subtype(), give_skill_by_name(), GLOVES, god_gives_present(), liv::grace, HELMET, liv::hp, 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, object_find_by_type_subtype(), object_free_drop_inventory(), object_present_in_ob_by_name(), object_remove(), obj::path_attuned, obj::path_denied, obj::path_repelled, player_unready_range_ob(), PREFER_LOW, QUERY_FLAG, obj::race, random_roll(), obj::randomitems, obj::resist, SET_FLAG, SHIELD, SK_PRAYING, SKILL, obj::slaying, liv::sp, SPELL, SPELLBOOK, obj::stats, stop_using_item(), obj::title, obj::type, update_priest_flag(), WEAPON, and worship_forbids_use().

Referenced by command_setgod(), and pray_at_altar().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Blind a living thing.

Parameters
opvictim.
hitterwho is attacking.
damdamage to deal.

Definition at line 2297 of file attack.c.

References ATNR_BLIND, BLINDNESS, change_abil(), create_archetype(), draw_ext_info_format(), fix_object(), FLAG_APPLIED, FLAG_BLIND, liv::food, MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, NDI_UNIQUE, object_get_owner(), object_insert_in_ob(), object_present_in_ob(), query_name(), obj::resist, SET_FLAG, obj::speed, and obj::stats.

Referenced by hit_with_one_attacktype(), and scroll_failure().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

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

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

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

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

Definition at line 657 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 book_type_apply(), detect_curse_on_item(), detect_magic_on_item(), do_hidden_move(), find_traps(), hide(), identify_object_with_skill(), kill_object(), pick_lock(), remove_trap(), scroll_type_apply(), singing(), spellbook_type_apply(), steal(), use_oratory(), and write_scroll().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 
)

Cast some stat-improving spell.

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

Definition at line 1862 of file spell_effect.c.

References liv::ac, add_refcount(), arch_to_object(), obj::attacktype, 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, FOR_INV_FINISH, FOR_INV_PREPARE, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_attr_value(), liv::hp, INS_ON_TOP, obj::map, 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, object_insert_in_map_at(), object_insert_in_ob(), obj::other_arch, 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, liv::wc, obj::x, and obj::y.

Referenced by cast_spell(), and god_intervention().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

This changes the light level for the entire map.

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

Definition at line 3244 of file spell_effect.c.

References change_map_light(), liv::dam, draw_ext_info(), obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, and obj::stats.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Casts a cone spell.

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

Definition at line 297 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, FLAG_UNDEAD, freearr_x, freearr_y, get_fear_bonus(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_turn_bonus(), 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, object_insert_in_map_at(), object_set_owner(), obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, RUNE, set_spell_skill(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::stats, tailor_god_spell(), obj::type, liv::Wis, obj::x, and obj::y.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

A spell to make an altar your god's.

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

Definition at line 2938 of file spell_effect.c.

References arch_to_object(), caster_level(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_archetype(), find_god(), FLAG_IS_BUILDABLE, FLAG_IS_FLOOR, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, HOLY_ALTAR, INS_BELOW_ORIGINATOR, 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, object_insert_in_map_at(), object_remove(), QUERY_FLAG, SET_FLAG, snprintf, and tolower.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Definition at line 605 of file spell_effect.c.

References cast_create_obj(), archt::clone, draw_ext_info(), DRINK, find_archetype_by_object_type_name(), first_archetype, liv::food, FOOD, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, archt::next, obj::nrof, object_copy(), object_new(), SP_level_duration_adjust(), obj::stats, obj::type, and obj::value.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Definition at line 498 of file spell_effect.c.

References BOW, cast_create_obj(), obj::count, create_archetype(), liv::dam, draw_ext_info_format(), obj::duration, find_archetype(), find_artifactlist(), FLAG_IDENTIFIED, FREE_OBJ_NO_DESTROY_CALLBACK, give_artifact_abilities(), artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), obj::magic, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, artifactstruct::next, obj::nrof, object_find_by_type_applied(), object_free2(), object_was_destroyed, pick_up(), PLAYER, obj::race, SET_FLAG, obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::stats, strcasecmp(), obj::type, and obj::value.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Definition at line 535 of file spell_util.c.

References draw_ext_info(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, INS_BELOW_ORIGINATOR, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), P_OUT_OF_MAP, obj::x, and obj::y.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

This function cast the spell of town portal for op.

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

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

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

Definition at line 1129 of file spell_effect.c.

References add_string(), ARCH_PORTAL_FAILED, 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(), FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, FREE_AND_COPY, FREE_OBJ_FREE_INVENTORY, FREE_OBJ_NO_DESTROY_CALLBACK, free_string(), mapdef::last_reset_time, llevDebug, llevError, Settings::localdir, LOG(), obj::map, map_find_by_archetype(), MAP_PLAYER_UNIQUE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, obj::name_pl, NDI_NAVY, NDI_UNIQUE, object_free2(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_msg(), obj::other_arch, mapdef::path, obj::race, ready_map_name(), settings, obj::slaying, snprintf, pl::transport, obj::weapontype, obj::x, and obj::y.

Referenced by cast_spell().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: