[CODE] [NEWBIE] multi_hit

From: Justin Rio (c616077@showme.missouri.edu)
Date: 01/30/97


I patched in DK's apr for second and third attack skills, and I'm having
problems compiling.
The error is really quit simple, I just don't actually know what it is or
how I'm to fix it.
I included the patch as an attachment so you all can see what I've done
the stock Circle 3.0 code. Here's the error I get:
fight.c:  In function `perform_violence':
fight.c:908: `apr' undeclared (first use this function)

That's it.
Obviously, It didn't like how apr is set up.  But I don't know enuf yet to
figure out where and what I am supposed to change/add.
Any body able to point me in the right direction here?
TIA

Salvatore

diff -c stock_src/class.c src/class.c
*** stock_src/class.c	Mon Dec 16 11:51:26 1996
--- src/class.c	Mon Dec 16 12:08:12 1996
***************
*** 507,512 ****
--- 507,513 ----
    spell_level(SPELL_HARM, CLASS_CLERIC, 19);
    spell_level(SPELL_GROUP_HEAL, CLASS_CLERIC, 22);
    spell_level(SPELL_REMOVE_CURSE, CLASS_CLERIC, 26);
+   spell_level(SKILL_SECOND_ATTACK, CLASS_CLERIC, 28);
  
  
    /* THIEVES */
***************
*** 516,528 ****
--- 517,533 ----
    spell_level(SKILL_STEAL, CLASS_THIEF, 4);
    spell_level(SKILL_HIDE, CLASS_THIEF, 5);
    spell_level(SKILL_TRACK, CLASS_THIEF, 6);
+   spell_level(SKILL_SECOND_ATTACK, CLASS_THIEF, 8);
+   spell_level(SKILL_THIRD_ATTACK, CLASS_THIEF, 22);
  
  
    /* WARRIORS */
    spell_level(SKILL_KICK, CLASS_WARRIOR, 1);
    spell_level(SKILL_RESCUE, CLASS_WARRIOR, 3);
    spell_level(SKILL_TRACK, CLASS_WARRIOR, 9);
+   spell_level(SKILL_SECOND_ATTACK, CLASS_WARRIOR, 10);
    spell_level(SKILL_BASH, CLASS_WARRIOR, 12);
+   spell_level(SKILL_THIRD_ATTACK, CLASS_WARRIOR, 16);
  }
  
  
diff -c stock_src/fight.c src/fight.c
*** stock_src/fight.c	Mon Dec 16 11:51:26 1996
--- src/fight.c	Mon Dec 16 12:20:04 1996
***************
*** 850,858 ****
--- 850,860 ----
  {
    struct char_data *ch;
    extern struct index_data *mob_index;
+   int apr;
  
    for (ch = combat_list; ch; ch = next_combat_list) {
      next_combat_list = ch->next_fighting;
+     apr = 0;
  
      if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
        stop_fighting(ch);
***************
*** 876,883 ****
        continue;
      }
  
!     hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
!     if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != NULL)
!       (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
    }
  }
--- 878,914 ----
        continue;
      }
  
!     if (GET_SKILL(ch, SKILL_SECOND_ATTACK) >= number(1, 101)) {
!       if (GET_SKILL(ch, SKILL_THIRD_ATTACK) >= number(1, 201)) apr++;
!       apr++;
!     }
!     
!     // increment apr by one for every attack they are supposed to get,
!     // for the multiple attack skills, you should make sure they only
!     // get a subsequent attack if they properly got the previous one.
!     // For instance, you only get third attack if you are getting a
!     // second attack.  This doesn't need to be skill based, you can
!     // easily make it based upon class/level... see the second example
!     // below.
!     //
!     //   if (AFF_FLAGGED(ch, AFF_HASTE))
!     //     apr += number(0, 2);
!     //    
!     //   if (GET_CLASS(ch) == CLASS_WARRIOR && GET_LEVEL(ch) >= 10)
!     //     apr++;
!     //
!     // If apr is negative they get no attacks, if apr is 0 they get
!     // one attack.  APR has a range of -1 to 4, giving a minimum of
!     // no attacks, to a maximum of 4.  See the below line for changing
!     // that (eg., MAX(-1, MIN(apr, 6)) means a max of 6).
!     
!     apr = MAX(-1, MIN(apr, 4));
!  
!     if (apr >= 0) {
!       for (; apr >= 0 && FIGHTING(ch); apr--)
!         hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
!       if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != NULL)
!         (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
!     }
    }
  }
diff -c stock_src/spell_parser.c src/spell_parser.c
*** stock_src/spell_parser.c	Mon Dec 16 11:51:26 1996
--- src/spell_parser.c	Mon Dec 16 12:06:45 1996
***************
*** 127,133 ****
    "sneak",
    "steal",
    "track",			/* 140 */
!   "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 145 */
    "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 150 */
    "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 155 */
    "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 160 */
--- 127,135 ----
    "sneak",
    "steal",
    "track",			/* 140 */
!   "second attack", 
!   "third attack", 
!   "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 145 */
    "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 150 */
    "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 155 */
    "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!", "!UNUSED!",	/* 160 */
***************
*** 1022,1026 ****
--- 1024,1030 ----
    skillo(SKILL_SNEAK);
    skillo(SKILL_STEAL);
    skillo(SKILL_TRACK);
+   skillo(SKILL_SECOND_ATTACK);
+   skillo(SKILL_THIRD_ATTACK);
  }
  
diff -c stock_src/spells.h src/spells.h
*** stock_src/spells.h	Mon Dec 16 11:51:26 1996
--- src/spells.h	Mon Dec 16 11:53:50 1996
***************
*** 101,106 ****
--- 101,108 ----
  #define SKILL_SNEAK                 138 /* Reserved Skill[] DO NOT CHANGE */
  #define SKILL_STEAL                 139 /* Reserved Skill[] DO NOT CHANGE */
  #define SKILL_TRACK		    140 /* Reserved Skill[] DO NOT CHANGE */
+ #define SKILL_SECOND_ATTACK	    141 // Second attack (DAK)
+ #define SKILL_THIRD_ATTACK	    142 // Third attack (DAK)
  /* New skills may be added here up to MAX_SKILLS (200) */
  

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



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