(see comment)
ASPELL(spell_knowledge)
{
/* This is a real freaky spell I just thought of. What its intended
* effect is is to randomly give the knowledge of a spell (1%) at a
* random penalty. Note: These penalties should be extreme, oh and
* if the random selected spell is already know it will set it to 1%
* so its really not your average 100 time casted spell.
*/
#define NUM_PENALTIES 5
int skill = 0;
char to_char[255];
skill = number(1, NUM_SPELLS); /* Assuming NUM_SPELLS is defined as
* the number of working spells */
/* No way out of the penalty, but the reward is great enough. */
switch (number(0, NUM_PENALTIES-1)) {
case 0:
GET_EXP(ch) /= 2;
break;
case 1:
GET_MAX_HIT(ch) /= 2;
break;
case 2:
if (GET_LEVEL(ch) > 1)
GET_LEVEL(ch)--;
break;
case 3:
GET_HIT(ch) = 1;
GET_MANA(ch) = 1;
GET_MOVE(ch) = 1;
break;
case 4:
if (GET_STR(ch) > 10)
GET_STR(ch) = 10;
break;
default:
break;
}
/* Now this is the killer, do a check against magic theory skill
* just to make sure they know what they're doing.
* Magic Theory is just a do-nothing skill for which many spells
* can utilize for basic magic adeptness.
*/
if (number(1, 101) > GET_SKILL(ch, SKILL_MAGIC_THEORY)) {
send_to_char("Your feeble mind failed to gain any new knowledge.", ch);
return;
}
/* Now just set the randomly selected skill to 1 and make the
* player even happier.
*/
GET_SKILL(ch, skill) = 1;
sprintf(to_char, "You feel weaker, but stronger in the knowledge of %s.\r\n", spells[skill]);
send_to_char(to_char, ch);
act("$n keels over in an aura of pure knowledge.", FALSE,ch,0,0,TO_ROOM);
}
Faras@Morgaelin :: mud.dwango.com 3000
claywar@rjsonline.net :: 207.193.128.202 3000
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST