[Circle] Cleric.c to check if spell affect already in place

From: Ian Stephenson (circle@gsymud.demon.co.uk)
Date: 08/08/96


Hello, I've been trying to modify the cleric.c "freebie-for-newbie" code
to check if a spell affect is already upon a character (eg: bless,
armor).  This is because the duration is cumulative, so I have
characters running around with 600 hours of armor in place.  I want a
check so the spell is cast only if the victim is not already affected.
I've applied the following to the cleric code in spec_procs.c:

    switch (number(1, GET_LEVEL(vict))) { 
        case 1: cast_spell(ch, vict, NULL, SPELL_CURE_LIGHT); break;
        case 2:
            if (!affected_by_spell(vict, SPELL_BLESS))
                cast_spell(ch, vict, NULL, SPELL_BLESS);
            break;
        .
        .
        . and so on, applying the "if (!affected_by_spell..." at every
          occurance of "armor" and "bless" in the code.

However, the "if(!affected_by_spell(vict, SPELL_BLESS))" is effectively
ignored, and the bless (or armor) spell is cast anyway.  I presume the
parameter SPELL_BLESS is incorrect, but can't work out what it should
be.

Can anyone assist?

Regards,
Ian Stephenson
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/07/00 PST