[CODE] [NEWBIE-ISH] Question

From: Kyle Smith (Kcsral@AOL.COM)
Date: 10/07/98


I was coding my little heart out and voila, something didn't work. I was still
trying to fix multiple attacks per round. It works fine, other than I still
have level one characters and mobs hitting twice, but the SYSLOG reports this
error:

SYSERR: Mob using '((ch)->player_specials->saved.skills{141])' at fight.c:909

My initial reaction was to add second attack and third attack to the available
mob skills. Is this correct? My other question is WHY do level one characters
and mobs have two attacks per round. I have an automatic apr-- statement to
fix my error of one attack too many, but I still get one attack to many. It is
quite strange. I am using Circle Pl 14 for those who ask, and I will include
the code snippet below with the apr stuff.

--Prisma

*fight.c*

/* control the fights going on.  Called every 2 seconds from comm.c. */
void perform_violence(void)
{
  struct char_data *ch;
  int apr;

  apr = MAX(-1, min(apr, 2));

  for (ch = combat_list; ch; ch = next_combat_list) {
    next_combat_list = ch->next_fighting;
    apr = 0;

    if (GET_SKILL(ch, SKILL_SECOND_ATTACK) >=number(1, 101)) {
       if (GET_SKILL(ch, SKILL_THIRD_ATTACK) >=number(1, 201)) apr++;
    apr--;
    }

    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, "");
     }


    if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
      stop_fighting(ch);
      continue;
    }

    if (IS_NPC(ch)) {
      if (GET_MOB_WAIT(ch) > 0) {
        GET_MOB_WAIT(ch) -= PULSE_VIOLENCE;
        continue;
      }
      GET_MOB_WAIT(ch) = 0;
      if (GET_POS(ch) < POS_FIGHTING) {
        GET_POS(ch) = POS_FIGHTING;
        act("$n scrambles to $s feet!", TRUE, ch, 0, 0, TO_ROOM);
      }
    }

    if (GET_POS(ch) < POS_FIGHTING) {
      send_to_char("You can't fight while sitting!!\r\n", ch);
      continue;
    }

    hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
    /* XXX: Need to see if they can handle "" instead of NULL. */
    if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != NULL)
      (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
  }
}


     +------------------------------------------------------------+
     | 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