Crossfire Server, Trunk
|
#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "book.h"
#include "living.h"
#include "object.h"
#include "skills.h"
#include "spells.h"
#include "sproto.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
Functions | |
static int | adj_stealchance (object *op, object *victim, int roll) |
static int | attempt_hide (object *op, object *skill) |
static int | attempt_jump (object *pl, int dir, int spaces, object *skill) |
static int | attempt_pick_lock (object *door, object *pl, object *skill) |
static int | attempt_steal (object *op, object *who, object *skill) |
int | detect_curse_on_item (object *pl, object *tmp, object *skill) |
int | detect_magic_on_item (object *pl, object *tmp, object *skill) |
static int | do_skill_detect_curse (object *pl, object *skill) |
static int | do_skill_detect_magic (object *pl, object *skill) |
static int | do_skill_ident (object *pl, int obj_class, object *skill) |
static int | do_throw (object *op, object *part, object *toss_item, int dir, object *skill) |
static object * | find_throw_ob (object *op, sstring race) |
int | find_traps (object *pl, object *skill) |
int | hide (object *op, object *skill) |
int | identify_object_with_skill (object *tmp, object *pl, object *skill, int print_on_success) |
int | jump (object *pl, int dir, object *skill) |
static object * | make_throw_ob (object *orig) |
void | meditate (object *pl, object *skill) |
int | pick_lock (object *pl, int dir, object *skill) |
int | pray (object *pl, object *skill) |
int | remove_trap (object *op, object *skill) |
int | singing (object *pl, int dir, object *skill) |
int | skill_ident (object *pl, object *skill) |
int | skill_throw (object *op, object *part, int dir, object *skill) |
int | steal (object *op, int dir, object *skill) |
static void | stop_jump (object *pl) |
int | use_oratory (object *pl, int dir, object *skill) |
static int | write_note (object *pl, object *item, const char *msg) |
int | write_on_item (object *pl, const char *params, object *skill) |
static int | write_scroll (object *pl, object *scroll, object *skill) |
Computes stealing chance. Increased values indicate better attempts.
op | who is stealing. |
victim | who to steal from. |
roll | dice roll. |
Definition at line 43 of file skills.c.
References ARMOUR, BODY_ARMS, BOW, draw_ext_info(), FLAG_APPLIED, FLAG_SLEEP, FLAG_UNAGGRESSIVE, FOR_INV_FINISH, FOR_INV_PREPARE, GLOVES, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, give::op, PLAYER, QUERY_FLAG, SHIELD, reputation::victim, and WEAPON.
Referenced by attempt_steal().
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. (thoma) July 7, 1995 - made hiding possible for monsters. -b.t. s@as tro.p su.e du
op | living trying to hide. |
skill | hiding skill. |
0 | op couldn't hide. |
1 | op successfully hide. |
Definition at line 463 of file skills.c.
References die_roll(), hideability(), obj::level, give::op, PLAYER, PREFER_LOW, and stand_near_hostile().
Referenced by hide().
Someone is trying to jump.
pl | living trying to jump. |
dir | direction to jump in. |
spaces | distance to jump. |
skill | jumping skill. |
Make sure we aren't in a transport. This should be set to null if we aren't.
Definition at line 555 of file skills.c.
References draw_ext_info(), draw_ext_info_format(), esrv_map_scroll(), FLAG_MONSTER, FLAG_WIZ, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, HEAD, m, MAX_BUF, MOVE_FLY_LOW, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, object_remove(), P_OUT_OF_MAP, pl::party, PLAYER, QUERY_FLAG, query_name(), skill_attack(), pl::socket, stop_jump(), Ice::tmp, pl::transport, nlohmann::detail::void(), diamondslots::x, and diamondslots::y.
Referenced by jump().
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 353 of file skills.c.
References die_roll(), obj::inv, obj::level, PREFER_LOW, remove_door(), RUNE, spring_trap(), TRAP, and obj::type.
Referenced by pick_lock().
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 111 of file skills.c.
References adj_stealchance(), buf, CLEAR_FLAG, die_roll(), draw_ext_info(), draw_ext_info_format(), FLAG_APPLIED, FLAG_INV_LOCKED, FLAG_NO_STEAL, FLAG_STARTEQUIP, FLAG_UNAGGRESSIVE, FLAG_WAS_WIZ, FLAG_WIZ, FOR_INV_FINISH, FOR_INV_PREPARE, commongive::inv, obj::level, make_visible(), MAX_BUF, Settings::max_stat, monster_can_detect_enemy(), monster_npc_call_help(), MSG_TYPE_ITEM, MSG_TYPE_ITEM_REMOVE, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_STEAL, give::name, NDI_UNIQUE, Settings::no_player_stealing, object_was_destroyed, give::op, pick_up(), PLAYER, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, settings, SPELL, Ice::tmp, and autojail::who.
Referenced by steal().
Runs a 'detect curse' check on a given item
pl | player detecting a curse. |
tmp | object to check for curse |
skill | detect skill object. |
Definition at line 701 of file skills.c.
References calc_skill_exp(), esrv_update_item(), FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_KNOWN_CURSED, obj::level, NROF(), QUERY_FLAG, SET_FLAG, Ice::tmp, and UPD_FLAGS.
Referenced by do_skill_detect_curse(), and examine().
Runs a 'detect magic' check on a given item
pl | player detecting magic. |
tmp | object to check for magic |
skill | detect skill object. |
Definition at line 750 of file skills.c.
References calc_skill_exp(), esrv_update_item(), FLAG_KNOWN_MAGICAL, is_magical(), obj::level, NROF(), QUERY_FLAG, SET_FLAG, Ice::tmp, and UPD_FLAGS.
Referenced by do_skill_detect_magic(), and examine().
Check for cursed object with the 'detect curse' skill.
pl | player detecting. |
skill | detect skill object. |
Definition at line 721 of file skills.c.
References detect_curse_on_item(), FLAG_IS_CAULDRON, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, object_can_pick(), QUERY_FLAG, and Ice::tmp.
Referenced by skill_ident().
Check for magic object with the 'detect magic' skill.
pl | player detecting. |
skill | detect skill object. |
Definition at line 770 of file skills.c.
References detect_magic_on_item(), FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, object_can_pick(), and Ice::tmp.
Referenced by skill_ident().
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 872 of file skills.c.
References can_see_monsterP(), FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), identify_object_with_skill(), obj::level, m, P_OUT_OF_MAP, Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by skill_ident().
|
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. |
Fixed logic here
The old code made you have a better factor the more encumbered past the LOAD_PCT you were. This new way essentially flips the variable to be higher at lower encumbrance.
It also only encumbers throwing once carryng more than FREE_PLAYER_LOAD_PERCENT of our capacity, since we have a MIN on load_factor when we use it, so before the limit it is clipped to 1.0.
Also ,use 2.0f since op->carrying/(get_weight_limit(op->stats.Str)*FREE_PLAYER_LOAD_PERCENT) = 1 if they are equal. As op->carrying increases, this slides higher, making the factor lower.
SilverNexus 2019-01-03
Definition at line 1985 of file skills.c.
References add_string(), cast_dust(), obj::count, liv::dam, obj::direction, draw_ext_info(), draw_ext_info_format(), EVENT_THROW, events_execute_object_event(), FLAG_IS_THROWN, FLAG_REFLECTING, FLAG_STARTEQUIP, liv::food, FREE_PLAYER_LOAD_PERCENT, free_string(), freearr_x, freearr_y, GET_ANIM_ID, get_dam_bonus(), get_dex_bonus(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_speed_bonus(), get_thaco_bonus(), get_weight_limit(), obj::inv, obj::last_sp, obj::level, llevDebug, LOG(), m, M_CLOTH, M_GLASS, M_LEATHER, M_ORGANIC, M_PAPER, obj::magic, make_throw_ob(), obj::map, obj::material, MAX_BUF, Settings::max_stat, MIN, MOVE_FLY_LOW, obj::move_on, obj::move_type, MOVE_WALK, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, give::name, obj::name, NDI_UNIQUE, NUM_ANIMATIONS, ob_process(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_owner(), object_split(), object_update_speed(), object_update_turn_face(), object_was_destroyed, give::op, P_OUT_OF_MAP, PLAYER, POT_DUST, POTION, QUERY_FLAG, query_name(), SCRIPT_FIX_ACTIVATOR, SET_FLAG, settings, obj::skill, obj::speed, obj::speed_left, obj::stats, make_face_from_files::str, obj::subtype, CFweardisguise::tag, obj::type, liv::wc, obj::weight, obj::x, and obj::y.
Referenced by skill_throw().
Find an object to throw. If there is a suitable marked item, use it. Else find the first item that is of the correct race.
op | object wishing to throw. |
race | 'throwing' race. |
Definition at line 1847 of file skills.c.
References AP_NO_MERGE, AP_UNAPPLY, apply_special(), CONTAINER, draw_ext_info_format(), find_marked_object(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_INV_LOCKED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, llevError, LOG(), MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, give::name, NDI_UNIQUE, give::op, QUERY_FLAG, query_name(), Ice::tmp, and WEAPON.
Referenced by skill_throw().
Checks for traps on the spaces around the player or in certain objects.
pl | player searching. |
skill | find trap skill object. |
Definition at line 1238 of file skills.c.
References calc_skill_exp(), draw_ext_info(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, object_get_owner(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, Ice::tmp, TRAP, trap_see(), trap_show(), obj::type, diamondslots::x, and diamondslots::y.
Referenced by do_skill().
Main hide handling.
op | living trying to hide. |
skill | hiding skill. |
Definition at line 494 of file skills.c.
References attempt_hide(), calc_skill_exp(), draw_ext_info(), FLAG_MAKE_INVIS, obj::level, make_visible(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_END, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, object_update(), give::op, PLAYER, QUERY_FLAG, and UP_OBJ_FACE.
Referenced by do_hidden_move(), and do_skill().
Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conveniently.
Identification will be attempted as many times as NROF(tmp), and tmp will be split if needed. This is to allow players to maximise experience for identification without having to resort to picking one item, moving, attempting identification of the item, and such.
See https://sourceforge.net/p/crossfire/feature-requests/244/
tmp | object to try to identify. |
pl | object identifying. |
skill | identification skill. |
print_on_success | 1 to print a description if the object is identified, 0 to leave it to the calling function |
Definition at line 808 of file skills.c.
References calc_skill_exp(), die_roll(), draw_ext_info_format(), obj::env, FLAG_NO_SKILL_IDENT, identify(), if(), INS_BELOW_ORIGINATOR, is_identified(), obj::level, obj::map, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, NROF(), ob_describe(), object_insert_in_map_at(), object_insert_in_ob(), object_merge(), object_split(), PLAYER, PREFER_LOW, QUERY_FLAG, rndm(), SET_FLAG, Ice::tmp, obj::x, and obj::y.
Referenced by do_skill_ident(), and examine().
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 664 of file skills.c.
References attempt_jump(), draw_ext_info(), make_face_from_files::int, obj::level, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, and make_face_from_files::str.
Referenced by do_skill().
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 1944 of file skills.c.
References CLEAR_FLAG, liv::dam, FLAG_APPLIED, FLAG_CHANGING, llevError, LOG(), object_copy(), object_insert_in_ob(), object_new(), QUERY_FLAG, obj::stats, THROWN_OBJ, and obj::type.
Referenced by do_throw().
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 1430 of file skills.c.
References ARMOUR, BOOTS, draw_ext_info(), FLAG_APPLIED, FLAG_READY_WEAPON, FOR_INV_FINISH, FOR_INV_PREPARE, GLOVES, HELMET, obj::level, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, NDI_UNIQUE, PLAYER, QUERY_FLAG, SHIELD, and Ice::tmp.
Referenced by do_skill().
Lock pick handling.
Implementation by bt. (thoma) monster implementation 7-7-95 by bt. s@as tro.p su.e du
pl | player picking the lock. |
dir | direction to pick. |
skill | lock picking skill. |
Definition at line 389 of file skills.c.
References attempt_pick_lock(), calc_skill_exp(), DOOR, draw_ext_info(), EVENT_TRIGGER, events_execute_object_event(), freearr_x, freearr_y, GET_MAP_OB, isqrt(), LOCKED_DOOR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, OUT_OF_REAL_MAP, SCRIPT_FIX_ALL, Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by do_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 1382 of file skills.c.
References buf, draw_ext_info(), FOR_BELOW_FINISH, FOR_BELOW_PREPARE, HOLY_ALTAR, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, PLAYER, pray_at_altar(), and Ice::tmp.
Referenced by do_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 1309 of file skills.c.
References calc_skill_exp(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, object_get_owner(), give::op, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, Ice::tmp, TRAP, trap_disarm(), trap_show(), obj::type, diamondslots::x, and diamondslots::y.
Referenced by do_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 1147 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, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, obj::level, m, MAX_BUF, MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, give::name, NDI_UNIQUE, object_value_set(), P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, SIZEOFFREE, Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by do_skill().
Main identification skill handling.
pl | player identifying. |
skill | identification skill. |
Definition at line 925 of file skills.c.
References do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), draw_ext_info(), draw_ext_info_format(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, llevError, LOG(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, obj::name, NDI_UNIQUE, OBJECT_TYPE_MAX, PLAYER, SK_DET_CURSE, SK_DET_MAGIC, and obj::subtype.
Referenced by do_skill().
Throwing skill handling.
op | object throwing. |
part | actual part of op throwing. |
dir | direction to throw into. |
skill | throwing skill. |
0 | skill use failed. |
1 | skill was successfully used. |
Definition at line 2275 of file skills.c.
References do_throw(), find_string(), find_throw_ob(), monster_find_throw_ob(), give::op, and PLAYER.
Referenced by do_skill().
Main stealing function.
op | thief. |
dir | direction to steal from. |
skill | stealing skill. |
Definition at line 277 of file skills.c.
References attempt_steal(), calc_skill_exp(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_WIZ, FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, HEAD, m, OB_TYPE_MOVE_BLOCK, object_get_owner(), give::op, P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, QUERY_FLAG, Ice::tmp, obj::type, diamondslots::x, and diamondslots::y.
Referenced by do_skill().
|
static |
End of jump. Restore the map.
pl | player. |
Definition at line 534 of file skills.c.
References check_pick(), fix_object(), and object_insert_in_map_at().
Referenced by attempt_jump().
Oratory skill handling. Players using this skill can 'charm' a monster – into working for them. It can only be used on non-special (see below) 'neutral' creatures. -b.t. (thoma) s@as tro.p su.e du
pl | player trying to convince a monster. |
dir | direction to orate in. |
skill | oratory skill object. |
Definition at line 994 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, FOR_MAP_FINISH, FOR_MAP_PREPARE, FREE_AND_COPY, freearr_x, freearr_y, get_map_flags(), HEAD, obj::level, m, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, give::name, NDI_UNIQUE, object_get_owner(), object_set_owner(), object_value_set(), P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), remove_friendly_object(), SET_FLAG, obj::skill, Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by do_skill().
Called by write_on_item() to inscribe a message in an ordinary book.
pl | Player attempting to write |
item | Book to write the message in |
msg | Message to write |
Definition at line 1487 of file skills.c.
References BOOK, BOOK_BUF, book_overflow(), buf, draw_ext_info(), draw_ext_info_format(), EVENT_TRIGGER, events_execute_object_event(), navar-midane_pickup::msg, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, obj::nrof, object_copy(), object_decrease_nrof_by_one, object_insert_in_ob(), object_new(), object_set_msg(), query_short_name(), SCRIPT_FIX_ALL, and strcasestr_local.
Referenced by write_on_item().
Implement the 'inscription' skill, which checks for the required skills and marked items before running either write_note() or write_scroll().
pl | Player attempting to write |
params | Message to write, blank to write a spell |
skill | Writing skill |
Definition at line 1760 of file skills.c.
References BOOK, archt::clone, draw_ext_info(), draw_ext_info_format(), find_marked_object(), find_skill_by_name(), FLAG_BLIND, FLAG_UNPAID, FLAG_WIZ, get_archetype_by_type_subtype(), say::item, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, roll-o-matic::params, PLAYER, QUERY_FLAG, SCROLL, SK_LITERACY, SKILL, obj::skill, write_note(), and write_scroll().
Referenced by do_skill(), and inscribe_scroll_cmd().
Called by write_on_item() to inscribe spell scrolls that the player can cast. Backfire effects are possible, varying in severity depending on the difficulty of the spell being attempted.
pl | player writing a scroll. |
scroll | object to write into. |
skill | writing skill. |
Definition at line 1576 of file skills.c.
References Settings::allow_denied_spells_writing, apply_manual(), obj::arch, calc_skill_exp(), archt::clone, confuse_living(), drain_specific_stat(), draw_ext_info(), draw_ext_info_format(), EVENT_TRIGGER, events_execute_object_event(), liv::exp, find_random_spell_in_ob(), FLAG_CONFUSED, FREE_OBJ_NO_DESTROY_CALLBACK, obj::inv, obj::level, MAX, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, give::name, obj::name, NDI_UNIQUE, obj::nrof, object_copy(), object_decrease_nrof_by_one, object_free(), object_insert_in_ob(), object_new(), object_remove(), obj::path_attuned, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), range_magic, pl::ranges, SCROLL, settings, liv::sp, SP_level_spellpoint_cost(), SPELL_GRACE, SPELL_MANA, obj::stats, Ice::tmp, obj::type, and obj::value.
Referenced by write_on_item().