82 int arch_flag, name_flag, race_flag;
107 && ((!(victim->
name && name_flag) || strcmp(op->
race, victim->
name)))
108 && ((!(victim->
race && race_flag) || strcmp(op->
race, victim->
race)))) {
118 || ((victim->
race && race_flag && !strcmp(op->
slaying, victim->
race))))) {
238 LOG(
llevError,
"apply_container: %s is not container!\n", sack ? sack->
name :
"NULL");
285 "You unlock %s with %s.",
286 "You unlock %s with %s.",
287 name_sack, name_tmp);
291 "You don't have the key to unlock %s.",
292 "You don't have the key to unlock %s.",
310 if (sack->
env != op) {
324 if (sack->
nrof > 1) {
366 if (sack->
nrof > 1) {
402 LOG(
llevError,
"BUG: do_learn_spell(): not a player\n");
409 LOG(
llevError,
"BUG: do_learn_spell(): spell already known, but not marked as startequip\n");
420 if (special_prayer) {
425 "Type 'bind cast %s to store the spell in a key.",
426 "Type 'bind cast %s to store the spell in a key.",
444 LOG(
llevError,
"BUG: do_forget_spell(): not a player\n");
448 LOG(
llevError,
"BUG: do_forget_spell(): spell not known\n");
453 "You lose knowledge of %s.",
454 "You lose knowledge of %s.",
484 buf[
sizeof(buf)-1] =
'\0';
486 if (strstr(restriction, buf) != NULL)
519 "You should pay for it first.", NULL);
564 "But you are floating high above the ground!", NULL);
577 "The object disappears in a puff of smoke!", NULL);
579 "It must have been an illusion.", NULL);
595 "I don't know how to apply the %s.",
596 "I don't know how to apply the %s.",
600 "You must get it first!\n", NULL);
639 for (floors = 0; tmp != NULL; tmp = next) {
698 LOG(
llevError,
"BUG: apply_special(): applied skill is not a chosen skill\n");
704 if (!(aflags&AP_NOPRINT))
706 "You stop using the %s.",
707 "You stop using the %s.",
710 if (!(aflags&AP_NOPRINT))
712 "You can no longer use the skill: %s.",
713 "You can no longer use the skill: %s.",
732 if (!(aflags&AP_NOPRINT))
745 if (!(aflags&AP_NOPRINT))
761 if (!(aflags&AP_NOPRINT))
771 if (!(aflags&AP_NOPRINT))
820 for (tmp = start; tmp; tmp = tmp->
below)
852 object *tmp = NULL, *last;
859 for (tmp = who->
inv; tmp; tmp = tmp->
below) {
864 if (aflags&AP_PRINT) {
879 "No matter how hard you try, you just can't remove %s.",
880 "No matter how hard you try, you just can't remove %s.",
908 if (aflags&AP_PRINT) {
923 "The %s just won't come off",
924 "The %s just won't come off",
957 object *tmp = NULL, *ws = NULL;
965 for (tmp = who->
inv; tmp && !ws; tmp = tmp->
below) {
1014 else if (tmp != tmp1) {
1083 if (((who->
level/5)+5) >= improvs)
1100 object *wc_obj = NULL;
1102 for (wc_obj = who->
inv; wc_obj; wc_obj = wc_obj->
below)
1104 && wc_obj->
level > level)
1105 level = wc_obj->
level;
1108 LOG(
llevError,
"Error: Player: %s lacks wc experience object\n", who->
name);
1114 return (improvs <= ((level/5)+5));
1141 object *tmp, *skop = NULL;
1146 LOG(
llevError,
"apply_special() from object without environment.\n");
1165 "No matter how hard you try, you just can't remove %s.",
1166 "No matter how hard you try, you just can't remove %s.",
1183 "You don't have the body to use a %s",
1184 "You don't have the body to use a %s",
1190 "You have a prohibition against using a %s",
1191 "You have a prohibition against using a %s",
1204 "You need to unapply some item(s):", NULL);
1220 "You need the %s skill to use this item!",
1221 "You need the %s skill to use this item!",
1237 "Equipping that combined with other items would consume your soul!", NULL);
1249 if ((owner != NULL) && (strcmp(owner, who->
name))) {
1253 const char *msg = NULL;
1254 int random_effect = 0;
1255 int damage_percentile = 0;
1258 item_will = atol(will);
1261 "This %s refuses to serve you - it keeps evading your hand !",
1262 "This %s refuses to serve you - it keeps evading your hand !",
1270 random_effect = (
random_roll(0, 100, who, 1)-(margin*20));
1271 if (random_effect > 80) {
1272 msg =
"You don't know why, but you have the feeling that the %s is angry at you !";
1273 damage_percentile = 60;
1274 }
else if (random_effect > 60) {
1275 msg =
"The %s seems to look at you nastily !";
1276 damage_percentile = 45;
1277 }
else if (random_effect > 40) {
1278 msg =
"You have the strange feeling that the %s is annoyed...";
1279 damage_percentile = 30;
1280 }
else if (random_effect > 20) {
1281 msg =
"The %s seems tired, or bored, in a way. Very strange !";
1282 damage_percentile = 15;
1283 }
else if (random_effect > 0) {
1284 msg =
"You hear the %s sighing !";
1285 damage_percentile = 0;
1289 msg, msg, op->
name);
1290 if (damage_percentile > 0) {
1291 int weapon_bite = (who->
stats.
hp*damage_percentile)/100;
1292 if (weapon_bite < 1)
1296 "You get a nasty bite in the hand !",
1297 "You get a nasty bite in the hand !");
1315 char *quotepos = NULL;
1321 "That weapon is too powerful for you to use. It would consume your soul!",
1329 if ((quotepos = strstr(op->
name,
"'")) != NULL) {
1330 ownerlen = (strstr(op->
name,
"'")-op->
name);
1331 if (op->
level && (strncmp(op->
name, who->
name, ownerlen))) {
1337 "The weapon does not recognize you as its owner.", NULL);
1352 "You wield %s.",
"You wield %s.",
1382 LOG(
llevError,
"BUG: apply_special(): can't apply two skills\n");
1390 if (!(aflags&AP_NOPRINT)) {
1396 "You can now use the skill: %s.",
1397 "You can now use the skill: %s.",
1401 if (!(aflags&AP_NOPRINT))
1403 "Readied skill: %s.",
1404 "Readied skill: %s.",
1416 if (!(aflags&AP_NOPRINT)) {
1418 "That item is too powerful for you to use.",
1421 "It would consume your soul!.", NULL);
1428 if (!(aflags&AP_NOPRINT)) {
1430 "The weapon does not recognize you as its owner.", NULL);
1444 if (!(aflags&AP_NOPRINT))
1452 if (!(aflags&AP_NOPRINT))
1454 "You will now fire %s with %s.",
1455 "You will now fire %s with %s.",
1475 if (!(aflags&AP_NOPRINT))
1477 "You ready your %s.",
1478 "You ready your %s.",
1506 "Oops, it feels deadly cold!", NULL);
1527 object *tmp = NULL, *tmp2;
1565 for (tmp = op->
inv; tmp; tmp = tmp2) {
1591 object *tmp, *above = NULL;
1599 for (tmp =
GET_MAP_OB(m, x, y); tmp != NULL; tmp = above) {
1603 object *invtmp, *invnext;
1605 for (invtmp = tmp->
inv; invtmp != NULL; invtmp = invnext) {
1606 invnext = invtmp->
below;
1611 while ((invtmp->
stats.
hp--) > 0)
1614 }
else if (invtmp && invtmp->
arch
1658 object *head = tmp->
head != NULL ? tmp->
head : tmp;
1709 if (abs(failure/4) > power)
1710 power = abs(failure/4);
1712 if (failure <= -1 && failure > -15) {
1716 "Your spell warps!", NULL);
1727 if (failure <= -35 && failure > -60) {
1729 "The magic recoils on you!", NULL);
1734 if (failure <= -60 && failure > -70) {
1736 "The magic recoils and paralyzes you!", NULL);
1741 if (failure <= -70 && failure > -80) {
1743 "The magic recoils on you!", NULL);
1748 if (failure <= -80) {
1754 "You unlease uncontrolled mana!", NULL);
1763 "Your mana is drained!", NULL);
1777 int excess_stat = 0;
1782 switch (change->
type) {
1787 int flag_change_face = 1;
1799 if (stat > 20+race_bonus) {
1801 stat = 20+race_bonus;
1806 for (j = 0; excess_stat > 0 && j < 100; j++) {
1814 if (stat < 20+race_bonus) {
1832 for (walk = pl->
inv; walk != NULL; walk = walk->
below)
1833 if (!strcmp(walk->
name,
"NOCLASSFACECHANGE"))
1834 flag_change_face = 0;
1836 if (flag_change_face) {
1864 if (!strcmp(change->
name,
"monk"))
#define MSG_TYPE_APPLY_PROHIBITION
#define NUM_BODY_LOCATIONS
#define INS_BELOW_ORIGINATOR
int change_skill(object *who, object *new_skill, int flag)
void legacy_apply_container(object *op, object *sack)
const char * get_ob_key_value(const object *op, const char *const key)
#define CAN_APPLY_UNAPPLY_CHOICE
object * check_spell_known(object *op, const char *name)
void esrv_send_item(object *pl, object *op)
#define MSG_TYPE_APPLY_FAILURE
void apply_changes_to_player(object *pl, object *change)
void do_forget_spell(object *op, const char *spell)
object * insert_ob_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
sint8 get_attr_value(const living *stats, int attr)
void esrv_update_item(int flags, object *pl, object *op)
struct treasureliststruct * randomitems
object * merge_ob(object *op, object *top)
void draw_ext_info(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
void esrv_send_inventory(object *pl, object *op)
object * ranges[range_size]
#define MSG_TYPE_VICTIM_WAS_HIT
void blind_living(object *op, object *hitter, int dam)
void player_apply_below(object *pl)
int should_director_abort(object *op, object *victim)
method_ret ob_apply(object *op, object *applier, int aflags)
void scroll_failure(object *op, int failure, int power)
int set_object_face_main(object *op)
void change_attr_value(living *stats, int attr, sint8 value)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
struct archt * other_arch
#define MSG_TYPE_APPLY_UNAPPLY
void esrv_add_spells(player *pl, object *spell)
#define MSG_TYPE_APPLY_BADBODY
int manual_apply(object *op, object *tmp, int aflag)
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
#define CAN_APPLY_UNAPPLY_MULT
void paralyze_living(object *op, object *hitter, int dam)
int rndm(int min, int max)
void handle_apply_yield(object *tmp)
struct obj * chosen_skill
int change_abil(object *op, object *tmp)
#define CAN_APPLY_UNAPPLY
void remove_ob(object *op)
int apply_special(object *who, object *op, int aflags)
void confuse_living(object *op, object *hitter, int dam)
#define CAN_APPLY_RESTRICTION
uint8 spell_failure_effects
object * create_archetype(const char *name)
static object * get_item_from_body_location(object *start, int loc)
void set_attr_value(living *stats, int attr, sint8 value)
void identify(object *op)
void fix_auto_apply(mapstruct *m)
#define FLAG_IS_A_TEMPLATE
struct obj * current_weapon
int can_apply_object(object *who, object *op)
EXTERN Animations * animations
int transport_can_hold(const object *transport, const object *op, int nrof)
int try_find_animation(const char *name)
void player_unready_range_ob(player *pl, object *ob)
void play_sound_map(sint8 sound_type, object *emitter, int dir, const char *action)
void cast_magic_storm(object *op, object *tmp, int lvl)
int cast_wonder(object *op, object *caster, int dir, object *spell_ob)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
static int unapply_for_ob(object *who, object *op, int aflags)
#define FLAG_BEEN_APPLIED
object * insert_ob_in_ob(object *op, object *where)
void give_initial_items(object *pl, treasurelist *items)
object * get_object(void)
void drop(object *op, object *tmp)
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
int check_weapon_power(const object *who, int improvs)
#define FLAG_READY_WEAPON
static int unapply_special(object *who, object *op, int aflags)
void animate_object(object *op, int dir)
#define FLAG_KNOWN_CURSED
#define MSG_TYPE_APPLY_CURSED
sint8 body_info[NUM_BODY_LOCATIONS]
int snprintf(char *dest, int max, const char *format,...)
sint8 body_used[NUM_BODY_LOCATIONS]
#define MSG_TYPE_APPLY_SUCCESS
int set_ob_key_value(object *op, const char *key, const char *value, int add_key)
int apply_container(object *op, object *sack)
void clear_skill(object *who)
void esrv_remove_spell(player *pl, object *spell)
#define METHOD_SILENT_ERROR
int execute_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
#define MSG_TYPE_APPLY_ERROR
int auto_apply(object *op)
void update_ob_speed(object *op)
void play_sound_player_only(player *pl, sint8 sound_type, object *emitter, int dir, const char *action)
#define GET_MAP_OB(M, X, Y)
uint8 personalized_blessings
void do_learn_spell(object *op, object *spell, int special_prayer)
void apply_anim_suffix(object *who, sstring suffix)
int player_apply(object *pl, object *op, int aflag, int quiet)
void LOG(LogLevel logLevel, const char *format,...)
object * get_split_ob(object *orig_ob, uint32 nr, char *err, size_t size)
object * find_key(object *pl, object *container, object *door)
void copy_object(object *op2, object *op)
void query_name(const object *op, char *buf, size_t size)
object * generate_treasure(treasurelist *t, int difficulty)
void free_object(object *ob)
#define IS_COMBAT_SKILL(num)
int random_roll(int min, int max, const object *op, int goodbad)
static int set_object_face_other(object *op)
void fix_object(object *op)
unsigned find_face(const char *name, unsigned error)
object * find_skill_by_name(object *who, const char *name)
#define HAS_RANDOM_ITEMS(op)
static int check_race_restrictions(object *who, object *item)