Re: [Code][Newbie] Adding some stuff in*DO*NOT*CHANGE*structs ?

From: Edward Glamkowski (EGlamkowski@MATHEMATICA-MPR.COM)
Date: 12/10/97


        This would actually not be a bad thing to add to stock code -
storing level of caster in the affected_type struct.  It doesn't have
to be used in stock, just available for those who do want to use it.
It wouldn't take any work to add, but gives the imp quite a bit more
flexibility without having to do a pwipe or write a converter ;-)

        The structs that say *DO*NOT*CHANGE* are typically warning you
that if you change the struct, it will affect the pfile, and you will
either have to write a converter or do a pwipe.  Also, you will
typically have to be careful to modify *all* the relevent structs
(typically, the one for the player in the game, and the player who is
rented out, which means making changes to db.c and elsewhere).  So it
is also a warning that changing those structs can be a lot of work, and
should not be modified lightly; and that you really have to know what
you are doing.

        But, if you aren't open to the public yet,  go ahead and change
it to store spell caster level (you can't know what you are doing until
you've actually done it, afterall ;)  You'll have to add the relevent
supporting code around that (set it in the magic.c, save it to the
player file, load it from the player file, and then do whatever else
with it you need to do - in this case check it against the level of the
player casting the dispel and make modifiers accordingly).

>----------
>From:  fabrice premel[SMTP:fabrice.premel@ETU.UTC.FR]
>Sent:  Wednesday, December 10, 1997 9:51 AM
>To:    CIRCLE@POST.QUEENSU.CA
>Subject:        [Code][Newbie] Adding some stuff
>in*DO*NOT*CHANGE*structs ?
>
>Hi list :)
>
>I wanted to implement a dispel spell, which would remove a spell (or
>several) on someone. The trick is that I wanted to have different chances
>to work depending on level of caster and level of the guy who casted the
>spell you want to cancel.
>But, I wasn't able to get where the level of COSTC (caster of spell to
>cancel :) ) is located. I even believed it is not stored (as it might not
>have appeared to be necessary). So I wandered around code, and found the
>following struct in structs.h :
>
>/* An affect structure.  Used in char_file_u *DO*NOT*CHANGE* */
>struct affected_type {
>   sh_int type;          /* The type of spell that caused this      */
>   sh_int duration;      /* For how long its effects will last      */
>   sbyte modifier;       /* This is added to apropriate ability     */
>   byte location;        /* Tells which ability to change(APPLY_XXX)*/
>   long bitvector;       /* Tells which bits to set (AFF_XXX)       */
>
>   struct affected_type *next;
>};
>
>which seems to be the struct to modify to add a int level variable in it.
>But it's written *DO*NOT*CHANGE* ...
>
>So, I think there might be another way to code a level of COSTC ? Or is it
>already in, but I missed it ? Or is it safe to modify this struct ? If so,
>what modifications should I do to rest of code to handle the modification
>?
>
>


     +------------------------------------------------------------+
     | 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/08/00 PST