23 Feb, 2009, boblinski wrote in the 21st comment:
Votes: 0
How might I go about adding strength to my Invis Spell?
23 Feb, 2009, Skol wrote in the 22nd comment:
Votes: 0
Hm, why would an invis spell make someone stronger?
23 Feb, 2009, Hades_Kane wrote in the 23rd comment:
Votes: 0
I think he meant how would he go about adding it into his spell it being stronger.

We've modified so much of our magic system, I have difficulty sometimes remembering what I now take for granted as being "normal" in our spells or what is actually stock. But if I'm remembering stock ROM right, check in your invis spell where it is actually added to the character and where it asks for level, that is basically the strength of the spell. It's the level of the spell that generally modifies a good bit of characteristics of the spell, including duration, modifier, and things like dispelling spell affects. If you are wanting to add a randomization of the level of the spell, then you'll want to do that where the level is applied. Maybe something like:

af.level = level * (number_range(80,120) / 100);


Which will randomize the level to be as weak as 80% of the spell level to 120% of the spell level. This won't affect duration or any of the other factors, just the level for comparison purposes. You'd need to add in a randomization of the spell level in the cast function if you want it to modify the other aspects of the spell that are dependent on level. You can of course adjust the numbers as you see fit for a different range. Then, in your check for can_see, rather than using the level of the character affected by invisibility, run a loop to check the character for invisibility, and if found, have something that catches the level of the spell and compare that against the person attempting to look at the invisible character. You might also consider having it take into affect the 'detect invis' level vs. the invis level as well, if you are wanting to make seeing through invisibility not so much of a sure thing.
23 Feb, 2009, Sharmair wrote in the 24th comment:
Votes: 0
boblinski said:
How might I go about adding strength to my Invis Spell?

If this is the route you want to take, I can think of a few ways to handle it.

You could store some sort of power level (maybe like 100 for normal, but you could use
any number of value vs meaning systems) in the affect structure of the spell. Adding
a new member would allow you to use the system for any skill/spell that is added to the
character with affects. Or, in the case where the spell only sets affected_by flags, you
could add an apply type for the spell strength and use the modifier field to store the
power level. The first of these storage methods makes more sense if you are going to
use the system for many spells/skills or you don't really care about using the extra
memory for a rarely used feature. The 2nd does not add any new memory use, but is
more limited in that you can only use it with affects that add affected_by bits or you
use another affect structure just for the power level. To use this system, you would
have to look up the affect for the spell and get the power level (I think there is a function
that does that) and use that in the check you are doing for can_see. This system
would work with spells or skills that have a time but not for things like wearing
objects, racial affects etc.

You could add a new member to the char_data structure just for visibility power level.
This would probably be easier to handle, but is far more limiting in that it is only
specifically for this use (maybe that is all you want though).

In either of these cases you are conceptually having a random factor on how effective
the cast was. One effect of this is that if you have a number of lookers that are equal,
they all will either see or not see the victim. The systems I mentioned in my post
were more conceptually a saving throw and would have equal lookers individually seeing
or not seeing the victim. It really depends on exactly what you are going for as to what
system makes the best sense.
20.0/24