Re: [Newbie] Spell Fail

From: Thomas Arp (
Date: 12/15/00

----- Original Message -----
From: "Lord Kyu" <>
>    I've gone through the code a half dozen times, looking for a certain
> line in the code, and I've been unable to find it.  It would seem, when
> someone casts a spell (magic missile for example), if the spell does
> cast, but misses, the target of the spell gets a free attack at the
> caster.  I am looking for this line which calls this effect, so I can
> alter it.  I know it's right under my nose, but I've misplaced it
> somewhere.

In spell_parser.c around line 622:

  /* You throws the dice and you takes your chances.. 101% is total failure */
  if (number(0, 101) > GET_SKILL(ch, spellnum)) {
    if (!tch || !skill_message(0, ch, tch, spellnum))
      send_to_char("You lost your concentration!\r\n", ch);
    if (mana > 0)
      GET_MANA(ch) = MAX(0, MIN(GET_MAX_MANA(ch), GET_MANA(ch) - (mana / 2)));
    if (SINFO.violent && tch && IS_NPC(tch))
      hit(tch, ch, TYPE_UNDEFINED);
  } else { /* cast spell returns 1 on success; subtract mana & set waitstate */
    if (cast_spell(ch, tch, tobj, spellnum)) {

The lines with 's are the sinners - they make a violent spell cause
the mob to strike back. Not necessarily a bad thing.

Hope this helps

Welcor of Cruelworld/Builders Academy

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 04/11/01 PDT