Stock affect_modify sets the bit. What I've done is to create an actual permanent spell affect (with duration of -1) whenever you equip the object, and to remove it whenever you take it off. Same goes for the immune/res/vuln flags, it tells you when you wear the object when something happens. You don't have to guess, or code in a line that tells you your imm_flags or aff_flags, because they don't show up as spell effects. -Matt Foltz
--- Jeremy Hill <[EMAIL PROTECTED]> wrote: > *blink* isn't this slightly overkill? > > Stock OLC: > > Name: [helmet sanctuary] > Area: [ 26] Limbo > Vnum: [ 6] > Type: [trash] > Level: [ 0] > Wear flags: [take head] > Extra flags: [none] > Material: [unknown] > Condition: [ 100] > Weight: [ 0] > Cost: [ 0] > Short desc: helmet of Sanctuary > Long desc: > The all-mighty helmet of sanctuary is here, > radiating whitely-goodness. > >addapply affects none 0 sanctuary > > 0000hp 10000m 100mv> stat helmet > Name(s): helmet sanctuary > Vnum: 6 Format: new Type: trash Resets: 0 > Short description: helmet of Sanctuary > Long description: The all-mighty helmet of sanctuary > is here, radiating whitely-goodness. > Wear bits: take head > Extra bits: none > Number: 1/1 Weight: 0/0/0 (10th pounds) > Level: 0 Cost: 0 Condition: 0 Timer: 0 > In room: 0 In object: (none) Carried by: > Evangelion Wear_loc: -1 > Values: 0 0 0 0 0 > Affects none by 0, level 0. > Adds sanctuary affect. > > Non-OLC, stock: > > #6 > helmet sanctuary~ > helmet of Sanctuary~ > The all-mighty helmet of sanctuary is here, > radiating whitely-goodness.~ > unknown~ > trash 0 AE > 0 0 0 0 0 > 0 0 0 P > F > A 0 0 8 > > > (I have bitsystem. Would normally be: ..#define > AFF_SANCTUARY (H).. so > F > A 0 0 H > > unequip_char and equip_char already remove/add > object-cast spell affects, so why add more > code? > > *shrug* > > ----- Original Message ----- > From: "Matt Foltz" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, December 03, 2002 6:10 PM > Subject: Re: weapon affects > > > > I just did this in my mud. It's too bad I don't > > release any of my code to the public. What you'll > > have to do is create a new affect_modify and have > > equip_char and unequip_char point to that instead > of > > the old affect_modify. Don't point anything else > to > > it, just equip and unequip. If you do, you'll > have > > tons of problems with spells giving you permanent > > affects. So copy and paste affect_modify, add in > a > > argument for OBJ_DATA of the object you're > > equipping/removing. Example: void affect_modify( > > blah, blah, OBJ_DATA *obj, blah )... etc. Then in > the > > switch for paf->where make another switch for > > paf->bitvector and start making checks for each > > AFF_flag. > > Example: > > case AFF_SANCTUARY: > > < code copied from magic.c for sanctuary > > > case AFF_BLIND: > > < code copied from magic.c for blindness > > > (Be sure to change any "level" pointers to > > "obj->level", and the duration to -1, and any > "victim" > > to "ch" as they are all undeclared here) > > > > Then in the !fAdd part just do the opposite: > > case AFF_SANCTUARY: > > affect_strip( ch, skill_lookup( "sanctuary" ) > ); > > > > Sorry if this is sloppy or complete rambling... I > > don't do much posting :P > > -Matt Foltz > > > > --- thash jarnei <[EMAIL PROTECTED]> wrote: > > > Anyone know if a snippet (not to recreate the > wheel) > > > that will lets say you have a helmet of > santuary, > > > when worn it will put a sanctuary (spell) around > you > > > perm until you take it off? > > > > > > TJ > > > > > > > > > > > > _____________________________________________________________ > > > Get 25MB, POP3, Spam Filtering with LYCOS MAIL > PLUS > > > for $19.95/year. > > > > > > http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus > > > > > > -- > > > ROM mailing list > > > [email protected] > > > http://www.rom.org/cgi-bin/mailman/listinfo/rom > > > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > > http://mailplus.yahoo.com > > > > -- > > ROM mailing list > > [email protected] > > http://www.rom.org/cgi-bin/mailman/listinfo/rom > > > > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

