[CODE] Tried and failed this function...

From: Christoffer Lundberg (avatar@orion.boden.se)
Date: 11/24/98


I have tried to get a function to work. It is used when casting a spell.
You type the name of the spell. I use the spell "shield" in this example.

I want to be able to type like this:

shield self 000

The last three digits indicates <added power to duration> <added pow to effect>
and <added pow to # of targets>.

Then I added ints like this. int dur = 0, eff = 0, targ = 0;

dur += (strlen(arg2)-2);
eff += (strlen(arg2)-1);
targ += strlen(arg2);

Then, I added some message, showing how much the dur, eff, and targ became
when I casted the spell. I casted shield on myself with 000 (zero extra on
duration, effect, and targets, thus making the spell "normal"), but it
showed You shield yourself. Dur(1)  Eff(0)  Tar(3), which isn't right as
it really should show You shield yourself. Dur(0)  Eff(0)  Tar(0).

What could be wrong with the above strlen checks??

 _______________
() Christoffer  )
 | ~~~~~~~~~~~ |
 | Implementor |
 |     o f     |
 |   Legends   |
 |             |
 |  stargate.  |
 |   orion.    |
 |   boden.    |
 |  se  4000   |
 | ___________ |
()______________)


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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