Info on fixing pl7 spells + patch

From: Jeff (jfink@gridpoint.async.vt.edu)
Date: 04/02/95


Ok, from all the information I've received, here's the new information
that I have on spells in pl7:

bless - Did not work on objects, patch below fixes this.  As per past
versions of Circle, bless on an object has no effect other than setting
the ITEM_BLESS bit.

create water - Contrary to my previous statements, this has not been
coded.  My patch does NOT implement this spell.

create food - As mentioned before, the spell works if a food item
is put in the proper zone file.

cure blindness - When cast on players, it looks like it doesn't work
because the caster does not receive a message, but it does work.

curse - Did not work on objects, the patch fixes this.

detect poison - Not implemented.

identify - Works if object file with scrolls is fixed.

poison - Did not work on objects.  The patch fixes this.

protection from good/evil - Not implemented.  Spell itself works, but the
fight routines ignore the flags so that it doesn't work.

remove curse - Patch modifies spell so that if cast on a cursed weapon,
the damage dice size is increased by one (curse lowers it by one).  When
cast on players, the caster does not receive a message indicating if the
spell works.

remove poison - Did not work on objects.  Patch fixes.  When cast on players,
the caster does not receive a message indicating if the spell works.


And here's my patch... it only touches magic.c and spell_parser.c.  If
there are any problems with this code, please let me know.

-Jeff


diff -c ../../oldpl7/magic.c ./magic.c
*** ../../oldpl7/magic.c	Sun Apr  2 13:12:16 1995
--- ./magic.c	Sun Apr  2 15:17:38 1995
***************
*** 969,974 ****
--- 969,989 ----
      return;
  
    switch (spellnum) {
+     case SPELL_BLESS:
+       if (!IS_OBJ_STAT(obj, ITEM_BLESS) &&
+ 	  (GET_OBJ_WEIGHT(obj) <= 5 * GET_LEVEL(ch))) {
+ 	SET_BIT(GET_OBJ_EXTRA(obj), ITEM_BLESS);
+ 	to_char = "$p glows briefly.";
+       }
+       break;
+     case SPELL_CURSE:
+       if (!IS_OBJ_STAT(obj, ITEM_NODROP)) {
+ 	SET_BIT(GET_OBJ_EXTRA(obj), ITEM_NODROP);
+ 	if (GET_OBJ_TYPE(obj) == ITEM_WEAPON)
+ 	  GET_OBJ_VAL(obj, 2)--;
+ 	to_char = "$p briefly glows red.";
+       }
+       break;
      case SPELL_INVISIBLE:
        if (!IS_OBJ_STAT(obj, ITEM_NOINVIS | ITEM_INVISIBLE)) {
          SET_BIT(obj->obj_flags.extra_flags, ITEM_INVISIBLE);
***************
*** 975,984 ****
--- 990,1017 ----
          to_char = "$p turns invisible.";
        }
        break;
+     case SPELL_POISON:
+       if (((GET_OBJ_TYPE(obj) == ITEM_DRINKCON) ||
+ 	   (GET_OBJ_TYPE(obj) == ITEM_FOUNTAIN) ||
+ 	   (GET_OBJ_TYPE(obj) == ITEM_FOOD)) && !GET_OBJ_VAL(obj, 3)) {
+ 	GET_OBJ_VAL(obj, 3) = 1;
+ 	to_char = "$p steams briefly.";
+       }
+       break;
      case SPELL_REMOVE_CURSE:
        if (IS_OBJ_STAT(obj, ITEM_NODROP)) {
          REMOVE_BIT(obj->obj_flags.extra_flags, ITEM_NODROP);
+ 	if (GET_OBJ_TYPE(obj) == ITEM_WEAPON)
+ 	  GET_OBJ_VAL(obj, 2)++;
          to_char = "$p briefly glows blue.";
+       }
+       break;
+     case SPELL_REMOVE_POISON:
+       if (((GET_OBJ_TYPE(obj) == ITEM_DRINKCON) ||
+ 	   (GET_OBJ_TYPE(obj) == ITEM_FOUNTAIN) ||
+ 	   (GET_OBJ_TYPE(obj) == ITEM_FOOD)) && GET_OBJ_VAL(obj, 3)) {
+ 	GET_OBJ_VAL(obj, 3) = 0;
+ 	to_char = "$p steams briefly.";
        }
        break;
    }
diff -c ../../oldpl7/spell_parser.c ./spell_parser.c
*** ../../oldpl7/spell_parser.c	Sun Apr  2 13:12:17 1995
--- ./spell_parser.c	Sun Apr  2 15:05:39 1995
***************
*** 768,774 ****
  	 POS_FIGHTING, TAR_CHAR_ROOM, FALSE, MAG_AFFECTS);
  
    spello(SPELL_BLESS,  X,  5,  X,  X,  35,   5,  3,
! 	 POS_STANDING, TAR_CHAR_ROOM, FALSE, MAG_AFFECTS);
  
    spello(SPELL_BLINDNESS, 9, 6, X, X, 35, 25, 1,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_NOT_SELF, FALSE, MAG_AFFECTS);
--- 768,774 ----
  	 POS_FIGHTING, TAR_CHAR_ROOM, FALSE, MAG_AFFECTS);
  
    spello(SPELL_BLESS,  X,  5,  X,  X,  35,   5,  3,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV, FALSE, MAG_AFFECTS | MAG_ALTER_OBJS);
  
    spello(SPELL_BLINDNESS, 9, 6, X, X, 35, 25, 1,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_NOT_SELF, FALSE, MAG_AFFECTS);
***************
*** 812,818 ****
  	 POS_FIGHTING, TAR_CHAR_ROOM, FALSE, MAG_POINTS);
  
    spello(SPELL_CURSE, 14, X, X, X, 80, 50, 2,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV, TRUE, MAG_AFFECTS);
  
    spello(SPELL_DETECT_ALIGN, X, 4, X, X, 20, 10, 2,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_SELF_ONLY, FALSE, MAG_AFFECTS);
--- 812,818 ----
  	 POS_FIGHTING, TAR_CHAR_ROOM, FALSE, MAG_POINTS);
  
    spello(SPELL_CURSE, 14, X, X, X, 80, 50, 2,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV, TRUE, MAG_AFFECTS | MAG_ALTER_OBJS);
  
    spello(SPELL_DETECT_ALIGN, X, 4, X, X, 20, 10, 2,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_SELF_ONLY, FALSE, MAG_AFFECTS);
***************
*** 875,887 ****
  	 POS_FIGHTING, TAR_CHAR_ROOM | TAR_FIGHT_VICT, TRUE, MAG_DAMAGE);
  
    spello(SPELL_POISON, X, X, X, X, 50, 20, 3,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_NOT_SELF | TAR_OBJ_INV, TRUE, MAG_AFFECTS);
  
    spello(SPELL_PROT_FROM_EVIL, X, 8, X, X, 40, 10, 3,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_SELF_ONLY, FALSE, MAG_AFFECTS);
  
    spello(SPELL_REMOVE_CURSE, X, 26, X, X, 45, 25, 5,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV, FALSE, MAG_UNAFFECTS);
  
    spello(SPELL_SANCTUARY, X, 15, X, X, 110, 85, 5,
  	 POS_STANDING, TAR_CHAR_ROOM, FALSE, MAG_AFFECTS);
--- 875,887 ----
  	 POS_FIGHTING, TAR_CHAR_ROOM | TAR_FIGHT_VICT, TRUE, MAG_DAMAGE);
  
    spello(SPELL_POISON, X, X, X, X, 50, 20, 3,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_NOT_SELF | TAR_OBJ_INV, TRUE, MAG_AFFECTS | MAG_ALTER_OBJS);
  
    spello(SPELL_PROT_FROM_EVIL, X, 8, X, X, 40, 10, 3,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_SELF_ONLY, FALSE, MAG_AFFECTS);
  
    spello(SPELL_REMOVE_CURSE, X, 26, X, X, 45, 25, 5,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV, FALSE, MAG_UNAFFECTS | MAG_ALTER_OBJS);
  
    spello(SPELL_SANCTUARY, X, 15, X, X, 110, 85, 5,
  	 POS_STANDING, TAR_CHAR_ROOM, FALSE, MAG_AFFECTS);
***************
*** 903,909 ****
  	 POS_FIGHTING, TAR_CHAR_ROOM, FALSE, MAG_MANUAL);
  
    spello(SPELL_REMOVE_POISON, X, 10, X, X, 40, 8, 4,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV, FALSE, MAG_UNAFFECTS);
  
    spello(SPELL_SENSE_LIFE, X, X, X, X, 20, 10, 2,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_SELF_ONLY, FALSE, MAG_AFFECTS);
--- 903,909 ----
  	 POS_FIGHTING, TAR_CHAR_ROOM, FALSE, MAG_MANUAL);
  
    spello(SPELL_REMOVE_POISON, X, 10, X, X, 40, 8, 4,
! 	 POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV | TAR_OBJ_ROOM, FALSE, MAG_UNAFFECTS | MAG_ALTER_OBJS);
  
    spello(SPELL_SENSE_LIFE, X, X, X, X, 20, 10, 2,
  	 POS_STANDING, TAR_CHAR_ROOM | TAR_SELF_ONLY, FALSE, MAG_AFFECTS);



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