version 1.21 | | version 1.22 |
---|
| | |
/* | | /* |
* static char *rcsid_skills_c = | | * static char *rcsid_skills_c = |
* "$Id: skills.c,v 1.21 2001/10/14 07:57:15 gros Exp $"; | | * "$Id: skills.c,v 1.22 2001/10/15 21:12:08 garbled Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
&& need_identify(tmp) | | && need_identify(tmp) |
&& !tmp->invisible && tmp->type==obj_class) { | | && !tmp->invisible && tmp->type==obj_class) { |
chance = die_roll(3, 10, pl, PREFER_LOW)-3 + | | chance = die_roll(3, 10, pl, PREFER_LOW)-3 + |
RANDOM()%(tmp->magic ? tmp->magic*5 : 1); | | rndm(0, (tmp->magic ? tmp->magic*5 : 1)-1); |
if(skill_value >= chance) { | | if(skill_value >= chance) { |
identify(tmp); | | identify(tmp); |
if (pl->type==PLAYER) { | | if (pl->type==PLAYER) { |
| | |
} else { | | } else { |
/* a confused scribe gets a random spell */ | | /* a confused scribe gets a random spell */ |
do | | do |
chosen_spell=RANDOM()%NROFREALSPELLS; | | chosen_spell=rndm(0, NROFREALSPELLS-1); |
while (spells[chosen_spell].scroll_chance==0); | | while (spells[chosen_spell].scroll_chance==0); |
| | |
newScroll->level=SK_level(pl)>spells[chosen_spell].level ? | | newScroll->level=SK_level(pl)>spells[chosen_spell].level ? |