Working on adding perm affects for objects in olc

Posted by Trom on Sat 30 Oct 2004 02:32 PM — 4 posts, 21,559 views.

#0
I've checked the perm snippet and tried figuring it out in olc. I've also made a new 'paf->where' value called 'TO_D_AFFECTS', when the object is equipped if it comes across an affect with that type of where, it gets the spell number from 'paf->type' and casts the spell. Now theoritically i think it should work well and its coded.
When i load the object right after adding the affect, then wear the object it doesn't do anything.. Any ideas on how to add perm affects in olc to objects?
USA #1
Typicly, spell effects on worn items will not be displayed to the character in an obvious way - no affects list, no wear messages, nothin. About the only ways to be sure to to either stat them before and after to be sure the affect is adding properly or live testing. There may also be issues with resetting flags properly when a char has camped and come back, it's been my experience that they'll need to rewear any gear with a permspell - mostly because the char construct wasn't designed to track perm effects from items.
#2
so far i've figured out a way for it to cast the spell when the item is worn (so the actual spell is placed on the char as if it was cast by themselves). The next 2 problems i'm trying to over come is figuring out how to remove the spell which came from the item, for when they remove the item, (probably the -1 duration) and figuring out a way to save it in olc_save.c (which shouldn't be hard. Btw i'm doing this in my own codebase which came from rom/rot, its a multiclass mud so its a little different but similar to rom/rot still.
Amended on Sat 30 Oct 2004 09:01 PM by Trom
#3
I figured it out after many hours of working on it. Basically put out the plan in point form and coded it and it works quite well so far. Using only a few of the properties of an affect and specifying a different type of affect it was possible to set a special set of rules for perm spells. My codebase can now use permanant spells of infinite duration or a set amount of ticks (should be infinite but the option is open). Thanks for any and all help.