
void tryundef( CHAR_DATA * ch, CHAR_DATA * victim, int dt )
{
    char       arg [MAX_INPUT_LENGTH];
    CHAR_DATA *vch;
    CHAR_DATA *vch_next;
    CHAR_DATA *mount;
    OBJ_DATA *obj;
    OBJ_DATA *wield;
    OBJ_DATA *wield1;
    OBJ_DATA *wield2;
    OBJ_DATA *wield3;
    OBJ_DATA *wield4;
    OBJ_DATA *wield5;
    OBJ_DATA *wield6;
    int number_hit = 0;
    int max_hit = 12;
    int dice, countup,sn;
    int dam, wieldie, wieldtype, wieldorig,maxcount;

    if (IS_NPC(ch)) return;

    dice = number_range(0,100);

//top
  wield1 = get_eq_char( ch, WEAR_WIELD );
  wield2 = get_eq_char( ch, WEAR_HOLD );
  wield3 = get_eq_char( ch, WEAR_THIRD );
  wield4 = get_eq_char( ch, WEAR_FOURTH);
  if ( wield1 != NULL && wield1->item_type == ITEM_WEAPON ) wieldorig  = 1;
  if ( wield2 != NULL && wield2->item_type == ITEM_WEAPON ) wieldorig += 2;
  if ( wield3 != NULL && wield3->item_type == ITEM_WEAPON ) wieldorig += 4;
  if ( wield4 != NULL && wield4->item_type == ITEM_WEAPON ) wieldorig += 8;
  wieldtype = wieldorig;
  wieldie = number_range(1,4);
  if ( wieldorig == 15 ) 
  { 
    if (wieldie == 2) wieldtype = 8; 
    else wieldtype = 4;
  }
  if ( wieldorig == 14 )
  {
    if (wieldie == 2) wieldtype = 8;
    else if (wieldie == 1) wieldtype = 4;
    else if (wieldie == 3) wieldtype = 2;
    else wieldtype = 1;
  }
  if ( wieldorig == 13 )
  {
    if ( wieldie == 1) wieldtype = 8;
    else if (wieldie == 2) wieldtype = 4;
    else wieldtype = 1;    
  }
  if ( wieldorig == 12 )
  {
    if ( wieldie == 1 ) wieldtype = 8;
    else wieldtype = 4;
  }
  if ( wieldorig == 11 )
  {
    if ( wieldie == 1 ) wieldtype = 8;
    if ( wieldie == 2 ) wieldtype = 2;
    else wieldtype = 1;
  }
  if ( wieldorig == 10 )
  {  
    if ( wieldie == 1 ) wieldtype = 8;
    else wieldtype = 2;    
  }
  if ( wieldorig == 9 )
  {
    if ( wieldie == 1 ) wieldtype = 8;
    else wieldtype = 1;
  }
  if ( wieldorig == 8 ) wieldtype = 8;
  if ( wieldorig == 7 )
  {
    if ( wieldie == 1 ) wieldtype = 4;
    else if ( wieldie == 2 ) wieldtype = 2;
    else wieldtype = 1;
  }
  if ( wieldorig == 6 )
  {
    if ( wieldie == 1 || wieldie == 2) wieldtype = 2;
    else wieldtype = 4;
  } 
  if ( wieldorig == 5 )
  {
    if ( wieldie == 1) wieldtype = 4;
    else wieldtype = 1;
  }
  if ( wieldorig == 4 ) wieldtype = 4;
  if ( wieldorig == 3 )    
  {
    if ( wieldie == 2 || wieldie == 4) wieldtype = 2;
    else wieldtype = 1;
  }
  if ( wieldorig == 2 ) wieldtype = 2;
  if ( wieldorig == 1 ) wieldtype = 1;

  if ( wieldtype == 8 ) wield = wield4;
  else if ( wieldtype == 4 ) wield = wield3;
  else if ( wieldtype == 2 ) wield = wield2;
  else wield = wield1;

//bottom .. Now Middle
//  if (dt >= TYPE_HIT)
  one_hit( ch, victim, dt, wieldtype );

  if ( victim == NULL || victim->position != POS_FIGHTING ) return;
  if ( ch->fighting != victim || dt == gsn_backstab
    || dt == gsn_garotte || dt == gsn_headbutt || dt == gsn_circle ) return;

  maxcount = number_attacks(ch, victim);
  if (!IS_NPC(ch))
  {
   int chance = 0;
    if (wield != NULL && wield->item_type == ITEM_WEAPON)
    {
      int tempnum = wield->value[3];
      chance = (ch->wpn[tempnum]) * 0.5;
    }
    else chance = (ch->wpn[0]) * 0.5;
    if (number_percent() <= chance) maxcount += 1;
  }
  if (wieldorig == 3) maxcount += 1;

  for (countup = 0; countup <= maxcount; countup++)
  {
    wieldtype = wieldorig;
    if ( wieldorig == 15 ) 
    { 
      if (wieldie == 2)  wieldtype = 8; 
      else wieldtype = 4;
    }
    if ( wieldorig == 14 )
    {
      if (wieldie == 2) wieldtype = 8;
      else if (wieldie == 1) wieldtype = 4;
      else if (wieldie == 3) wieldtype = 2;
      else wieldtype = 1;
    }
    if ( wieldorig == 13 )
    {
      if ( wieldie == 1) wieldtype = 8;
      else if (wieldie == 2) wieldtype = 4;
      else wieldtype = 1;    
    }
    if ( wieldorig == 12 )
    {
      if ( wieldie == 1 ) wieldtype = 8;
      else wieldtype = 4;
    }
    if ( wieldorig == 11 )
    {
      if ( wieldie == 1 ) wieldtype = 8;
      if ( wieldie == 2 ) wieldtype = 2;
      else wieldtype = 1;
    }
    if ( wieldorig == 10 )
    {
      if ( wieldie == 1 ) wieldtype = 8;
      else wieldtype = 2;
    }
    if ( wieldorig == 9 )
    {
      if ( wieldie == 1 ) wieldtype = 8;
      else wieldtype = 1;
    }
    if ( wieldorig == 7 )
    {
      if ( wieldie == 1 ) wieldtype = 4;
      else if ( wieldie == 2 ) wieldtype = 2;
      else wieldtype = 1;
    }
    if ( wieldorig == 6 )
    {
      if ( wieldie == 1 || wieldie == 2) wieldtype = 2;
      else wieldtype = 4;
    } 
    if ( wieldorig == 5 )
    {
      if ( wieldie == 1) wieldtype = 4;
      else wieldtype = 1;
    }
    if ( wieldorig == 3 )
    {
      if ( wieldie == 2 || wieldie == 4) wieldtype = 2;
      else wieldtype = 1;
    }
    one_hit( ch, victim, dt, wieldtype );

    if ( victim == NULL || victim->position != POS_FIGHTING ) return;
    if ( ch->fighting != victim ) return;
  }

  if (!IS_NPC(ch) && IS_VAMPAFF(ch,VAM_FANGS))
  {
     if (!IS_NPC(victim)) {
//       one_hit(ch,victim, (TYPE_HIT + 10),0);
//       one_hit( ch, victim, ( TYPE_HIT + 10 ), 0 );
      one_hit( ch, victim, gsn_fangs, 0 );
      one_hit( ch, victim, gsn_fangs, 0 );
     }
     else {
//       one_hit(ch,victim, (TYPE_HIT + 10),1);
//       one_hit( ch, victim, ( TYPE_HIT + 10 ), 1 );
      one_hit( ch, victim, gsn_fangs, 0 );
      one_hit( ch, victim, gsn_fangs, 0 );
     }
  }

/*
    if (dt == TYPE_UNDEFINED)
    {
        dt = TYPE_HIT;
        if (wield != NULL && wield->item_type == ITEM_WEAPON)
        {
            dt += wield->value[3];
            if (wield->value[0] >= 1)
            {
                if (wield->value[0] >= 1000)
                    sn = wield->value[0] -
                         ((wield->value[0] / 1000) *
                          1000);
                else
                    sn = wield->value[0];
                if (sn != skill_lookup("gas breath")
                        && sn != skill_lookup("desanct")
                        && sn != skill_lookup("faith armor")
                        && sn != 0)
                {
                    if (victim->position == POS_FIGHTING)
                        (*skill_table[sn].
                         spell_fun) (sn, wield->level,
                                     ch, victim);
                }
            }
        }
    }

*/
    for ( vch = ch->in_room->people; vch != NULL; vch = vch_next )
    {
        vch_next= vch->next_in_room;
        if (vch==ch)
            continue;
        if (vch->master==ch)
            continue;
        if (is_same_group (ch, vch))
            continue;
// How many you gon get?
//        if (IS_NPC(vch) && number_hit > max_hit) continue;
        if (!IS_NPC(vch)) continue;
        if ( vch->in_room == NULL )
            continue;
        if ( ch->in_room == NULL )
            continue;
        if ( !IS_NPC(vch) && vch->pcdata->chobj != NULL )
            continue;
        if ( is_safe(ch, vch)) continue;
        if ( ch == vch )
            continue;
// fighting you?
        if ( vch->fighting != ch )
            continue;

        if ( vch->in_room == ch->in_room )
        {
            if ( ( mount = ch->mount ) != NULL )
	    {
                if ( mount == vch ) continue;
            }
            if (can_see(ch,vch))
            {
// START
/*	    if (wield1 != NULL && wield1->item_type == ITEM_WEAPON)
		one_hit(ch,vch,-1,1);
	    if (wield2 != NULL && wield2->item_type == ITEM_WEAPON)
		one_hit(ch,vch,-1,2);
	    if (wield3 != NULL && wield3->item_type == ITEM_WEAPON)
		one_hit(ch,vch,-1,3);
	    if (wield4 != NULL && wield4->item_type == ITEM_WEAPON)
		one_hit(ch,vch,-1,4);
*/
            if (ch->hit < 1 || vch->hit < 1) return;

// Punches

/*
   if (wield1 == NULL) one_hit(ch,vch,-1,1);
   if (wield2 == NULL) one_hit(ch,vch,-1,2);
   if (wield3 == NULL) one_hit(ch,vch,-1,3);
   if (wield4 == NULL) one_hit(ch,vch,-1,4);
*/
        if (ch->hit < 1 || vch->hit < 1) return;
//        multi_hit(ch, vch, TYPE_UNDEFINED);

        if (ch->hit < 1 || vch->hit < 1) return;

    if (wield1 != NULL && wield1->value[3] == WPN_LONGSWORD)
	one_hit(ch, vch, gsn_longsword, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_LONGSWORD)
	one_hit(ch, vch, gsn_longsword, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_LONGSWORD)
	one_hit(ch, vch, gsn_longsword, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_LONGSWORD)
	one_hit(ch, vch, gsn_longsword, 4);

    if (wield1 != NULL && wield1->value[3] == WPN_BROADSWORD)
	one_hit(ch, vch, gsn_broadsword, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_BROADSWORD)
	one_hit(ch, vch, gsn_broadsword, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_BROADSWORD)
	one_hit(ch, vch, gsn_broadsword, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_BROADSWORD)
	one_hit(ch, vch, gsn_broadsword, 4);

    if (wield1 != NULL && wield1->value[3] == WPN_BASTARDSWORD)
	one_hit(ch, vch, gsn_bastard_sword, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_BASTARDSWORD)
	one_hit(ch, vch, gsn_bastard_sword, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_BASTARDSWORD)
	one_hit(ch, vch, gsn_bastard_sword, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_BASTARDSWORD)
	one_hit(ch, vch, gsn_bastard_sword, 4);

    if (wield1 != NULL && wield1->value[3] == WPN_KNIFE)
	one_hit(ch, vch, gsn_knife, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_KNIFE)
	one_hit(ch, vch, gsn_knife, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_KNIFE)
	one_hit(ch, vch, gsn_knife, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_KNIFE)
	one_hit(ch, vch, gsn_knife, 4);

    if (wield1 != NULL && wield1->value[3] == WPN_DAGGER)
	one_hit(ch, vch, gsn_dagger, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_DAGGER)
	one_hit(ch, vch, gsn_dagger, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_DAGGER)
	one_hit(ch, vch, gsn_dagger, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_DAGGER)
	one_hit(ch, vch, gsn_dagger, 4);

    if (wield1 != NULL && wield1->value[3] == WPN_SHORTSWORD)
	one_hit(ch, vch, gsn_shortsword, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_SHORTSWORD)
	one_hit(ch, vch, gsn_shortsword, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_SHORTSWORD)
	one_hit(ch, vch, gsn_shortsword, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_SHORTSWORD)
	one_hit(ch, vch, gsn_shortsword, 4);

    if (wield1 != NULL && wield1->value[3] == WPN_SICKLE)
	one_hit(ch, vch, gsn_sickle, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_SICKLE)
	one_hit(ch, vch, gsn_sickle, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_SICKLE)
	one_hit(ch, vch, gsn_sickle, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_SICKLE)
	one_hit(ch, vch, gsn_sickle, 4);

    if (wield1 != NULL && wield1->value[3] == WPN_WHIP)
	one_hit(ch, vch, gsn_whip, 1);
    if (wield2 != NULL && wield2->value[3] == WPN_WHIP)
	one_hit(ch, vch, gsn_whip, 2);
    if (wield3 != NULL && wield3->value[3] == WPN_WHIP)
	one_hit(ch, vch, gsn_whip, 3);
    if (wield4 != NULL && wield4->value[3] == WPN_WHIP)
	one_hit(ch, vch, gsn_whip, 4);


/*
    bool wolf_ok = FALSE;

   if (get_eq_char(ch, WEAR_HOLD) == NULL && is_ok_to_wear(ch, wolf_ok, "left_hand"))
        one_hit(ch,vch,-1,2);
   if (get_eq_char(ch, WEAR_THIRD) == NULL && is_ok_to_wear(ch, wolf_ok, "third_hand"))
        one_hit(ch,vch,-1,3);
   if (get_eq_char(ch, WEAR_FOURTH) == NULL && is_ok_to_wear(ch, wolf_ok, "fourth_hand"))
        one_hit(ch,vch,-1,4);
*/
        number_hit++;

            }
        }
    }
    return;
}
