Re: [newbie] another error with weapon spells with bpl21

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 06/29/02


On Sat, Jun 29, 2002 at 07:47:52PM +0200, Peter d wrote:
>>Well, the "hit" variable was used (I think I put it in some comments in
>>the snippet) because of the way I implemented multi-hits.  I only wanted
>>the weapon to go off once per round when there was one or more
>>successful hits.
>>
>I too am using multihit for players, and multihit for mobs..
>any suggestions on how to make it happen the way you did it?
>hit = FALSE; did not work anyways..

If you do like I originally had, it was a for(i=num_hits(ch); i; i--)
loop.  Make sure the call to weapon_spell() is outside the loop.
Make sure to define hit=FALSE in the definitions, hit=TRUE only in the
section where ch does hit the victim.

>what kind of annoying problems would that be? so that i won't be surprised
>when i get them :)

The two most annoying to me were:
1: You can't just delete a spell using just that snippet code.
   You need to add some code like (It's been a while, so this may be off
   a li'l bit.):
     in case OEDIT_WEAPON_SPELLS:
        if(!(number = atoi(arg)) {
          OLC_OBJ(d)->wpn_spells[OLC_VAL(d)].spell = 0;
          OLC_OBJ(d)->wpn_spells[OLC_VAL(d)].percent = 0;
          OLC_OBJ(d)->wpn_spells[OLC_VAL(d)].level = 0;
          break;
        } else { .... rest of code }


        Now if you enter 0 for the spellnum it'll delete that spell.

2: It didn't handle 'helpful' spells like cure serious.  It took I think
2 or 3 supporting functions to handle those nice & neatly.

3: (Yeah, I know I said 2) if you have ranged combat, it's going to take
lots and lots of checking, tweaking, and twiddling to fit them in nicely
with however you implemented it.

>is it easy to implement the weapon spells into stat and identify?
piece of cake.

in stat/ident just check for obj->wpn_spells[0].spell != 0
then just a quick loop from 0 -> MAX_WPN_SPELLS until spell == 0 again,
with:
#define wsp obj->wpn_spells[counter]
        send_to_char(ch, "Casts %s at level %d, %d%% of the time.\r\n",
                spell_info[wsp.spell], wsp.level, wsp.percent);
#undef wsp


I'm still thinking of finding my last version before I rewrote combat
altogether (went to speed/initiative based combat, and handling weapon
spells became a little bit more of a nightmare.)


-me

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT