Re: [CODE] Objects with spells

From: JonB (
Date: 12/04/98

At 04:03 PM 12/3/98 -0600, you wrote:
>Wow I didn't realize how hard this could be.  I have been on a mud (and
>even coded on a mud, should have looked at the source for this feature
>then) that had permanent spellaffects on objects.  (A ring that gave the
>wearer permanent sanctuary, "gills" that gave the wearer waterbreathing,
>"wings" that gave the wearer flying...  you get the idea).
>I would like to keep this as simple as possible (and I already have innate
>racial affects, and an ability to get them back after a dispel) and, best
>case scenario, make it accessible through OLC.  (like the APPLY code,
>possibly even just expanding the APPLY code).
>Is there a way to make APPLY_SANCTUARY, APPLY_FLYING, APPLY_BLESS, etc.?
>This would be the absolute best way (for me) of doing this if it is

   Well, actually I believe this capability is already coded into stock
circle.  If you look at the 'struct obj_flag_data' in structs.h you will
see a 'bitvector' variable.  That is the variable you want to load with the
AFF_XXX flags.  There is already code in handler.c to add the affect to the
   The only part missing of this functionality is load the bitvector
variable with the desired affects.  If you have OLC, add the capability to
do this.  With Oasis, copy the way medit adds AFF flags to the mob.  Add to
the odet_save_to_disk() the capability to save it, then run the mud and
save all your .obj files and before you run it again, update your
parse_obj() funtion to load this variable.  If you don't have OLC you will
just have to update the parse_obj() function to support this, then change
each of your .obj files to have this variable, or make some kind of
converter.  Those are the only changes you should need to make, as the
handling is already taken care of.
   Now of course as Yaroslav said, this will only add AFF_XXX flags and not
the spell affect.  So it will not work with spells that have a modifier to
hit roll something.  It will only work for spells or affects that solely
use AFF_XXX flags.  It works great for fly and sanc, etc.
 <> <>  \      _-_,,                 /  <> <>
  \ /    \    (  //                 /    \ /
<>-*-<>   \\    _||   /'\\ \\/\\  //   <>-*-<>
  / \      >>   _||  || || || || <<      / \
 <> <>    //     ||  || || || ||  \\    <> <>
         /    -__-,  \\,/  \\ \\    \
        /                            \

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

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