(no subject)

From: malcor (malcor@cyberportal.net)
Date: 08/01/96


Ok can anybody tell me why this check wouldn't work right?
in my perform violence i did this

/* control the fights going on.  Called every 2 seconds from comm.c. */
void perform_violence(void)
{
--->  int percent;
  struct char_data *ch;
  struct obj_data *wielded;
  int i;
  extern struct index_data *mob_index;

--->  percent = number(1, 101);

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

    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);
---->  if ((GET_POS(ch) == POS_FIGHTING) && (percent < GET_SKILL(ch, 
SKILL_SECOND)))
    hit(ch, FIGHTING(ch), TYPE_UNDEFINED);

---- WHEN I MAKE THIS CALL IT WILL NOT MAKE A SECOND ATTACK :( ----
---- ANY IDEAS ?? -----
---- THANKS
---- Malcor the frustrated ----

    wielded = GET_EQ(ch, WEAR_WIELD);

if(wielded){
       if (wielded->spell_affect[0].spelltype > 0){
          for (i = 0; i < MAX_SPELL_AFFECT; i++){
              if(wielded->spell_affect[i].spelltype > 0){
                /* People might want to check my dicerolls
                 * here.  Dont know if I'm doing this
                 * right :( .
                 */
                 if (dice(1,100) < (wielded->spell_affect[i].percentage)){
                     act("Your $p hums violently in your hands!", FALSE, ch,
                         wielded, 0, TO_CHAR);
                     act("$p hums violently in the hands of $n!", FALSE, ch,
                         wielded, 0, TO_ROOM);
                     call_magic(ch, FIGHTING(ch), NULL,
                     wielded->spell_affect[i].spelltype,
                     wielded->spell_affect[i].level,
                     CAST_SPELL);
                 }
              }
          }
       }
    }

    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://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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