Re: Weapon Spells

From: Malcor (malcor@cyberportal.net)
Date: 07/10/96


At 10:02 AM 7/8/96 -0500, you wrote:
>        
>I have added the weapon spell patch and it works great, however
>I am wondering if anyone has added a feature that allows items
>to have spells such as invisibility... So, if a player was to 
>wield/wear this item, they would be invisible, and stay invisible
>during combat. (that last part not necessairly a big concern).
>
>Thanks in advance!
>
>Chuck
>
>
ASPELL(spell_improved_invisibility)
{
   struct affected_type af;

   assert((ch && obj) || victim);

   if (obj) {
      if (IS_SET(obj->obj_flags.extra_flags, ITEM_NOINVIS)) {
         send_to_char("You failed.\n\r", ch);
         return;                                          
    }

      if (!IS_SET(obj->obj_flags.extra_flags, ITEM_INVISIBLE) ) {
         act("$p turns invisible.", FALSE, ch, obj, 0, TO_CHAR);
         act("$p turns invisible.", TRUE, ch, obj, 0, TO_ROOM);
         SET_BIT(obj->obj_flags.extra_flags, ITEM_INVISIBLE);
      }
   } else {              /* Then it is a PC | NPC */
      if (!affected_by_spell(victim, SPELL_IMPRO_INVIS)) {

         act("$n slowly fades out of existence.", TRUE, victim, 0, 0, TO_ROOM);
         send_to_char("You vanish.\n\r", victim);

         af.type      = SPELL_IMPRO_INVIS;
         af.duration  = 24;
         af.modifier  = -40;
         af.location  = APPLY_AC;                         
  af.bitvector = AFF_INVISIBLE;
         affect_to_char(victim, &af);
      }
   }
}                        
Now make that the spell on the weapon for invis, the check only checks for
the SPELL_INVISIBILITY, and the spell is SPELL_IMPROVED_INVISIBILITY so
therefore it will not check it and you will stay invis :)

Malcor



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