Re: Spells on objects question.

From: Patrick Dughi (
Date: 05/24/99

> My stystem works as follows.

        >snip + summary <

Creates spell affect - uses saving throw to define an object affect(?).
Sets duration to -1.

> That all works great.

> Now part 2.
        >snit + summary <

If removed object has spell, I remove that spell, then I check if any
existing objects give that effect, if so, I recreate it.

> Now to the problem.
> If I wear an item that gives me say, detect invis, then I cast detect
> invis on myself and then remove the item I can't work out how to keep
> the affect from the spell on me. Any ideas on how I can do this would be
> greatly appreciated.

        Well, I'm not sure about defining the saving throw as a way to
differentate between effects cause by an object and those caused by a
spell, but I do recommend that you look in your mag_affects function and
add something like this right before the check to see if the victim is
already affected by the spell and it has an accumulative affect (if it
does, it fails the spell):

    *  If the victim has that spell affect from an object, then make sure
    *  that the spell is treated like the above, which fails the spell.

      for (aff = victim->affected; aff && !is_innate; aff = aff->next) {
          if (spellnum == aff->type && aff->duration == -1)

      if (affected_by_spell(victim,spellnum) && is_innate) {
        send_to_char(NOEFFECT, ch);

 (don't forget to add int is_innate up at the top).


p.s. Got this from searching for 'innate' in the snippets section of - this is from my old code, though Danny Jacobs
wrote innate spells on objects code as well.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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