Crossfire Server, Branch 1.12  R12190
Functions
skills.c File Reference

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>
Include dependency graph for skills.c:

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.

Detailed Description

This file contains core skill handling.

Definition in file skills.c.


Function Documentation

static int adj_stealchance ( object *  op,
object *  victim,
int  roll 
) [static]

Computes stealing chance.

Increased values indicate better attempts.

Parameters:
opwho is stealing.
victimwho to steal from.
rolldice roll.
Returns:
-1 if op can't steal, else adjusted roll value.
Todo:
rename roll to something more meaningful (check attempt_steal()).

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
opliving trying to hide.
skillhiding skill.
Return values:
0op couldn't hide.
1op successfully hide.

Definition at line 467 of file skills.c.

References die_roll(), hideability(), PLAYER, PREFER_LOW, and stand_near_hostile().

Referenced by hide().

Here is the call graph for this function:

Here is the caller graph for this function:

static int attempt_jump ( object *  pl,
int  dir,
int  spaces,
object *  skill 
) [static]

Someone is trying to jump.

Parameters:
plliving trying to jump.
dirdirection to jump in.
spacesdistance to jump.
skilljumping skill.
Returns:
experience gained when jumping into another living thing.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static int attempt_pick_lock ( object *  door,
object *  pl,
object *  skill 
) [static]

Attempt to pick a lock.

Handles traps.

Parameters:
doorlock to pick.
plplayer picking.
skilllocking skill.
Return values:
0no lock was picked.
1door 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
optarget (person being pilfered).
whoperson doing the stealing.
skillstealing skill object.
Return values:
0nothing was stolen.
1something 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().

Here is the call graph for this function:

Here is the caller graph for this function:

static int do_skill_detect_curse ( object *  pl,
object *  skill 
) [static]

Check for cursed object with the 'detect curse' skill.

Parameters:
plplayer detecting.
skilldetect skill object.
Returns:
amount of experience gained (on successful detecting).

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static int do_skill_detect_magic ( object *  pl,
object *  skill 
) [static]

Check for magic object with the 'detect magic' skill.

Parameters:
plplayer detecting.
skilldetect skill object.
Returns:
amount of experience gained (on successful detecting).

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static int do_skill_ident ( object *  pl,
int  obj_class,
object *  skill 
) [static]

Workhorse for skill_ident() -b.t.

Parameters:
plplayer identifying.
obj_classtype of objects to identify.
skillskill to give experience to.
Returns:
experience gained by identifying items.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
tmpobject to try to identify.
plobject identifying.
obj_classobject type to identify.
skillidentification skill.
Returns:
experience for successful identification.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
opliving thing throwing something.
partpart of op throwing.
toss_itemitem thrown.
dirdirection to throw.
skillthrowing skill.
Return values:
0skill use failed.
1skill was successfully used.
Todo:
this messy function should probably be simplified.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters:
opobject wishing to throw.
requestrequested item to throw.
Returns:
throwable object, NULL if none suitable found.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

int find_traps ( object *  pl,
object *  skill 
)

Checks for traps on the spaces around the player or in certain objects.

Parameters:
plplayer searching.
skillfind trap skill object.
Returns:
experience gained for finding traps.

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

int hide ( object *  op,
object *  skill 
)

Main hide handling.

Parameters:
opliving trying to hide.
skillhiding skill.
Returns:
experience gained for the skill use (can be 0).

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

int jump ( object *  pl,
int  dir,
object *  skill 
)

Jump skill handling.

This is both a new type of movement for player/monsters and an attack as well. Perhaps we should allow more spaces based on level, eg, level 50 jumper can jump several spaces?

Parameters:
plobject jumping.
dirdirection to jump to.
skilljumping skill.
Returns:
experience gained for jumping.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
origobject to wrap.
Returns:
object to throw.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void meditate ( object *  pl,
object *  skill 
)

Meditation skill handling.

This skill allows the player to regain a few sp or hp for a brief period of concentration. The amount of time needed to concentrate and the # of points regained is dependant on the level of the user.

Depending on the level, the player can wear armour or not.

Author:
b.t. thomas@astro.psu.edu
Parameters:
pllivng meditating, should be a player.
skillmeditation 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
plplayer picking the lock.
dirdirection to pick.
skilllock picking skill.
Returns:
experience for picking a lock, 0 if nothing was picked.

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

int pray ( object *  pl,
object *  skill 
)

Praying skill handling.

When this skill is called from do_skill(), it allows the player to regain lost grace points at a faster rate. -b.t.

This always returns 0 - return value is used by calling function such that if it returns true, player gets exp in that skill. This the effect here can be done on demand, we probably don't want to give infinite exp by returning true in any cases.

Parameters:
plobject praying, should be a player.
skillpraying skill.
Returns:
0.

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

int remove_trap ( object *  op,
object *  skill 
)

This skill will disarm any previously discovered trap.

the algorithm is based (almost totally) on the old command_disarm() - b.t.

Parameters:
opplayer disarming. Must be on a map.
skilldisarming skill.
Returns:
experience gained to disarm.

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

int singing ( object *  pl,
int  dir,
object *  skill 
)

Singing skill handling.

This skill allows the player to pacify nearby creatures. There are few limitations on who/what kind of non-player creatures that may be pacified. Right now, a player may pacify creatures which have Int == 0. In this routine, once successfully pacified the creature gets Int=1. Thus, a player may only pacify a creature once. BTW, I appologize for the naming of the skill, I couldnt think of anything better! -b.t.

Parameters:
plplayer singing.
dirdirection to sing in.
skillsinging skill object.
Returns:
experience gained for singing.

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

int skill_ident ( object *  pl,
object *  skill 
)

Main identification skill handling.

Parameters:
plplayer identifying.
skillidentification skill.
Returns:
experience gained for identification.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

int skill_throw ( object *  op,
object *  part,
int  dir,
const char *  params,
object *  skill 
)

Throwing skill handling.

Parameters:
opobject throwing.
partactual part of op throwing.
dirdirection to throw into.
paramsoptional message, used to find object to throw.
skillthrowing skill.
Return values:
0skill use failed.
1skill 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().

Here is the call graph for this function:

Here is the caller graph for this function:

int steal ( object *  op,
int  dir,
object *  skill 
)

Main stealing function.

Parameters:
opthief.
dirdirection to steal from.
skillstealing skill.
Returns:
experience gained for stealing, 0 if nothing was stolen.

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void stop_jump ( object *  pl) [static]

End of jump.

Restore the map.

Parameters:
plplayer.
Todo:
Is fix_object() required?

Definition at line 536 of file skills.c.

References fix_object(), and insert_ob_in_map().

Referenced by attempt_jump().

Here is the call graph for this function:

Here is the caller graph for this function:

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)

Parameters:
plplayer trying to convince a monster.
dirdirection to orate in.
skilloratory skill object.
Returns:
experience gained for oratoring.
Todo:
check if can't be simplified, code looks duplicated.

Definition at line 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
plplayer writing.
itembook to write into.
msgmessage to write.
skillwriting skill object.
Returns:
experience gained for writing.
Todo:
assert() instead of simple check.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

int write_on_item ( object *  pl,
const char *  params,
object *  skill 
)

Writing skill handling.

Wrapper for write_note() and write_scroll().

Parameters:
plplayer writing.
paramsmessage to inscribe.
skillwriting skill.
Returns:
experience gained for using the 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
plplayer writing a scroll.
scrollobject to write into.
skillwriting skill.
Returns:
experience gained.

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().

Here is the call graph for this function:

Here is the caller graph for this function: