Crossfire Server, Branch 1.12
R12190
|
This file contains core skill handling. More...
#include <global.h>
#include <object.h>
#include <sproto.h>
#include <living.h>
#include <skills.h>
#include <spells.h>
#include <book.h>
Go to the source code of this file.
Functions | |
static int | adj_stealchance (object *op, object *victim, int roll) |
Computes stealing chance. | |
static int | attempt_hide (object *op, object *skill) |
Someone is trying to hide. | |
static int | attempt_jump (object *pl, int dir, int spaces, object *skill) |
Someone is trying to jump. | |
static int | attempt_pick_lock (object *door, object *pl, object *skill) |
Attempt to pick a lock. | |
static int | attempt_steal (object *op, object *who, object *skill) |
Steal objects. | |
static int | do_skill_detect_curse (object *pl, object *skill) |
Check for cursed object with the 'detect curse' skill. | |
static int | do_skill_detect_magic (object *pl, object *skill) |
Check for magic object with the 'detect magic' skill. | |
static int | do_skill_ident (object *pl, int obj_class, object *skill) |
Workhorse for skill_ident() -b.t. | |
static int | do_skill_ident2 (object *tmp, object *pl, int obj_class, object *skill) |
Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conveniently. | |
static int | do_throw (object *op, object *part, object *toss_item, int dir, object *skill) |
Op throws any object toss_item. | |
static object * | find_throw_ob (object *op, const char *request) |
Find an object to throw. | |
int | find_traps (object *pl, object *skill) |
Checks for traps on the spaces around the player or in certain objects. | |
int | hide (object *op, object *skill) |
Main hide handling. | |
int | jump (object *pl, int dir, object *skill) |
Jump skill handling. | |
static object * | make_throw_ob (object *orig) |
We construct the 'carrier' object in which we will insert the object that is being thrown. | |
void | meditate (object *pl, object *skill) |
Meditation skill handling. | |
int | pick_lock (object *pl, int dir, object *skill) |
Lock pick handling. | |
int | pray (object *pl, object *skill) |
Praying skill handling. | |
int | remove_trap (object *op, object *skill) |
This skill will disarm any previously discovered trap. | |
int | singing (object *pl, int dir, object *skill) |
Singing skill handling. | |
int | skill_ident (object *pl, object *skill) |
Main identification skill handling. | |
int | skill_throw (object *op, object *part, int dir, const char *params, object *skill) |
Throwing skill handling. | |
int | steal (object *op, int dir, object *skill) |
Main stealing function. | |
static void | stop_jump (object *pl) |
End of jump. | |
int | use_oratory (object *pl, int dir, object *skill) |
Oratory skill handling. | |
static int | write_note (object *pl, object *item, const char *msg, object *skill) |
This routine allows players to inscribe messages in ordinary 'books' (anything that is type BOOK). | |
int | write_on_item (object *pl, const char *params, object *skill) |
Writing skill handling. | |
static int | write_scroll (object *pl, object *scroll, object *skill) |
This routine allows players to inscribe spell scrolls of spells which they know. |
This file contains core skill handling.
Definition in file skills.c.
static int adj_stealchance | ( | object * | op, |
object * | victim, | ||
int | roll | ||
) | [static] |
Computes stealing chance.
Increased values indicate better attempts.
op | who is stealing. |
victim | who to steal from. |
roll | dice roll. |
Definition at line 57 of file skills.c.
References ARMOUR, BOW, draw_ext_info(), FLAG_APPLIED, FLAG_SLEEP, FLAG_UNAGGRESSIVE, GLOVES, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, QUERY_FLAG, SHIELD, and WEAPON.
Referenced by attempt_steal().
static int attempt_hide | ( | object * | op, |
object * | skill | ||
) | [static] |
Someone is trying to hide.
The user becomes undetectable (not just 'invisible') for a short while (success and duration dependant on player SK_level, dexterity, charisma, and map difficulty). Players have a good chance of becoming 'unhidden' if they move and like invisiblity will be come visible if they attack Implemented by b.t. (thomas@astro.psu.edu) July 7, 1995 - made hiding possible for monsters. -b.t.
op | living trying to hide. |
skill | hiding skill. |
0 | op couldn't hide. |
1 | op successfully hide. |
Definition at line 467 of file skills.c.
References die_roll(), hideability(), PLAYER, PREFER_LOW, and stand_near_hostile().
Referenced by hide().
static int attempt_jump | ( | object * | pl, |
int | dir, | ||
int | spaces, | ||
object * | skill | ||
) | [static] |
Someone is trying to jump.
pl | living trying to jump. |
dir | direction to jump in. |
spaces | distance to jump. |
skill | jumping skill. |
Definition at line 554 of file skills.c.
References calc_skill_exp(), draw_ext_info(), draw_ext_info_format(), esrv_map_scroll(), FLAG_MONSTER, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, MOVE_FLY_LOW, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, remove_ob(), skill_attack(), and stop_jump().
Referenced by jump().
static int attempt_pick_lock | ( | object * | door, |
object * | pl, | ||
object * | skill | ||
) | [static] |
Attempt to pick a lock.
Handles traps.
door | lock to pick. |
pl | player picking. |
skill | locking skill. |
0 | no lock was picked. |
1 | door was locked. |
Definition at line 366 of file skills.c.
References die_roll(), PREFER_LOW, remove_door(), RUNE, spring_trap(), and TRAP.
Referenced by pick_lock().
static int attempt_steal | ( | object * | op, |
object * | who, | ||
object * | skill | ||
) | [static] |
Steal objects.
When stealing: dependent on the intelligence/wisdom of whom you're stealing from (op in attempt_steal), offset by your dexterity and skill at stealing. They may notice your attempt, whether successful or not.
op | target (person being pilfered). |
who | person doing the stealing. |
skill | stealing skill object. |
0 | nothing was stolen. |
1 | something was stolen. |
Definition at line 127 of file skills.c.
References adj_stealchance(), can_detect_enemy(), CLEAR_FLAG, die_roll(), draw_ext_info(), draw_ext_info_format(), EXPERIENCE, FLAG_APPLIED, FLAG_INV_LOCKED, FLAG_NO_STEAL, FLAG_STARTEQUIP, FLAG_UNAGGRESSIVE, FLAG_WAS_WIZ, FLAG_WIZ, make_visible(), MAX_BUF, MAX_STAT, MSG_TYPE_ITEM, MSG_TYPE_ITEM_REMOVE, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_STEAL, NDI_UNIQUE, Settings::no_player_stealing, npc_call_help(), pick_up(), PLAYER, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, settings, snprintf(), and SPELL.
Referenced by steal().
static int do_skill_detect_curse | ( | object * | pl, |
object * | skill | ||
) | [static] |
Check for cursed object with the 'detect curse' skill.
pl | player detecting. |
skill | detect skill object. |
Definition at line 686 of file skills.c.
References calc_skill_exp(), can_pick(), esrv_update_item(), FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_IS_CAULDRON, FLAG_KNOWN_CURSED, GET_MAP_OB, QUERY_FLAG, SET_FLAG, and UPD_FLAGS.
Referenced by skill_ident().
static int do_skill_detect_magic | ( | object * | pl, |
object * | skill | ||
) | [static] |
Check for magic object with the 'detect magic' skill.
pl | player detecting. |
skill | detect skill object. |
Definition at line 727 of file skills.c.
References calc_skill_exp(), can_pick(), esrv_update_item(), FLAG_IDENTIFIED, FLAG_KNOWN_MAGICAL, GET_MAP_OB, is_magical(), QUERY_FLAG, SET_FLAG, and UPD_FLAGS.
Referenced by skill_ident().
static int do_skill_ident | ( | object * | pl, |
int | obj_class, | ||
object * | skill | ||
) | [static] |
Workhorse for skill_ident() -b.t.
pl | player identifying. |
obj_class | type of objects to identify. |
skill | skill to give experience to. |
Definition at line 821 of file skills.c.
References can_see_monsterP(), do_skill_ident2(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, and P_OUT_OF_MAP.
Referenced by skill_ident().
static int do_skill_ident2 | ( | object * | tmp, |
object * | pl, | ||
int | obj_class, | ||
object * | skill | ||
) | [static] |
Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conveniently.
tmp | object to try to identify. |
pl | object identifying. |
obj_class | object type to identify. |
skill | identification skill. |
Definition at line 771 of file skills.c.
References calc_skill_exp(), die_roll(), draw_ext_info_format(), FLAG_IDENTIFIED, FLAG_NO_SKILL_IDENT, identify(), MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, need_identify(), ob_describe(), PLAYER, PREFER_LOW, QUERY_FLAG, rndm(), and SET_FLAG.
Referenced by do_skill_ident().
static int do_throw | ( | object * | op, |
object * | part, | ||
object * | toss_item, | ||
int | dir, | ||
object * | skill | ||
) | [static] |
Op throws any object toss_item.
This code was borrowed from fire_bow.
op | living thing throwing something. |
part | part of op throwing. |
toss_item | item thrown. |
dir | direction to throw. |
skill | throwing skill. |
0 | skill use failed. |
1 | skill was successfully used. |
Definition at line 1906 of file skills.c.
References add_string(), cast_dust(), dam_bonus, dex_bonus, draw_ext_info(), draw_ext_info_format(), EVENT_THROW, execute_event(), FLAG_IS_THROWN, FLAG_STARTEQUIP, free_string(), freearr_x, freearr_y, GET_ANIM_ID, get_map_flags(), GET_MAP_MOVE_BLOCK, get_split_ob(), insert_ob_in_map(), insert_ob_in_ob(), llevDebug, LOG(), M_CLOTH, M_GLASS, M_LEATHER, M_ORGANIC, M_PAPER, make_throw_ob(), MAX_BUF, max_carry, MAX_STAT, MIN, MOVE_FLY_LOW, MOVE_WALK, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, NUM_ANIMATIONS, ob_process(), P_OUT_OF_MAP, PLAYER, POT_DUST, POTION, QUERY_FLAG, query_name(), remove_ob(), SCRIPT_FIX_ACTIVATOR, SET_ANIMATION, set_owner(), speed_bonus, thaco_bonus, update_ob_speed(), and weight_limit.
Referenced by skill_throw().
static object* find_throw_ob | ( | object * | op, |
const char * | request | ||
) | [static] |
Find an object to throw.
If we request an object, then we search for it in the inventory of the owner (you've got to be carrying something in order to throw it!). If we didnt request an object, then the top object in inventory (that is "throwable", ie no throwing your skills away!) is the object of choice. Also check to see if object is 'throwable' (ie not applied cursed obj, worn, etc).
op | object wishing to throw. |
request | requested item to throw. |
Definition at line 1777 of file skills.c.
References AP_NO_MERGE, AP_UNAPPLY, apply_special(), draw_ext_info_format(), find_marked_object(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_INV_LOCKED, FLAG_UNPAID, llevError, LOG(), MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, QUERY_FLAG, query_name(), and WEAPON.
Referenced by skill_throw().
int find_traps | ( | object * | pl, |
object * | skill | ||
) |
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 calc_skill_exp(), draw_ext_info(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, TRAP, trap_see(), and trap_show().
Referenced by do_skill().
int hide | ( | object * | op, |
object * | skill | ||
) |
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, 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, and update_object().
Referenced by do_hidden_move(), and do_skill().
int jump | ( | object * | pl, |
int | dir, | ||
object * | skill | ||
) |
Jump skill handling.
This is both a new type of movement for player/monsters and an attack as well. Perhaps we should allow more spaces based on level, eg, level 50 jumper can jump several spaces?
pl | object jumping. |
dir | direction to jump to. |
skill | jumping skill. |
Definition at line 651 of file skills.c.
References attempt_jump(), draw_ext_info(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, and NDI_UNIQUE.
Referenced by do_skill().
static object* make_throw_ob | ( | object * | orig | ) | [static] |
We construct the 'carrier' object in which we will insert the object that is being thrown.
This combination becomes the 'thrown object'. -b.t.
orig | object to wrap. |
Definition at line 1865 of file skills.c.
References CLEAR_FLAG, copy_object(), FLAG_APPLIED, FLAG_CHANGING, get_object(), insert_ob_in_ob(), llevError, LOG(), QUERY_FLAG, and THROWN_OBJ.
Referenced by do_throw().
void meditate | ( | object * | pl, |
object * | skill | ||
) |
Meditation skill handling.
This skill allows the player to regain a few sp or hp for a brief period of concentration. The amount of time needed to concentrate and the # of points regained is dependant on the level of the user.
Depending on the level, the player can wear armour or not.
pl | livng meditating, should be a player. |
skill | meditation skill. |
Definition at line 1390 of file skills.c.
References ARMOUR, BOOTS, draw_ext_info(), FLAG_APPLIED, FLAG_READY_WEAPON, GLOVES, HELMET, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, NDI_UNIQUE, PLAYER, QUERY_FLAG, and SHIELD.
Referenced by do_skill().
int pick_lock | ( | object * | pl, |
int | dir, | ||
object * | skill | ||
) |
Lock pick handling.
Implementation by bt. (thomas@astro.psu.edu) monster implementation 7-7-95 by bt.
pl | player picking the lock. |
dir | direction to pick. |
skill | lock picking skill. |
Definition at line 400 of file skills.c.
References attempt_pick_lock(), calc_skill_exp(), DOOR, draw_ext_info(), freearr_x, freearr_y, GET_MAP_OB, LOCKED_DOOR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, and out_of_map().
Referenced by do_skill().
int pray | ( | object * | pl, |
object * | skill | ||
) |
Praying skill handling.
When this skill is called from do_skill(), it allows the player to regain lost grace points at a faster rate. -b.t.
This always returns 0 - return value is used by calling function such that if it returns true, player gets exp in that skill. This the effect here can be done on demand, we probably don't want to give infinite exp by returning true in any cases.
pl | object praying, should be a player. |
skill | praying skill. |
Definition at line 1341 of file skills.c.
References draw_ext_info(), HOLY_ALTAR, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, PLAYER, pray_at_altar(), and snprintf().
Referenced by do_skill().
int remove_trap | ( | object * | op, |
object * | skill | ||
) |
This skill will disarm any previously discovered trap.
the algorithm is based (almost totally) on the old command_disarm() - b.t.
op | player disarming. Must be on a map. |
skill | disarming skill. |
Definition at line 1272 of file skills.c.
References calc_skill_exp(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, TRAP, trap_disarm(), and trap_show().
Referenced by do_skill().
int singing | ( | object * | pl, |
int | dir, | ||
object * | skill | ||
) |
Singing skill handling.
This skill allows the player to pacify nearby creatures. There are few limitations on who/what kind of non-player creatures that may be pacified. Right now, a player may pacify creatures which have Int == 0. In this routine, once successfully pacified the creature gets Int=1. Thus, a player may only pacify a creature once. BTW, I appologize for the naming of the skill, I couldnt think of anything better! -b.t.
pl | player singing. |
dir | direction to sing in. |
skill | singing skill object. |
Definition at line 1123 of file skills.c.
References calc_skill_exp(), 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, 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, and SIZEOFFREE.
Referenced by do_skill().
int skill_ident | ( | object * | pl, |
object * | skill | ||
) |
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, WAND, and WEAPON.
Referenced by do_skill().
int skill_throw | ( | object * | op, |
object * | part, | ||
int | dir, | ||
const char * | params, | ||
object * | 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(), and PLAYER.
Referenced by do_skill().
int steal | ( | object * | op, |
int | dir, | ||
object * | skill | ||
) |
Main stealing function.
op | thief. |
dir | direction to steal from. |
skill | stealing skill. |
Definition at line 290 of file skills.c.
References attempt_steal(), calc_skill_exp(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, get_owner(), OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, and QUERY_FLAG.
Referenced by do_skill().
static void stop_jump | ( | object * | pl | ) | [static] |
End of jump.
Restore the map.
pl | player. |
Definition at line 536 of file skills.c.
References fix_object(), and insert_ob_in_map().
Referenced by attempt_jump().
int use_oratory | ( | object * | pl, |
int | dir, | ||
object * | skill | ||
) |
Oratory skill handling.
Players using this skill can 'charm' a monster -- into working for them. It can only be used on non-special (see below) 'neutral' creatures. -b.t. (thomas@astro.psu.edu)
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 add_friendly_object(), calc_skill_exp(), CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FREE_AND_COPY, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_owner(), MAX_BUF, 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, and set_owner().
Referenced by do_skill().
static int write_note | ( | object * | pl, |
object * | item, | ||
const char * | msg, | ||
object * | skill | ||
) | [static] |
This routine allows players to inscribe messages in ordinary 'books' (anything that is type BOOK).
b.t.
pl | player writing. |
item | book to write into. |
msg | message to write. |
skill | writing skill object. |
Definition at line 1451 of file skills.c.
References add_string(), BOOK, BOOK_BUF, book_overflow(), copy_object(), decrease_ob, draw_ext_info(), draw_ext_info_format(), EVENT_TRIGGER, execute_event(), free_string(), get_object(), insert_ob_in_ob(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, query_short_name(), SCRIPT_FIX_ALL, snprintf(), and strcasestr_local().
Referenced by write_on_item().
int write_on_item | ( | object * | pl, |
const char * | params, | ||
object * | skill | ||
) |
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, 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, write_note(), and write_scroll().
Referenced by do_skill(), and inscribe_scroll_cmd().
static int write_scroll | ( | object * | pl, |
object * | scroll, | ||
object * | skill | ||
) | [static] |
This routine allows players to inscribe spell scrolls of spells which they know.
Backfire effects are possible with the severity of the backlash correlated with the difficulty of the scroll that is attempted. -b.t. thomas@astro.psu.edu
pl | player writing a scroll. |
scroll | object to write into. |
skill | writing skill. |
Definition at line 1532 of file skills.c.
References Settings::allow_denied_spells_writing, calc_skill_exp(), confuse_living(), copy_object(), decrease_ob, drain_specific_stat(), draw_ext_info(), draw_ext_info_format(), EVENT_TRIGGER, execute_event(), find_random_spell_in_ob(), FLAG_CONFUSED, free_object(), get_object(), insert_ob_in_ob(), manual_apply(), MAX, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), range_magic, remove_ob(), SCROLL, settings, SP_level_spellpoint_cost(), SPELL_GRACE, and SPELL_MANA.
Referenced by write_on_item().