legend/
legend/area/
legend/player/
/**************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this Merc Diku Mud, you must comply with   *
 *  both the original Diku license in 'license.doc' as well the Merc       *
 *  license in 'license.txt'.  In particular, you may not remove either of *
 *  these copyright notices.                                               *
 *                                                                         *
 *  Much time and thought has gone into this software and you are          *
 *  benefitting.  We hope that you share your changes too.  What goes      *
 *  around, comes around.                                                  *
 ***************************************************************************/
/***************************************************************************
 *  God Wars Mud copyright (C) 1994, 1995, 1996 by Richard Woolcock        *
 *  									   *
 *  Legend of Chrystancia copyright (C) 1999, 2000, 2001 by Matthew Little *
 *  This mud is NOT to be copied in whole or in part, or to be run without *
 *  the permission of Matthew Little. Nobody else has permission to        *
 *  authorise the use of this code.                                        *
 ***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"

#define MONK_AUTODROP 11
extern bool nosafe;
NCLANS_DATA *nclans_table;

/*
 * Local functions.
 */
void autodrop args ((CHAR_DATA * ch));
bool check_dodge args ((CHAR_DATA * ch, CHAR_DATA * victim, int dt));
void check_killer args ((CHAR_DATA * ch, CHAR_DATA * victim));
bool check_parry args ((CHAR_DATA * ch, CHAR_DATA * victim, int dt));
void dam_message args ((CHAR_DATA * ch, CHAR_DATA * victim, int dam, int dt));
void death_cry args ((CHAR_DATA * ch));
void group_gain args ((CHAR_DATA * ch, CHAR_DATA * victim));
int xp_compute args ((CHAR_DATA * gch, CHAR_DATA * victim));
void set_fighting args ((CHAR_DATA * ch, CHAR_DATA * victim));
bool can_counter args ((CHAR_DATA * ch));
bool can_bypass args ((CHAR_DATA * ch, CHAR_DATA * victim));
int number_attacks args ((CHAR_DATA * ch, CHAR_DATA * victim));
int dambonus args ((CHAR_DATA * ch, CHAR_DATA * victim, int dam, int stance));
int oupdate_damcap args ((CHAR_DATA * ch, CHAR_DATA * victim));
void update_damcap args ((CHAR_DATA * ch, CHAR_DATA * victim));
int add_bonuses args ((CHAR_DATA * ch, CHAR_DATA * victim, int dam, int dt));
void rparasite args((void));

extern CHAR_DATA *quest_target;
extern CHAR_DATA *quest_mob;


/*
 * Control the fights going on.
 * Called periodically by update_handler.
 *
*/
void violence_update (void)
{
   CHAR_DATA *ch;
   CHAR_DATA *ch_next;
   CHAR_DATA *victim;
   CHAR_DATA *rch;
   CHAR_DATA *rch_next;
   CHAR_DATA *mount;
   int chance;
   int sn;
   int level;

   chance = number_percent ();

   for (ch = char_list; ch != NULL; ch = ch->next)
   {
/* testing something lets see
     if ( ch->combined_exp > 0 )
	show_combined_exp( ch );
*/

      if (chance > 60 && ch->position == POS_FIGHTING
	  && IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_SCARED))
      {
	 do_flee (ch, "");
	 stc ("You are so scared you flee from combat, COWARD!\n\r", ch);
	 return;
      }

      victim = ch->blinkykill;

      if (ch->blinkykill == NULL)
	 continue;

      if (IS_SET (ch->flag2, AFF2_BLINK_1ST_RD))
      {
	 REMOVE_BIT (ch->flag2, AFF2_BLINK_1ST_RD);
	 SET_BIT (ch->flag2, AFF2_BLINK_2ND_RD);
      }
      else if (IS_SET (ch->flag2, AFF2_BLINK_2ND_RD))
      {

	 REMOVE_BIT (ch->flag2, AFF2_BLINK_2ND_RD);
	 REMOVE_BIT (ch->flag2, AFF2_BLINK_1ST_RD);

	 if (ch->blinkykill->in_room != ch->in_room)
	 {
	    ch->blinkykill = NULL;
	    act ("$n pops back into existence.", ch, NULL, NULL, TO_ROOM);
	    stc ("You pop back into existence.\n\r", ch);
	    stc ("Your victim is no longer in the room.\n\r", ch);
	    break;
	 }

	 act ("$n pops back into existence next to $N.", ch, NULL,
	      ch->blinkykill, TO_NOTVICT);
	 act ("You pop back into existence next to $N.", ch, NULL,
	      ch->blinkykill, TO_CHAR);
	 act ("$n pops back into existence next to you.", ch, NULL,
	      ch->blinkykill, TO_VICT);
	 set_fighting (ch, ch->blinkykill);
	 if (!is_safe (ch, victim))
	 {
	    if (ch->hit > 0)
	    {
	       do_say (ch, "Muhahahahahaha");
	       ch->blinkykill = NULL;
	       multi_hit (ch, victim, gsn_blinky);
	       multi_hit (ch, victim, gsn_blinky);
	       update_pos (victim);
	    }
	 }
      }
   }

   for (ch = char_list; ch != NULL; ch = ch->next)
   {
      ch_next = ch->next;

      if (ch->fight_timer > 0 && ch->fighting == NULL && (IS_NPC(ch) || ch->pcdata->login_timer < 1))
      {
	 ch->fight_timer--;
	 if (ch->fight_timer < 1)
	 {
	    send_to_char ("Your fight timer is now clear.\n\r", ch);
	    ch->fight_timer = 0;
	 }

      }

      if (IS_SET (ch->flag2, AFF2_FROZEN))
      {
	 int break_fail = 60;

	 break_fail -= ch->spl[RED_MAGIC] / 5;

         if (IS_NPC(ch))
            break_fail -= ch->level / 5;
         if (IS_CLASS (ch, CLASS_DROW))
	    break_fail -= ch->spl[RED_MAGIC] / 10;
	 if (IS_CLASS (ch, CLASS_MAGE))
	    break_fail -= ch->spl[RED_MAGIC] / 5;
	 if (IS_CLASS (ch, CLASS_HIGHLANDER))
	    break_fail -= ch->wpn[1] / 20;

	 if (break_fail < 0)
	    break_fail = 0;
	 else
	 {
	    if ((ch->fighting))
	       break_fail /= 3;
	 }

	 if (number_range (1, 100) > break_fail)
	 {
	    send_to_char
	       ("The ice around you is so thin you flex your muscles and shatter it.\n\r",
		ch);
	    act ("The ice around $n shatters revealing one pissed off $n.",
		 ch, NULL, NULL, TO_ROOM);
	    REMOVE_BIT (ch->flag2, AFF2_FROZEN);
	    stop_fighting (ch, FALSE);
	    update_pos (ch);
	    continue;
	 }
	 else
	 {
	    send_to_char ("The ice around you melts a little bit.\n\r", ch);
	    act ("The ice around $n melts a little.", ch, NULL, NULL,
		 TO_ROOM);
	    stop_fighting (ch, FALSE);
	    update_pos (ch);
	    continue;
	 }
      }

      if (IS_SET (ch->monkstuff, MONK_DEATH))
      {
	 if (ch->hit > (ch->max_hit / 2))
	 {
	    ch->hit -= number_range (500, 1000);
	    stc ("Your writhe in agony as magical energies tear you asunder.\n\r", ch);
	    act ("$n's writhes in agony as magical forces tear apart $s body.", ch, NULL, NULL, TO_ROOM);
	 }
	 else
	 {
	    if (number_range (1, 2) == 1)
	    {
	       stc ("You feel the magical forces leave your body.\n\r", ch);
	       act ("The magical forces leave $n's body.", ch, NULL, NULL,
		    TO_ROOM);
	       REMOVE_BIT (ch->monkstuff, MONK_DEATH);
	    }
	    else
	    {
	       ch->hit -= number_range (500, 2000);
	       stc ("Your writhe in agony as magical energies tear you asunder.\n\r", ch);
	       act ("$n's writhes in agony as magical forces tear apart $s body.", ch, NULL, NULL, TO_ROOM);
	    }
	 }
      }

      if (IS_SET (ch->newbits, NEW_POWER))
      {
	 if (ch->move < 75)
	    do_spiritpower (ch, "");
	 else
	    ch->move -= 25;
      }
/*
      if (ch->chi[CURRENT] > 0)
      {
	 if (IS_CLASS (ch, CLASS_MONK)
	     && ch->move > (500 - ch->chi[CURRENT] * 40))
	    ch->move -= ch->chi[CURRENT] * 40;
	 else
	 {
	    if (ch->chi[CURRENT] > 0)
	    {
	       stc ("You feel exhausted, and lose control of your ch'i.\n\r",
		    ch);
	       ch->chi[CURRENT] -= 1;
	    }
	 }
      }
*/
      if ((victim = ch->fighting) == NULL || ch->in_room == NULL)
	 continue;


/*
      if ( ( ch->pcdata->obj_vnum != 0 ) || ( victim->pcdata->obj_vnum != 0 ) )
      {
      	stop_fighting( ch, FALSE );
		continue;
	  }
*/
      if (!IS_NPC (ch) && !IS_NPC (victim) && !is_safe (ch, victim)
	  && !is_safe (victim, ch))
      {
	 ch->fight_timer = 30;
	 victim->fight_timer = 30;
      }
      if (IS_SET (victim->flag2, AFF2_FROZEN))
      {
	 stc ("You chip away at the ice but can do little damage.\n\r", ch);
	 return;
      }

      if (IS_AWAKE (ch) && IS_AWAKE (victim)
	  && ch->in_room == victim->in_room)
      {
	 multi_hit (ch, victim, TYPE_UNDEFINED);
      }
      else
	 stop_fighting (ch, FALSE);

/*
*/

      if ((victim = ch->fighting) == NULL)
	 continue;

      if (IS_NPC (ch) || ch->spl[1] < 4)
         level = ch->level;
      else
         level = (ch->spl[1] * 0.25);

      for (rch = ch->in_room->people; rch != NULL; rch = rch_next)
      {
	 rch_next = rch->next_in_room;

         if (IS_ITEMAFF (ch, ITEMA_SOLARSHIELD) &&
             rch->position == POS_FIGHTING &&
             rch->fighting == ch)
            if ((sn = skill_lookup ("solar flare")) > 0)
               (*skill_table[sn].spell_fun) (sn, level, ch, rch);

         if (IS_AWAKE (rch) && rch->fighting == NULL)
	 {
	    if ((mount = rch->mount) != NULL)
	    {
	       if (mount == ch)
		  multi_hit (rch, victim, TYPE_UNDEFINED);
	       continue;
	    }
	    if (!IS_NPC (ch) || IS_AFFECTED (ch, AFF_CHARM))
	    {
	       if ((!IS_NPC (rch) || IS_AFFECTED (rch, AFF_CHARM))
		   && is_same_group (ch, rch))
		  multi_hit (rch, victim, TYPE_UNDEFINED);
	       continue;
	    }

	    if (IS_NPC (rch) && !IS_AFFECTED (rch, AFF_CHARM))
	    {
	       if (rch->pIndexData == ch->pIndexData || number_bits (3) == 0)
	       {
		  CHAR_DATA *vch;
		  CHAR_DATA *target;
		  int number;

		  target = NULL;
		  number = 0;
		  for (vch = ch->in_room->people; vch; vch = vch->next)
		  {
		     if (can_see (rch, vch) && is_same_group (vch, victim)
			 && number_range (0, number) == 0)
		     {
			target = vch;
			number++;
		     }
		  }

		  if (target != NULL)
		     multi_hit (rch, target, TYPE_UNDEFINED);
	       }
	    }
	 }
      }

   }

   return;
}

/*
 * Do one group of attacks.
 */
void multi_hit (CHAR_DATA * ch, CHAR_DATA * victim, int dt)
{
   OBJ_DATA *wield;
   OBJ_DATA *wield1;
   OBJ_DATA *wield2;
   OBJ_DATA *wield3;
   OBJ_DATA *wield4;
   int sn;
   int level;
   int chance;
   int unarmed;
   int wieldorig = 0;
   int wieldtype = 0;
   int maxcount;
   int countup;
   int wieldie;
   int breathindex = 0;		/*for random dragon breath attacks */

   if (ch->position < POS_SLEEPING)
      return;

   if (number_attacks (ch, victim) == 0)	// no, if you don't get to attacks you don't get to fight.
      return;

   if (dt == gsn_spiket)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }

   if (dt == gsn_magma)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }

   if (dt == gsn_shards)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }

   if (dt == gsn_venomt)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }
   if (dt == gsn_darktendrils && IS_CLASS (ch, CLASS_DROW))
   {
      one_hit (ch, victim, dt, 1);
      return;
   }
   if (dt == gsn_bodyspikes)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }
   if (dt == gsn_headbutt)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }

   if (dt == gsn_quills)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }

   if (dt == gsn_spiderform)
   {
      one_hit (ch, victim, dt, 2);
      one_hit (ch, victim, dt, 2);
      one_hit (ch, victim, dt, 4);
      one_hit (ch, victim, dt, 4);
      one_hit (ch, victim, dt, 6);
      one_hit (ch, victim, dt, 6);
      one_hit (ch, victim, dt, 8);
      one_hit (ch, victim, dt, 8);
      return;
   }

   if (dt == gsn_tail)
   {
      one_hit (ch, victim, dt, 1);
      return;
   }

   if (!IS_NPC (ch) && IS_ITEMAFF (ch, ITEMA_PEACE))
   {
      send_to_char ("You are unable to attack them.\n\r", ch);
      return;
   }

   if (!IS_NPC (victim) && IS_ITEMAFF (victim, ITEMA_PEACE))
   {
      send_to_char ("You can't seem to attack them.\n\r", ch);
      return;
   }

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return;
   }

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD))
   {
      send_to_char ("You cannot attack while in majesty.\n\r", ch);
      return;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_STEELSHIELD))
   {
      send_to_char ("They are protected by a powerful being.\n\r", ch);
      return;
   }
/*
	wield1 = get_eq_char(ch, WEAR_WIELD);
	wield2 = get_eq_char(ch, WEAR_HOLD);
	if (wield1 != NULL && wield1->item_type == ITEM_WEAPON)
		wieldorig = 1;
	if (wield2 != NULL && wield2->item_type == ITEM_WEAPON)
		wieldorig += 2;
	wieldtype = wieldorig;
*/

   wield1 = get_eq_char (ch, WEAR_WIELD);
   wield2 = get_eq_char (ch, WEAR_HOLD);
   if (wield1 == NULL && wield2 == NULL)
	wield1 = get_eq_char( ch, WEAR_DUAL);

   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;

   if (ch->stance[0] > 0 && number_percent () == 1)
   {
      int stance = ch->stance[0];

      if (ch->stance[stance] >= 200)
      {
	 special_move (ch, victim);
	 return;
      }
   }

   if (IS_CREATOR (ch) || IS_CLASS (ch, CLASS_MONK))
   {
      if (!IS_NPC (ch))
      {
	 unarmed = number_range (1, 7);
	 if (!IS_NPC (ch) && ch->cmbt[unarmed] != 0)
	 {
	    fightaction (ch, victim, ch->cmbt[unarmed], dt, wieldtype);
	 }
      }
   }

   unarmed = 0;
   one_hit (ch, victim, dt, wieldtype);
   if (victim == NULL || victim->position != POS_FIGHTING)
      return;

   // Check for Highlander empowerment - Krynn
   if (IS_CLASS (ch, CLASS_HIGHLANDER) && (ch->hempower > 0))
   {
      int mult = 1;
      int x;

      if ((ch->quickening[1] >= 25) && (number_range (1, 100) > 10))
	 mult++;
      if ((ch->quickening[1] >= 50) && (number_range (1, 100) > 30))
	 mult++;
      if ((ch->quickening[1] >= 75) && (number_range (1, 100) > 60))
	 mult++;
      if ((ch->quickening[1] >= 100) && (number_range (1, 100) > 90))
	 mult++;

      if (IS_DEMPOWER (ch, HPOWER_USE_BYPASS) && (mult > 1))
         mult += 1;
      if (IS_DEMPOWER (ch, HPOWER_USE_SHIELDLESS) && (mult > 1))
         mult += 1;

      for (x = 0; x == mult; x++)
	 one_hit (ch, victim, dt, wieldtype);
   }

   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 != 0 && victim->position == POS_FIGHTING)
	       (*skill_table[sn].spell_fun) (sn, wield->level, ch, victim);
	 }
      }
   }

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

   if (ch->fighting != victim || dt == gsn_backstab || dt == gsn_headbutt
       || dt == gsn_bodyspikes)
      return;

   if (!IS_NPC (victim) && !IS_SET (victim->special, SPC_WOLFMAN)
       && number_percent () <= victim->pcdata->learned[gsn_fastdraw])
   {
      OBJ_DATA *obj;
      int wpntype = 0;
      int wpntype2 = 0;

      if ((obj = get_eq_char (victim, WEAR_SCABBARD_R)) != NULL)
      {
	 wpntype = obj->value[3];
	 if (wpntype < 0 || wpntype > 12)
	    wpntype = 0;
	 if ((obj = get_eq_char (victim, WEAR_WIELD)) != NULL)
	 {
	    obj_from_char (obj);
	    obj_to_char (obj, victim);
//	    obj_to_room (obj, victim->in_room);
	    act ("You hurl $p aside.", victim, obj, NULL, TO_CHAR);
	    act ("$n hurls $p aside.", victim, obj, NULL, TO_ROOM);
	 }
	 do_draw (victim, "right");
      }
      if ((obj = get_eq_char (victim, WEAR_SCABBARD_L)) != NULL)
      {
	 wpntype2 = obj->value[3];
	 if (wpntype2 < 0 || wpntype2 > 12)
	    wpntype2 = 0;
	 if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
	 {
	    obj_from_char (obj);
	    obj_to_char (obj, victim);
	    act ("You hurl $p aside.", victim, obj, NULL, TO_CHAR);
	    act ("$n hurls $p aside.", victim, obj, NULL, TO_ROOM);
	 }
	 do_draw (victim, "left");
      }
      if (wpntype > 0)
	 one_hit (victim, ch, TYPE_UNDEFINED, 1);
      if (victim == NULL || victim->position != POS_FIGHTING)
	 return;
      if (wpntype2 > 0)
	 one_hit (victim, ch, TYPE_UNDEFINED, 2);
      if (victim == NULL || victim->position != POS_FIGHTING)
	 return;
   }

   maxcount = number_attacks (ch, victim);
   if (maxcount == 0)
      return;

   if (!IS_NPC (ch))
   {
      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 (IS_CLASS (ch, CLASS_FAE) && IS_EXTRA2 (ch, EXTRA2_FAESPEED))
      maxcount += 3;
   if (wieldorig == 3)
      maxcount += 1;
   for (countup = 0; countup <= maxcount; countup++)
   {
      wieldtype = wieldorig;
      if (wieldorig == 3)
      {
	 if (number_range (1, 2) == 2)
	    wieldtype = 2;
	 else
	    wieldtype = 1;
      }
      one_hit (ch, victim, -1, wieldtype);
      if (victim == NULL || victim->position != POS_FIGHTING)
	 return;
      if (ch->fighting != victim)
	 return;
   }

   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_VAMPIRE)
       && IS_VAMPAFF (ch, VAM_FANGS) && number_range (1, 2) == 1)
      vam_bite (ch, victim, (TYPE_HIT + 10), 0);
   if (!IS_NPC (ch) && !IS_CLASS (ch, CLASS_VAMPIRE)
       && IS_VAMPAFF (ch, VAM_FANGS))
      one_hit (ch, victim, (TYPE_HIT + 10), 0);

   if (victim == NULL || victim->position != POS_FIGHTING)
      return;
   if (!IS_NPC (ch))
   {
      if (IS_CLASS (ch, CLASS_DROW) && IS_POLYAFF (ch, POLY_ZULO))
      {
	 act ("You spit webbing at $N.", ch, NULL, victim, TO_CHAR);
	 act ("$n spits webbing at $N.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n spits webbing at you.", ch, NULL, victim, TO_VICT);
	 if (number_range (1, 10) == 10
	     && !IS_SET (victim->affected_by, AFF_WEBBED))
	 {
	    act ("$N is coated in a sticky webbing.", ch, NULL, victim,
		 TO_CHAR);
	    act ("$N is coated in a sticky webbing.", ch, NULL, victim,
		 TO_NOTVICT);
	    act ("You are coated in a sticky webbing.", ch, NULL, victim,
		 TO_VICT);
	    SET_BIT (victim->affected_by, AFF_WEBBED);
	 }
      }
      if ( IS_CLASS( ch, CLASS_DROW ) && ( IS_SET( ch->extra2, DROW_DARKTENDRILS ) ) )
	{
	 multi_hit (ch, victim, gsn_darktendrils);
	}
      if (IS_CLASS (ch, CLASS_DROW)
	  && IS_SET (ch->pcdata->powers[1], DPOWER_ARMS))
      {
	 int ii;
	 if (IS_POLYAFF (ch, POLY_SPIDERFORM))
	 {
	    for (ii = 0; ii < 8; ii++)
	    {
	       if (number_range (1, 4) == 1)
	       {
		  one_hit (ch, victim, gsn_spiderform, 0);

	       }
	    }
	 }
	 else
	 {
	    for (ii = 0; ii < 4; ii++)
	    {
	       if (number_range (1, 3) == 1)
	       {
		  one_hit (ch, victim, gsn_spiderform, 0);
	       }
	    }
	 }
      }
  if ( IS_CLASS(ch, CLASS_WRAITH) && ( ch->arcanoi[WPAND] == 5 ) &&
         number_range(1,2) == 1 )       one_hit( ch, victim, gsn_phenom, 0 );
  if ( IS_CLASS(ch, CLASS_WRAITH) && ( ch->arcanoi[WMATE] >= 3 ) &&
         number_range(1,2) == 1 )       one_hit(ch, victim, gsn_buffet, 0);
      if ((IS_CLASS (ch, CLASS_WEREWOLF) && ch->gifts[BLACKFURIES] > 2)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_waspt, 0);
      if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_SPIKETAIL)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_spiket, 0);
      if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_SHARDS)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_shards, 0);
      if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_MAGMA)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_magma, 0);
      if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_VENOMTONG)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_venomt, 0);
      if (IS_DEMAFF (ch, DEM_HORNS)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_headbutt, 0);
      if (IS_VAMPAFF (ch, VAM_HORNS)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_headbutt, 0);
      if (IS_CLASS (ch, CLASS_DEMON) && IS_DEMAFF (ch, DEM_BODYSPIKES)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_bodyspikes, 0);
      if (IS_CLASS (ch, CLASS_NINJA)
	  && ch->pcdata->powers[NPOWER_NINGENNO] > 3
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_shiroken, 0);
      if (IS_CLASS (ch, CLASS_NINJA) && ch->pcdata->powers[NPOWER_TENGU] > 1
	  && number_range (1, 2) == 1)
	 one_hit (ch, victim, gsn_dart_shiroken, 0);

      else if (IS_CLASS (ch, CLASS_NINJA)
	       && ch->pcdata->powers[NPOWER_TENGU] > 2
	       && number_range (1, 2) == 1)
      {
	 one_hit (ch, victim, gsn_dart_shiroken, 0);
	 one_hit (ch, victim, gsn_dart_shiroken, 0);
      }
      if (IS_CLASS (ch, CLASS_DEMON) && IS_DEMAFF (ch, DEM_TAIL)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_tail, 0);
      if (IS_SET (ch->newbits, NEW_QUILLS))
	 one_hit (ch, victim, gsn_quills, 0);

      if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_WINGS)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_buffet, 0);
      if (IS_CLASS (ch, CLASS_VAMPIRE) && IS_VAMPAFF (ch, VAM_WINGS)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_buffet, 0);
      if (IS_CLASS (ch, CLASS_VAMPIRE) && IS_VAMPAFF (ch, VAM_TAIL)
	  && number_range (1, 3) == 1)
	 one_hit (ch, victim, gsn_tail, 0);
      if (IS_CLASS (ch, CLASS_DRAGON)
	  && IS_SET (ch->pcdata->dragonaff, DRA_TAIL))
	 one_hit (ch, victim, gsn_sweep, 0);
      if (IS_CLASS (ch, CLASS_DRAGON)
	  && IS_SET (ch->pcdata->dragonaff, DRA_WINGS))
	 one_hit (ch, victim, gsn_buffet, 0);
      if (IS_CLASS (ch, CLASS_DRAGON)
	  && IS_SET (ch->pcdata->dragonaff, DRA_FANGS)
	  && (number_range (1, 3) == 1
	      || IS_SET (ch->pcdata->dragonaff, DRA_LUCK)))
	 one_hit (ch, victim, gsn_fangs, 0);

   }
   if (victim == NULL || victim->position != POS_FIGHTING)
      return;
/*
    if (!IS_NPC(ch))
    {   
        int x;
        int acid = 0;
                         
        for( x = 0; x < 5 && ch->pcdata->breath[x] != NULL ; x++)
        {
        if (IS_CLASS(ch, CLASS_DRAGON) && !str_cmp(ch->pcdata->breath[x], "frost")
         && ( (number_range(1,3) == 1) || IS_SET(ch->pcdata->dragonaff, DRA_LUCK))) 
                spell_frost_breath(skill_lookup( "frost breath" ),GET_AGE(ch) * 10, ch, victim); 
        if (IS_CLASS(ch, CLASS_DRAGON) && !str_cmp(ch->pcdata->breath[x], "fire")
         && ( (number_range(1,3) == 1) || IS_SET(ch->pcdata->dragonaff, DRA_LUCK))) 
                spell_fire_breath(skill_lookup( "fire breath" ),GET_AGE(ch) * 10, ch, victim);    
        if (IS_CLASS(ch, CLASS_DRAGON) && !str_cmp(ch->pcdata->breath[x], "lightning")
         && ( (number_range(1,3) == 1) || IS_SET(ch->pcdata->dragonaff, DRA_LUCK))) 
              spell_lightning_breath(skill_lookup( "lightning breath" ),GET_AGE(ch) * 10, ch, victim );
        if (IS_CLASS(ch, CLASS_DRAGON) && !str_cmp(ch->pcdata->breath[x], "acid") && acid < 3
         && ( (number_range(1,3) == 1) || IS_SET(ch->pcdata->dragonaff, DRA_LUCK))) {
               spell_acid_breath(skill_lookup( "acid breath" ),GET_AGE(ch) * 10, ch, victim );
                acid += 1; }       
        if (IS_CLASS(ch, CLASS_DRAGON) && !str_cmp(ch->pcdata->breath[x], "gas")
         && ( (number_range(1,3) == 1) || IS_SET(ch->pcdata->dragonaff, DRA_LUCK))) 
              spell_gas_breath(skill_lookup( "gas breath" ),GET_AGE(ch) * 10, ch, victim );
        }

    }
*/
   if (IS_CLASS (ch, CLASS_DRAGON) && !IS_NPC (ch))
   {
      if (ch->in_room == NULL)
	 return;
      if (victim->in_room == NULL)
	 return;

      /*Breath 1 */

      if (ch->pcdata->breath[0] == NULL)
	 return;

      breathindex = (number_range (1, 50));

      if (IS_SET (ch->pcdata->dragonaff, DRA_LUCK))
	 breathindex += 10;

      if (!str_cmp (ch->pcdata->breath[0], "frost") && (breathindex >= 40))
	 spell_frost_breath (skill_lookup ("frost breath"),
                             GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[0], "fire") && (breathindex >= 40))
	 spell_fire_breath (skill_lookup ("fire breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[0], "lightning")
	  && (breathindex >= 40))
	 spell_lightning_breath (skill_lookup ("lightning breath"),
                                 GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[0], "acid") && (breathindex >= 45))
	 spell_acid_breath (skill_lookup ("acid breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[0], "gas") && (breathindex >= 35))
	 spell_gas_breath (skill_lookup ("gas breath"),
                           GET_AGE(ch) * 5, ch, victim);

/*Breath 2*/

      if (ch->pcdata->breath[1] == NULL)
	 return;

      breathindex = (number_range (1, 50));

      if (IS_SET (ch->pcdata->dragonaff, DRA_LUCK))
	 breathindex += 10;

      if (!str_cmp (ch->pcdata->breath[1], "frost") && (breathindex >= 40))
	 spell_frost_breath (skill_lookup ("frost breath"),
                             GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[1], "fire") && (breathindex >= 40))
	 spell_fire_breath (skill_lookup ("fire breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[1], "lightning")
	  && (breathindex >= 40))
	 spell_lightning_breath (skill_lookup ("lightning breath"),
                                 GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[1], "acid") && (breathindex >= 45))
	 spell_acid_breath (skill_lookup ("acid breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[1], "gas") && (breathindex >= 35))
	 spell_gas_breath (skill_lookup ("gas breath"),
                           GET_AGE(ch) * 5, ch, victim);

      /*Breath 3 */

      if (ch->pcdata->breath[2] == NULL)
	 return;

      breathindex = (number_range (1, 50));

      if (IS_SET (ch->pcdata->dragonaff, DRA_LUCK))
	 breathindex += 10;

      if (!str_cmp (ch->pcdata->breath[2], "frost") && (breathindex >= 40))
	 spell_frost_breath (skill_lookup ("frost breath"),
                             GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[2], "fire") && (breathindex >= 40))
	 spell_fire_breath (skill_lookup ("fire breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[2], "lightning")
	  && (breathindex >= 40))
	 spell_lightning_breath (skill_lookup ("lightning breath"),
                                 GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[2], "acid") && (breathindex >= 45))
	 spell_acid_breath (skill_lookup ("acid breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[2], "gas") && (breathindex >= 35))
	 spell_gas_breath (skill_lookup ("gas breath"),
                           GET_AGE(ch) * 5, ch, victim);

/* Breath 4*/

      if (ch->pcdata->breath[3] == NULL)
	 return;

      breathindex = (number_range (1, 50));

      if (IS_SET (ch->pcdata->dragonaff, DRA_LUCK))
	 breathindex += 10;

      if (!str_cmp (ch->pcdata->breath[3], "frost") && (breathindex >= 40))
	 spell_frost_breath (skill_lookup ("frost breath"),
                             GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[3], "fire") && (breathindex >= 40))
	 spell_fire_breath (skill_lookup ("fire breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[3], "lightning")
	  && (breathindex >= 40))
	 spell_lightning_breath (skill_lookup ("lightning breath"),
                                 GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[3], "acid") && (breathindex >= 45))
	 spell_acid_breath (skill_lookup ("acid breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[3], "gas") && (breathindex >= 35))
	 spell_gas_breath (skill_lookup ("gas breath"),
                           GET_AGE(ch) * 5, ch, victim);

      /*Breath 5 */

      if (ch->pcdata->breath[4] == NULL)
	 return;

      breathindex = (number_range (1, 50));

      if (IS_SET (ch->pcdata->dragonaff, DRA_LUCK))
	 breathindex += 10;

      if (!str_cmp (ch->pcdata->breath[4], "frost") && (breathindex >= 40))
	 spell_frost_breath (skill_lookup ("frost breath"),
                             GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[4], "fire") && (breathindex >= 40))
	 spell_fire_breath (skill_lookup ("fire breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[4], "lightning")
	  && (breathindex >= 40))
	 spell_lightning_breath (skill_lookup ("lightning breath"),
                                 GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[4], "acid") && (breathindex >= 45))
	 spell_acid_breath (skill_lookup ("acid breath"),
                            GET_AGE(ch) * 5, ch, victim);

      if (!str_cmp (ch->pcdata->breath[4], "gas") && (breathindex >= 35))
	 spell_gas_breath (skill_lookup ("gas breath"),
                           GET_AGE(ch) * 5, ch, victim);

   }

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

   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_VAMPIRE)
       && IS_VAMPAFF (ch, VAM_SERPENTIS))
      spell_poison (gsn_poison, (ch->level * number_range (5, 10)), ch,
		    victim);
   else if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_WEREWOLF)
	    && ch->pcdata->powers[WPOWER_SPIDER] > 0)
      spell_poison (gsn_poison, (ch->level * number_range (5, 10)), ch,
		    victim);
   else if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_NINJA)
	    && ch->pcdata->powers[NPOWER_NINGENNO] > 4)
      spell_poison (gsn_poison, (ch->level * number_range (5, 10)), ch,
		    victim);

   if (victim->itemaffect < 1)
      return;
   if (IS_NPC (victim) || victim->spl[1] < 4)
      level = victim->level;
   else
      level = (victim->spl[1] * 0.25);
   if (IS_SET (victim->newbits, NEW_MONKFLAME)
       && !IS_AFFECTED (ch, AFF_FLAMING)
       && !WORN_ARTIFACT (ch, ARTI_DEMONS_HEART))
   {
      if (number_percent () > 65)
      {
	 SET_BIT (ch->affected_by, AFF_FLAMING);
         if (!IS_NPC(victim) && !IS_VAMPAFF (victim, VAM_CLAWS))
	 {
	    act ("Your flaming hands catch $n on fire!", ch, NULL, victim,
		 TO_VICT);
	    act ("$N's flaming hands catch $n on fire!", ch, NULL, victim,
		 TO_NOTVICT);
	    act ("$N's flaming hands catch you on fire!.", ch, NULL, victim,
		 TO_CHAR);
	 }
	 else
	 {
	    act ("Your flaming claws catch $n on fire!", ch, NULL, victim,
		 TO_VICT);
	    act ("$N's flaming claws catch $n on fire!", ch, NULL, victim,
		 TO_NOTVICT);
	    act ("$N's flaming claws catch you on fire!.", ch, NULL, victim,
		 TO_CHAR);
	 }
      }
      else
      {
	 return;
      }
   }
   if (IS_ITEMAFF (victim, ITEMA_SHOCKSHIELD) && ch->position == POS_FIGHTING)
      if ((sn = skill_lookup ("lightning bolt")) > 0)
	 (*skill_table[sn].spell_fun) (sn, level, victim, ch);
   if (IS_ITEMAFF (victim, ITEMA_FIRESHIELD) && ch->position == POS_FIGHTING)
      if ((sn = skill_lookup ("fireball")) > 0)
	 (*skill_table[sn].spell_fun) (sn, level, victim, ch);
   if (IS_ITEMAFF (victim, ITEMA_ICESHIELD) && ch->position == POS_FIGHTING)
      if ((sn = skill_lookup ("chill touch")) > 0)
	 (*skill_table[sn].spell_fun) (sn, level, victim, ch);
   if (IS_ITEMAFF (victim, ITEMA_ACIDSHIELD) && ch->position == POS_FIGHTING)
      if ((sn = skill_lookup ("acid blast")) > 0)
	 (*skill_table[sn].spell_fun) (sn, level, victim, ch);
   if (IS_ITEMAFF (victim, ITEMA_CHAOSSHIELD) && ch->position == POS_FIGHTING)
      if ((sn = skill_lookup ("chaos blast")) > 0)
	 (*skill_table[sn].spell_fun) (sn, level, victim, ch);

   return;
}

int number_attacks( CHAR_DATA *ch, CHAR_DATA *victim )
{
  int percentage = 100;

  if ( IS_NPC( ch ) )
  {
    if ( ch->level >=   50 ) percentage += 100;
    if ( ch->level >=  100 ) percentage += 100;
    if ( ch->level >=  500 ) percentage += 100;
    if ( ch->level >= 1000 ) percentage += 100;
    if ( ch->level >= 1500 ) percentage += 100;
    if ( ch->level >= 2000 ) percentage += 200;

    if ( IS_NPC( victim ) )  percentage += 200;

#ifdef FUCK_PLAYERS
    percentage += 5000;
#endif

    return percentage / 100;
  }

  percentage += 250;
  if ( !IS_NPC( victim ) )
  {
    percentage += ( ch->lstatus * 75 );
    percentage -= ( victim->lstatus * 35 );

    if ( ch->lstatus > victim->lstatus )
      percentage += 75;
    else if ( ch->lstatus < victim->lstatus )
      percentage -= 75;
  }
  else
    percentage += ( ch->lstatus * 125 );

  if ( ch->move > 50000 )
    percentage += ( ch->move - 50000 ) / 100;

  if ( !IS_STANCE( ch, STANCE_MONKEY ) )
  {
    if ( IS_STANCE( ch, STANCE_VIPER ) )
      percentage += 100;
    else if ( IS_STANCE( ch, STANCE_MANTIS ) )
      percentage += 200;
    else if ( IS_STANCE( ch, STANCE_TIGER ) )
      percentage += 300;
  }

  if ( IS_ITEMAFF( ch, ITEMA_SPEED ) )
  {
    if ( ( ( ch->move / ch->max_move ) * 100 ) > 50 )
      percentage += 150;
    else
      percentage +=  75;
  }

  if ( IS_SUPER_NPC( ch ) )
  {
    percentage += 100;
    if ( number_range( 0, 4 ) == 0 ) percentage += 200;
  }

  if ( IS_CLASS( ch, CLASS_HIGHLANDER ) )
  {
    if ( IS_DEMPOWER( ch, HPOWER_SPEED ) )
      percentage += 125;

    if ( IS_ITEMAFF( ch, ITEMA_SPEED ) )
      percentage += number_range( 25, 75 );

    percentage = ( percentage * 3 ) / 5;
  }
  else if ( IS_CLASS( ch, CLASS_DROW ) )
  {
    if ( IS_SET( ch->special, SPC_DROW_WAR ) )
      percentage += 100;
    else if ( IS_SET( ch->special, SPC_DROW_ASN) )
      percentage += 25;
    else
      percentage -= 25;

    if ( ch->pcdata->stats[UNI_GEN] < 3 )
      percentage += 40;

    if ( IS_SET( ch->pcdata->powers[1], DPOWER_SPEED ) )
      percentage += 85;
  }
  else if ( IS_CLASS( ch, CLASS_FAE ) )
  {
    if ( IS_SET( ch->extra2, EXTRA2_FAESPEED ) )
      percentage += 125;

    percentage *= 1.1;
  }
  else if ( IS_CLASS( ch, CLASS_DRAGON ) )
  {
    percentage += 15 + ( 10 * GET_AGE( ch ) );
  }
  else if ( IS_CLASS( ch, CLASS_WRAITH ) )
  {
    percentage += 150 + ( percentage / 100 );    
  }
  else if ( IS_CLASS( ch, CLASS_MAGE ) )
  {
    percentage += ( ch->max_mana / 175 );
    
    percentage *= 1.15;
  }
  else if ( IS_CLASS( ch, CLASS_NINJA ) )
  {
    if ( ch->pcdata->powers[NPOWER_CHIKYU] >= 3 )
      percentage += 250;
  }
  else if ( IS_CLASS( ch, CLASS_VAMPIRE ) )
  {
    percentage += 100 * ( get_disc( ch, VAM_CELE ) / 2 );
  }
  else if ( IS_CLASS( ch, CLASS_WEREWOLF ) )
  {
    percentage += 40 * ch->gifts[SILENTSTRIDERS];
  }
  else if ( IS_CLASS( ch, CLASS_DEMON ) )
  {
    if ( IS_DEMPOWER( ch, DEM_SPEED ) )
       percentage += 100;

    if ( IS_SET( ch->warp, WARP_QUICKNESS ) )
       percentage += 100;
  }
  else if ( IS_CLASS( ch, CLASS_MONK ) )
  {
    percentage += 35 * ( ch->monkab[COMBAT] + 1 );
  }
  else
    percentage += 100;

  if ( !IS_CLASS( ch, CLASS_HIGHLANDER ) )
  {
    percentage = ( percentage / 3 ) * 2.2;

    if ( IS_CLASS( ch, CLASS_WEREWOLF ) )
      percentage *= 0.85;
  }

  if ( IS_CLASS( ch, CLASS_MAGE ) )
    percentage *= 0.87;

  return percentage / 100;
}

/*
 * Hit one guy once.
 */
void one_hit (CHAR_DATA * ch, CHAR_DATA * victim, int dt, int handtype)
{
   OBJ_DATA *wield;
   OBJ_DATA *gloves;
   int victim_ac;
   int thac0;
   int thac0_00;
   int thac0_32;
   int dam;
   int diceroll;
   int wdam;
   int level;
   int bufz;
    bool        dual_wield      = FALSE;
   bool right_hand;
   char buf[MSL];

   /*
    * Can't beat a dead char!
    * Guard against weird room-leavings.
    */
   if (victim->position == POS_DEAD || ch->in_room != victim->in_room)
      return;

   if (!IS_NPC (ch) && IS_ITEMAFF (ch, ITEMA_PEACE))
   {
      send_to_char ("You are unable to attack them.\n\r", ch);
      return;
   }

   if (!IS_NPC (victim) && IS_ITEMAFF (victim, ITEMA_PEACE))
   {
      send_to_char ("You can't seem to attack them.\n\r", ch);
      return;
   }

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return;
   }

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD))
   {
      send_to_char ("You cannot attack while in Majesty.\n\r", ch);
      return;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_STEELSHIELD))
   {
      send_to_char ("There are far to imposing.\n\r", ch);
      return;
   }

   /*
    * Figure out the type of damage message.
    */
/*
   if (handtype == 8)
   {
      wield = get_eq_char (ch, WEAR_FOURTH);
      right_hand = FALSE;
   }
   else if (handtype == 4)
   {
      wield = get_eq_char (ch, WEAR_THIRD);
      right_hand = FALSE;
   }
   else if (handtype == 2)
   {
      wield = get_eq_char (ch, WEAR_HOLD);
      right_hand = FALSE;
   }
   else
   {
      if (!IS_NPC (ch) && (wield = get_eq_char (ch, WEAR_DUAL)) != NULL);
      else if (!IS_NPC (ch) && IS_SET (ch->extra2, PLR_RIGHTHAND))
	 wield = get_eq_char (ch, WEAR_WIELD);
      else if (!IS_NPC (ch) && IS_SET (ch->act, PLR_LEFTHAND))
	 wield = get_eq_char (ch, WEAR_HOLD);
      else
      {
	 if (number_range (1, 10) > 4 && !IS_NPC (ch))
	    wield = get_eq_char (ch, WEAR_HOLD);
	 else
	    wield = get_eq_char (ch, WEAR_WIELD);
      }
      right_hand = 1;		// improve the right hand anyway...
   }
*/
    /*
     * Figure out the type of damage message.
     */
    if (handtype == 2)
    {
        wield = get_eq_char( ch, WEAR_HOLD );
        right_hand = FALSE;
    }
    else
    {
        wield = get_eq_char( ch, WEAR_WIELD );
        right_hand = TRUE;
    }

    if (wield == NULL)
    {
        wield = get_eq_char( ch, WEAR_DUAL);
        right_hand = TRUE;
        if ((wield != NULL) && (wield->item_type == ITEM_WEAPON))
                dual_wield = TRUE;
    }

   if (dt == TYPE_UNDEFINED)
   {
      dt = TYPE_HIT;
      if (wield != NULL && wield->item_type == ITEM_WEAPON)
	 dt += wield->value[3];
   }

   if (ch->wpn[dt - 1000] > 5)
      level = (ch->wpn[dt - 1000] / 5);
   else
      level = 1;
   if (level > 40)
      level = 40;

   /*
    * Calculate to-hit-armor-class-0 versus armor.
    */
   if (IS_NPC (ch))
   {
      thac0_00 = 20;
      thac0_32 = 0;
   }
   else
   {
      thac0_00 = SKILL_THAC0_00;
      thac0_32 = SKILL_THAC0_32;
   }
   thac0 = 0 - interpolate (level, thac0_00, thac0_32) - (char_hitroll (ch) / 10);
   victim_ac = UMIN (10, char_ac (victim) / 50);
   if (!can_see (ch, victim))
      victim_ac -= 100;

   if (IS_CLASS (ch, CLASS_DRAGON) && IS_SET (ch->pcdata->dragonaff, DRA_TERROR) && IS_NPC (victim))	/*dragons */
   {				/*dragons */
      victim_ac += 200;		/*dragons */
   }				/*dragons */
   /*
    * The moment of excitement!
    */
   while ((diceroll = number_bits (5)) >= 20)
      ;


#ifdef FUCK_PLAYERS
   while (diceroll == 0 || (diceroll != 19 && diceroll < thac0 - victim_ac))
   {
      while ((diceroll = number_bits (5)) >= 20);
   }
#endif
   if (diceroll == 0 || (diceroll != 19 && diceroll < thac0 - victim_ac))
   {
      /* Miss. */
      damage (ch, victim, 0, dt);
      tail_chain ();
      if (!is_safe (ch, victim))
      {
	 improve_wpn (ch, dt, right_hand);
	 improve_stance (ch);
      }
      return;
   }

   /*
    * Hit.
    * Calc damage.
    */

   if (IS_NPC (ch))
   {
      dam = number_range (ch->level, ch->level * 3 / 2);
      if (wield != NULL)
	 dam += dam * 0.5;

#ifdef FUCK_PLAYERS
      dam = dice (1, 30) * 1000;
#endif
   }

   else
   {

      if (IS_SET(ch->more, MORE_LIONSMANE))
         dam = number_range (500, 750);
      else if (IS_CLASS (ch, CLASS_DRAGON) && (wield == NULL || wield->item_type != ITEM_WEAPON))
         dam = number_range (500, 750);
      else if (IS_CLASS (ch, CLASS_WEREWOLF) && (wield == NULL || wield->item_type != ITEM_WEAPON))
         dam = number_range (400, 650);
      else if (IS_SET (ch->newbits, NEW_MONKADAM) && (wield == NULL || wield->item_type != ITEM_WEAPON))
         dam = dice (434, 666);
      else if (IS_VAMPAFF (ch, VAM_CLAWS) && (wield == NULL || wield->item_type != ITEM_WEAPON))
         dam = number_range (200, 400);
      else if (wield != NULL && wield->item_type == ITEM_WEAPON)
	 dam = number_range (wield->value[1], wield->value[2]);
      else
	 dam = number_range (1, 4);
   }

   if (number_range (1, 5) == 2)
   {
      if (ch->fighting == victim && IS_CLASS (ch, CLASS_MONK) && !IS_NPC (ch)
	  && ch->monkab[BODY] > 3)
      {
	 wdam =
	    number_range ((ch->chi[CURRENT] * 6), (ch->chi[CURRENT] * 10));
	 if (victim->alignment < 0)
	    wdam *= 1.5;
	 act ("$n's hands glow with a heavenly aura.", ch, NULL, victim,
	      TO_VICT);
	 act ("$n's aura sears your flesh!", ch, NULL, victim, TO_VICT);
	 act ("Your heavenly aura sears $N's flesh.", ch, NULL, victim,
	      TO_CHAR);
	 act ("$n's hands' heavenly aura sears $N's flesh.", ch, NULL, victim,
	      TO_ROOM);
	 victim->hit -= wdam;
	 update_pos (victim);
      }
   }

   /* Fun with weapons */
   if (!IS_NPC (ch) && wield != NULL)
   {
      if (number_range (1, 5) == 2)
      {
	 if (ch->fighting == victim)
	 {
            if (IS_WEAP (wield, WEAPON_FLAMING) && !WORN_ARTIFACT (victim, ARTI_DEMONS_HEART))
	    {
	       wdam = number_range (1, wield->level / 4 + 1);
	       if (!IS_SET (ch->more, MORE_SHIELDS))
	       {
		  act ("$n is burned by $p.", victim, wield, NULL, TO_ROOM);
		  act ("$p sears your flesh.", victim, wield, NULL, TO_CHAR);
	       }
               hurt_person (ch, victim, wdam);
	       update_pos (victim);
	    }

	    if (IS_WEAP (wield, WEAPON_FROST))
	    {
	       wdam = number_range (1, wield->level / 6 + 2);
	       if (!IS_SET (ch->more, MORE_SHIELDS))
	       {
		  act ("$p freezes $n.", victim, wield, NULL, TO_ROOM);
		  act ("The cold touch of $p surrounds you with ice.", victim,
		       wield, NULL, TO_CHAR);
	       }
               hurt_person (ch, victim, wdam);
	       update_pos (victim);
	    }

	    if (IS_WEAP (wield, WEAPON_POISON))
	    {
	       wdam = number_range (1, wield->level / 6 + 2);
	       if (!IS_SET (ch->more, MORE_SHIELDS))
	       {
		  act ("$n turns green as $p poisons $m.", victim, wield,
		       NULL, TO_ROOM);
		  act ("You feel sick as $p's poisoned edge pierces you.",
		       victim, wield, NULL, TO_CHAR);
	       }
               hurt_person (ch, victim, wdam);

	       update_pos (victim);
	    }
	 }
      }
   }

   dam += char_damroll (ch);
   dam = add_bonuses (ch, victim, dam, dt);

   /* Werewolf Silver Stuff.. */
   if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_WEREWOLF))
   {
      if (number_percent () > victim->pcdata->powers[WPOWER_SILVER])
      {
	 if (is_garou (ch))
	 {
	    if (IS_GAR1 (ch, GAROU_AVENGER))
	       dam *= 3;
	    else if (ch->gifts[AHROUN] >= 4 || ch->gifts[SILVERFANGS] >= 2)
	       dam *= 2.2;
	    else if (wield != NULL && IS_SET (wield->spectype, SITEM_SILVER))
	       dam *= 2;
	    else if ((gloves = get_eq_char (ch, WEAR_HANDS)) != NULL
		     && IS_SET (gloves->spectype, SITEM_SILVER))
	       dam *= 2;
	 }
	 else if (!is_garou (ch))
	 {
	    if (wield != NULL && IS_SET (wield->spectype, SITEM_SILVER))
	       dam *= 2;
	    else if ((gloves = get_eq_char (ch, WEAR_HANDS)) != NULL
		     && IS_SET (gloves->spectype, SITEM_SILVER))
	       dam *= 2;
	 }
      }
   }

   if (dt == gsn_backstab)
   {
      if (IS_CLASS (ch, CLASS_DROW))
	 dam *= number_range (4, 5);
      else
	 dam *= number_range (2, 3);

      if (IS_CLASS (ch, CLASS_NINJA) && !IS_NPC (ch)
	  && ch->pcdata->powers[NPOWER_NINGENNO] >= 2)
	 dam *= number_range (4, 8);
      else
	 dam *= number_range (2, 4);
   }
   if (dt == gsn_garotte)
      dam *= (number_range (3, 5));


   if (dt == gsn_circle)
      dam *= number_range (5, 6);

   if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_HIGHLANDER)
       && IS_DEMPOWER (victim, HPOWER_TOUGHNESS))
   {
      char buf[MAX_STRING_LENGTH];
      int skin;
      int rebound;

      skin = number_range (1, 100);
      rebound = number_range (1, 100);
      if (skin == 20 || skin == 40 || skin == 60 || skin == 80 || skin == 100)
      {
	 stc ("#3You bounce their pathetic blow off your skin#n.\n\r",
	      victim);
	 stc ("#3Your opponent bounces your attack off their skin#n.\n\r",
	      ch);
	 if (rebound == 10 || rebound == 50 || rebound == 100)
	 {
	    sprintf (buf,
		     "#3The bounced blow slams into them#n. [#1%d#n]\n\r",
		     dam / 2);
	    stc (buf, victim);
	    sprintf (buf,
		     "#3Your attack bounces and slams into you#n. [#1%d#n]\n\r",
		     dam / 2);
	    stc (buf, ch);
	    dam /= 2;
            damage (victim, ch, dam, dt);
	 }
	 dam = 0;
      }
   }
   if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_DROW)
       && IS_SET (victim->extra2, DROW_DARKTENDRILS))
   {
      int ddodge = number_range (1, 50);

      if (ddodge == 10 || ddodge == 20 || ddodge == 30 || ddodge == 40
	  || ddodge == 50)
      {
         bufz = number_range(1,20);
	 sprintf (buf,"#0You dark aura absorbs the damage and channels some of it into you. #r[#G+#C%d#r]#n.\n\r", bufz);
         stc(buf,victim);
	 stc ("#0Your opponent's dark aura absorbs your damage#n.\n\r", ch);
         victim->hit += bufz;
	 dam = 0;
      }
   }
   damage (ch, victim, dam, dt);

// special arti's -- Serenity
   if ((victim != NULL) && (ch->fighting == victim) && (dam > 0)
       && (wield != NULL) && ((dt - TYPE_HIT >= 0) && (dt - TYPE_HIT <= 12)))
   {
      bool arti = FALSE;
      char movie_buf1[10000];
      char movie_buf2[10000];
      char movie_buf3[10000];
      int activate = 0;
      OBJ_DATA *the_arti;

      if (dam > ch->damcap[DAM_CAP])
	 dam = ch->damcap[DAM_CAP];

      if ((wield != NULL) && OBJ_ARTIFACT (wield))
	 arti = TRUE;
      if ((!arti) && (WORN_ARTIFACT (ch, ARTI_PLATE_IRON_GAUNTLET)))
	 arti = TRUE;
      if ((!arti) && (WORN_ARTIFACT (ch, ARTI_CROWN_OF_CHRYSTANCIA)))
	 arti = TRUE;

      if ((arti) && (IS_ARTIFACT (wield, ARTI_SHATTERED_BLADE)))
      {
	 if ((the_arti = get_artifact (ch, ARTI_SHATTERED_BLADE)) == NULL)
	 {
	    bug ("Supposedly had Shattered Blade, but couldn't find it.", 0);
	    tail_chain ();
	    if (!is_safe (ch, victim))
	    {
	       improve_wpn (ch, dt, right_hand);
	       improve_stance (ch);
	    }
	    return;
	 }
	 activate = the_arti->points;

	 if (activate > 0)
	 {
	    sprintf (movie_buf1,
		     "Slivers of $p tear off and dig into $N's wound causing more damage. #w[ #r%d #w]#n",
		     (dam / 4));
	    sprintf (movie_buf2,
		     "Slivers from $n's $p tear off and dig into your wound causing more damage. #w[ #r%d #w]#n",
		     (dam / 4));
	    sprintf (movie_buf3,
		     "$n's motion causes slivers of $p to tear off and dig into the wound causing more damage to $N.");

	    act (movie_buf1, ch, wield, victim, TO_CHAR);
	    act (movie_buf2, ch, wield, victim, TO_VICT);
	    act (movie_buf3, ch, wield, victim, TO_NOTVICT);
	    hurt_person (ch, victim, (dam / 4));
	    the_arti->points = 0;
	 }
	 else
	    the_arti->points++;
      }

      if ((arti) && (IS_ARTIFACT (wield, ARTI_METEORIC_AXE)))
      {
	 if ((the_arti = get_artifact (ch, ARTI_METEORIC_AXE)) == NULL)
	 {
	    bug ("Supposedly had Axe of Meteoric Steel, but couldn't find it.", 0);
	    tail_chain ();
	    if (!is_safe (ch, victim))
	    {
	       improve_wpn (ch, dt, right_hand);
	       improve_stance (ch);
	    }
	    return;
	 }
	 activate = the_arti->points;
	 if (activate > 1)
	 {
	    sprintf (movie_buf1,
		     "Small meteors fly forth from $p striking $N. #w[ #r%d #w]#n",
		     (dam / 10));
	    sprintf (movie_buf2,
		     "Small meteors fly forth from $n's $p striking you. #w[ #r%d #w]#n",
		     (dam / 10));
	    sprintf (movie_buf3,
		     "Small meteors fly forth from $n's $p striking $N.");

	    act (movie_buf1, ch, wield, victim, TO_CHAR);
	    act (movie_buf2, ch, wield, victim, TO_VICT);
	    act (movie_buf3, ch, wield, victim, TO_NOTVICT);
	    hurt_person (ch, victim, (dam / 10));
	    the_arti->points = 0;
	 }
	 else
	    the_arti->points++;
      }

      if ((arti) && (WORN_ARTIFACT (ch, ARTI_PLATE_IRON_GAUNTLET)))
      {
	 OBJ_DATA *wield_obj;

	 if ((the_arti = get_artifact (ch, ARTI_PLATE_IRON_GAUNTLET)) == NULL)
	 {
	    bug ("Supposedly had Plate Iron Gauntlet, but couldn't find it.",
		 0);
	    tail_chain ();
	    if (!is_safe (ch, victim))
	    {
	       improve_wpn (ch, dt, right_hand);
	       improve_stance (ch);
	    }
	    return;
	 }
	 activate = the_arti->points;

	 if (activate > 1)
	 {
	    wield_obj =
	       create_object (get_obj_index (ARTI_PLATE_IRON_GAUNTLET), 0);
	    sprintf (movie_buf1,
		     "You strike $N hard with your Gauntlets. #w[ #r%d #w]#n",
		     (dam / 10));
	    sprintf (movie_buf2,
		     "$n strikes you hard with $s Gauntlets. #w[ #r%d #w]#n",
		     (dam / 10));
	    sprintf (movie_buf3, "$n strikes $N hard with $s Gauntlets.");

	    act (movie_buf1, ch, NULL, victim, TO_CHAR);
	    act (movie_buf2, ch, NULL, victim, TO_VICT);
	    act (movie_buf3, ch, NULL, victim, TO_NOTVICT);
	    hurt_person (ch, victim, (dam / 10));
	    extract_obj (wield_obj);
	    the_arti->points = 0;
	 }
	 else
	    the_arti->points++;
      }

      if ((arti) && (WORN_ARTIFACT (ch, ARTI_CROWN_OF_CHRYSTANCIA)))
      {
	 OBJ_DATA *wield_obj;

	 if ((the_arti =
	      get_artifact (ch, ARTI_CROWN_OF_CHRYSTANCIA)) == NULL)
	 {
	    bug ("Supposedly had Crown of Chrystancia, but couldn't find it.",
		 0);
	    tail_chain ();
	    if (!is_safe (ch, victim))
	    {
	       improve_wpn (ch, dt, right_hand);
	       improve_stance (ch);
	    }
	    return;
	 }
	 activate = the_arti->points;

	 if (activate > 1)
	 {
	    wield_obj =
	       create_object (get_obj_index (ARTI_CROWN_OF_CHRYSTANCIA), 0);
	    sprintf (movie_buf1,
		     "The Crown of Chrystancia on your head blasts $N with a coruscating wave of energy. #w[ #r%d #w]#n",
		     (dam / 10));
	    sprintf (movie_buf2,
		     "The Crown of Chrystancia on $n's head blasts you with a coruscating wave of energy. #w[ #r%d #w]#n",
		     (dam / 10));
	    sprintf (movie_buf3,
		     "The Crown of Chrystancia on $n's head blasts $N with a coruscating wave of energy.");

	    act (movie_buf1, ch, NULL, victim, TO_CHAR);
	    act (movie_buf2, ch, NULL, victim, TO_VICT);
	    act (movie_buf3, ch, NULL, victim, TO_NOTVICT);
	    hurt_person (ch, victim, (dam / 10));
	    extract_obj (wield_obj);
	    the_arti->points = 0;
	 }
	 else
	    the_arti->points++;
      }

      if ((arti) && (IS_ARTIFACT (wield, ARTI_ICE_SHARD)))
      {
	 if ((the_arti = get_artifact (ch, ARTI_ICE_SHARD)) == NULL)
	 {
	    bug ("Supposedly had Ice Shard, but couldn't find it.", 0);
	    tail_chain ();
	    if (!is_safe (ch, victim))
	    {
	       improve_wpn (ch, dt, right_hand);
	       improve_stance (ch);
	    }
	    return;
	 }
	 activate = the_arti->points;

	 if (activate > 1)
	 {
	    non_katana_ice_sword (ch, wield);
	    the_arti->points = 0;
	 }
	 else
	    the_arti->points++;
      }
   }

   tail_chain ();
   if (!is_safe (ch, victim))
   {
      improve_wpn (ch, dt, right_hand);
      improve_stance (ch);
   }
   return;
}

int add_bonuses (CHAR_DATA * ch, CHAR_DATA * victim, int dam, int dt)
{
   float mult = 1;
   float reduct = 1;
   int stance;
   int wpn;

   if (!IS_AWAKE (victim))
      dam *= 2;

   ch->mult = 0;
   victim->reduct = 0;

   if (!IS_NPC (ch))
   {
      /* Stance Bonuses.. */
      stance = ch->stance[0];
      if (IS_STANCE (ch, STANCE_NORMAL))
	 mult += .25;
      else
	 dam = dambonus (ch, victim, dam, stance);
      /* ----------------- */

      if (IS_CLASS (ch, CLASS_VAMPIRE))
      {
         if (get_disc(ch, VAM_POTE) > 0)
            mult += (get_disc(ch, VAM_POTE) / 2);

	 /* Vampire Day\Night Bonus Shit */
         if (weather_info.sunlight == SUN_LIGHT && dam > 1 && !IS_IMMUNE (ch,IMM_SUNLIGHT))
	    mult -= .5;
	 else
	    mult += .5;
      }
      if (IS_CLASS (ch, CLASS_WEREWOLF))
      {
	 if (ch->pcdata->stats[UNI_RAGE] > 150)
	    mult += .10;
	 if (ch->gifts[PHILODOX] >= 4)
	    mult += .6;
	 if (ch->gifts[SHADOWLORDS] >= 1)
	    mult += .7;
	 if (ch->gifts[GETOFFENRIS] >= 3)
	    mult += 1;
	 if (ch->gifts[STARGAZERS] >= 1)
	    mult += .3;
	 if (ch->gifts[AHROUN] >= 1)
	    mult += .3;
	 if (ch->gifts[AHROUN] >= 2)
	    mult += .3;
	 if (ch->gifts[BLACKFURIES] >= 3)
	    mult += .3;
      }

      if (IS_CLASS (ch, CLASS_MAGE))
      {
	 if (IS_SET (ch->mflags, MAGE_TELEKINETICS))
	    mult += .5;
	 if (IS_SET (ch->mflags, MFLAGS_DIMMAK))
	    mult += .4;
	 if (ch->spheres[MENT] >= 1)
	    mult += (ch->spheres[MENT] * .3);
      }
      if (IS_CLASS (ch, CLASS_MONK))
      {
	 if (ch->chi[CURRENT] > 0)
	    mult += (ch->chi[CURRENT] / 2);
      }
      if (IS_CLASS (ch, CLASS_FAE))
      {
         mult += 1;
         if (IS_EXTRA2 (ch, EXTRA2_WYRM))
            mult += 1.5;
         if (IS_EXTRA2 (ch, EXTRA2_FAEMIGHT))
            mult += 3.5;
      }
      if (IS_CLASS (ch, CLASS_DROW))
      {
	 if IS_SET
            (ch->pcdata->powers[1], DPOWER_TOUGHSKIN) mult += 2.5;
      }
      if (IS_CLASS (ch, CLASS_DEMON))
      {
	 if (IS_DEMPOWER (ch, DEM_MIGHT))
	    mult += 1.7;
         if (IS_SET (ch->warp, WARP_WEAK))
            mult -= .5;
         if (IS_SET (ch->warp, WARP_GBODY))
            mult -= .5;
         if (IS_SET (ch->warp, WARP_STRONGARMS))
            mult += 1;
      }

      if (IS_CLASS (ch, CLASS_DRAGON) && IS_SET (ch->pcdata->dragonaff, DRA_TERROR))
      {
         mult += (GET_AGE(ch) / 4);
      }

      if (IS_CLASS (ch, CLASS_HIGHLANDER))
      {
	 if (IS_DEMPOWER (ch, HPOWER_MIGHT))
	    mult += 1.7;
      }

      if (IS_CLASS (ch, CLASS_NINJA))
      {
	 if (ch->pcdata->powers[NPOWER_CHIKYU] > 1)
	    mult += 3;
      }

      if (ch->move >= 50000)
      {
          mult += ch->move / 50000;
      }
   }

   if (!IS_NPC (victim))
   {
      if (IS_ITEMAFF (victim, ITEMA_RESISTANCE))
	 reduct += 5;
      if (IS_CLASS (victim, CLASS_HIGHLANDER))
      {
	 reduct += 2;
      }
      if (IS_CLASS (victim, CLASS_HIGHLANDER))
      {
	 if (IS_DEMPOWER (victim, HPOWER_TOUGHNESS))
	    reduct += 1.7;
      }
      if (IS_CLASS (victim, CLASS_DRAGON)
          && IS_SET (victim->pcdata->dragonaff, DRA_TERROR))
      {
         reduct += (GET_AGE(victim) / 4);
      }
      if (!IS_NPC (ch) && IS_CLASS (victim, CLASS_DRAGON)
	  && IS_SET (victim->pcdata->dragonaff, DRA_TOUGHNESS))
      {
         reduct += (GET_AGE(victim) / 4);
      }
      if (IS_CLASS (victim, CLASS_VAMPIRE))
      {
         if (get_disc(victim, VAM_FORT) > 0)
            reduct += (get_disc(victim, VAM_FORT) * .6);
      }
      if (IS_CLASS (victim, CLASS_WEREWOLF))
      {
	 if (victim->pcdata->stats[UNI_RAGE] > 150)
	    reduct += .5;

	 if (victim->gifts[PHILODOX] >= 1)
	    reduct += .1;
	 if (victim->gifts[PHILODOX] >= 3)
	    reduct += .2;
	 if (victim->gifts[SHADOWLORDS] >= 2)
	    reduct += .2;
	 if (victim->gifts[SHADOWLORDS] >= 4)
	    reduct += .3;
         if (IS_GAR1 (victim, WOLF_COCOON))
            reduct += 1.25;
      }

      if (IS_CLASS (victim, CLASS_MAGE))
      {
	 if (IS_SET (victim->mflags, MAGE_BETTERBODY))
            reduct += .75;
	 if (IS_SET (victim->mflags, MAGE_POLYAPPEAR))
	    reduct += number_range (0, 4) * 0.3;
	 if (victim->spheres[MENT] >= 0)
	    reduct += victim->spheres[MENT] * 0.3;
      }
      if (IS_CLASS (victim, CLASS_FAE))
      {
         reduct += 0.75;
	 if (IS_SET (victim->extra2, EXTRA2_FAETOUGH))
	    reduct += 1.4;
         if (IS_EXTRA2 (victim, EXTRA2_WYRM))
            reduct += 1.5;
         if (IS_GAR1 (victim, WW_GRANITE))
            reduct += 3;
      }
      if (IS_CLASS (victim, CLASS_DEMON))
      {
	 if (IS_DEMPOWER (victim, DEM_TOUGH))
	    reduct += 1.4;
         if (IS_SET (victim->warp, WARP_SBODY))
            reduct += 1.5;
         if (IS_SET (victim->warp, WARP_CBODY))
            reduct += 1.5;
         if (IS_SET (victim->warp, WARP_STAMINA))
            reduct += 2;
      }

      if (IS_CLASS (ch, CLASS_DEMON) && IS_SET (ch->warp, WARP_WEAK))
	 reduct += .5;


      if (IS_CLASS (victim, CLASS_MONK))
      {
	 if (victim->chi[CURRENT] > 0)
            reduct += victim->chi[CURRENT] / 2;
	 if (victim->monkab[BODY] >= 2)
	    reduct += .5;
      }
      if (IS_CLASS (victim, CLASS_DROW))
      {
         reduct += 1;
	 if IS_SET
            (victim->pcdata->powers[1], DPOWER_TOUGHSKIN) reduct += 2.5;
      }
      if (IS_CLASS (victim, CLASS_NINJA))
      {
	 reduct += 1.4;
         if (victim->pcdata->powers[NPOWER_CHIKYU] > 6)
            reduct += 2.25;
      }
   }

 if (IS_CLASS(ch, CLASS_WRAITH))
        mult += 4;
        if (IS_CLASS(victim, CLASS_WRAITH))
        reduct += 2;
   if (!IS_NPC (ch) && dt >= TYPE_HIT)
   {
      wpn = (dt - 1000);
      dam = dam + (dam * ((ch->wpn[wpn] + 1) / 100));
   }

   if (!IS_NPC (victim))
   {
      if (dt >= TYPE_HIT)
      {
	 wpn = (dt - 1000);
	 if ((wpn == 1 || wpn == 3) && IS_IMMUNE (victim, IMM_SLASH))
	    dam /= (number_range (1, 4));
	 if ((wpn == 2 || wpn == 11) && IS_IMMUNE (victim, IMM_STAB))
	    dam /= (number_range (1, 4));
	 if ((wpn == 6 || wpn == 7 || wpn == 8)
	     && IS_IMMUNE (victim, IMM_SMASH))
	    dam /= (number_range (1, 4));
         if ((wpn == 0 || wpn == 5 || wpn == 10) && IS_IMMUNE (victim, IMM_ANIMAL))
	    dam /= (number_range (1, 4));
	 if ((wpn == 4 || wpn == 9 || wpn == 12)
	     && IS_IMMUNE (victim, IMM_MISC))
	    dam /= (number_range (1, 4));
      }
   }

   if (IS_NPC (ch) && ch->level > 200)
   {
      mult += (ch->level / 200);
   }

   if (IS_NPC (victim))
   {
      reduct += (victim->level / 200);
      reduct += 1;
   }

   ch->mult = mult;
   victim->reduct = reduct;

   dam *= mult;
   dam /= reduct;

   return dam;
}

bool can_counter (CHAR_DATA * ch)
{
   if (IS_STANCE (ch, STANCE_MONKEY))
      return TRUE;
   return FALSE;
}

bool can_bypass (CHAR_DATA * ch, CHAR_DATA * victim)
{
/*
   if (IS_NPC (ch))		//  || IS_NPC (victim))  -- BS... You can bypass mob parry/dodge.
      return FALSE;
*/
   //else 
   if (IS_STANCE (ch, STANCE_VIPER))
      return TRUE;
   else if (IS_STANCE (ch, STANCE_MANTIS))
      return TRUE;
   else if (IS_STANCE (ch, STANCE_TIGER))
      return TRUE;
   return FALSE;
}

int oupdate_damcap (CHAR_DATA * ch, CHAR_DATA * victim)
{
 int vic_ac;
 int dam=0;
  if (is_safe(ch, victim)) return 0;

  vic_ac = char_ac(victim) * 0.01; 
  dam -= vic_ac;
  if (dam <= 0) dam = 1;
  if (dam > 1000000) dam = 1000000;
  if (IS_AFFECTED(victim, AFF_PROTECT) && IS_EVIL(ch))
    dam -= dam * 0.25;

  if ( (IS_AFFECTED (victim, AFF_SANCTUARY) && dam > 1 ) || ( WORN_ARTIFACT( victim, ARTI_CLOAK_OF_THE_ARCHMAGI ) && dam > 1 ) )
    dam *= 0.5;
/*  if ( IS_AFFECTED(victim, AFF_HOLYAURA))
    dam *= 0.5;*/
  if (IS_ITEMAFF(victim, ITEMA_RESISTANCE))
    dam -= dam * 0.25;
  return dam;
}
void update_damcap (CHAR_DATA * ch, CHAR_DATA * victim)
{
   OBJ_DATA *obj1;
   OBJ_DATA *obj2;
   OBJ_DATA *obj3;
   OBJ_DATA *obj4;
   int max_dam = 1000;

   if (IS_NPC (ch))
   {
      max_dam += (ch->level * 100);	// for NPCs
#ifdef FUCK_PLAYERS
      max_dam = 30000;
#endif
   }
   else
   {

      if (IS_CLASS (ch, CLASS_FAE))
      {
	 max_dam += 2700;
	 if (IS_EXTRA2 (ch, EXTRA2_FAEMIGHT))
	    max_dam += 1050;
      }				// 4750

      if (IS_CLASS (ch, CLASS_DROW))
      {
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 3000;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 2800;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 2700;
	 else if (ch->pcdata->stats[UNI_GEN] < 6)
	    max_dam += 2600;
	 else
	    max_dam += 2500;

	 if (weather_info.sunlight == SUN_DARK)
	    max_dam += 1050;
	 if (IS_SET (ch->newbits, NEW_DROWHATE))
	    max_dam += 1050;
	 if (IS_SET (ch->special, SPC_DROW_WAR))
	    max_dam += 250;
         if (IS_SET (ch->special, SPC_DROW_ASN))
            max_dam += 250;
	 else if (IS_SET (ch->special, SPC_DROW_MAG))
	    max_dam += 200;
	 else if (IS_SET (ch->special, SPC_DROW_CLE))
	    max_dam += 150;

      }

        if (IS_CLASS(ch,CLASS_WRAITH))
        {
         if (ch->arcanoi[WRAGE] == 0)
            max_dam += 2500;
         if (ch->arcanoi[WRAGE] == 1)
            max_dam += 3000;
         if (ch->arcanoi[WRAGE] == 2)
            max_dam += 3250;
         if (ch->arcanoi[WRAGE] == 3)
            max_dam += 3750;
         if (ch->arcanoi[WRAGE] == 4)
            max_dam += 4000;
         if (ch->arcanoi[WRAGE] >= 5)
            max_dam += 4500;
         }
      if (IS_CLASS (ch, CLASS_DEMON))
      {
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 1500;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 1400;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 1300;
	 else if (ch->pcdata->stats[UNI_GEN] < 6)
	    max_dam += 1200;
	 else
	    max_dam += 1100;
	 if (IS_SET (ch->special, SPC_DEMON_LORD))
	    max_dam += 500;
	 else if (IS_SET (ch->special, SPC_PRINCE))
	    max_dam += 400;
	 else if (IS_SET (ch->special, SPC_SIRE))
	    max_dam += 300;
	 else
	    max_dam += 100;

	 if (ch->in_room != NULL && ch->in_room->vnum == 30000)
	    max_dam += 20000;

	 max_dam += (ch->pcdata->stats[DEMON_POWER] * 20);
	 max_dam += 1000;

      }
      if (!IS_NPC (ch) && IS_SET (ch->warp, WARP_DAMCAP))
	 max_dam += 800;
      if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DEMON)
	  && IS_DEMPOWER (ch, DEM_MIGHT))
	 max_dam += 200;

      if (IS_CLASS (ch, CLASS_DRAGON))
      {
         max_dam += GET_AGE(ch) * 100;
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 2500;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 2400;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 2300;
	 else if (ch->pcdata->stats[UNI_GEN] < 6)
	    max_dam += 2200;
	 else
	    max_dam += 2100;
      }
      if (IS_CLASS (ch, CLASS_VAMPIRE))
      {
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 2500;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 2400;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 2300;
	 else if (ch->pcdata->stats[UNI_GEN] < 6)
	    max_dam += 2200;
	 else
	    max_dam += 2100;
	 max_dam += (ch->pcdata->stats[UNI_RAGE]);
	 if (ch->pcdata->rank == AGE_METHUSELAH)
	    max_dam += 750;
	 else if (ch->pcdata->rank == AGE_ELDER)
	    max_dam += 300;
	 else if (ch->pcdata->rank == AGE_ANCILLA)
	    max_dam += 150;
         if (get_disc(ch, VAM_POTE) > 0)
            max_dam += (200 * get_disc(ch, VAM_POTE));
	 if IS_SET
	    (ch->newbits, NEW_TIDE) max_dam += 500;

      }
      if (IS_CLASS (ch, CLASS_MONK))
      {
	 max_dam += 300;
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 1700;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 1600;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 1500;
	 else
	    max_dam += 1400;
	 if (ch->monkab[COMBAT] > 0)
	    max_dam += (ch->monkab[COMBAT] * 100);
	 if (ch->chi[CURRENT] > 0)
	    max_dam += (ch->chi[CURRENT] * 200);
      }
      if (IS_CLASS (ch, CLASS_NINJA))
      {
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 1700;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 1600;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 1500;
	 else
	    max_dam += 1400;

	 max_dam += (ch->pcdata->stats[UNI_RAGE] * 5);
	 if (ch->pcdata->powers[NPOWER_CHIKYU] >= 6
	     && ch->pcdata->powers[HARA_KIRI] > 0)
	    max_dam += 800;
	 if (ch->pcdata->powers[NPOWER_CHIKYU] >= 2)
	    max_dam += 550;
      }
      if (IS_CLASS (ch, CLASS_MAGE))
      {
	 max_dam += 1500;
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 2500;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 2400;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 2300;
	 else if (ch->pcdata->stats[UNI_GEN] < 6)
	    max_dam += 2200;
	 else
	    max_dam += 2100;

	 if (ch->spheres[MENT] > 0)
	    max_dam += (200 * ch->spheres[MENT]);
      }
      if (IS_CLASS (ch, CLASS_WEREWOLF))
      {
	 if (ch->pcdata->stats[UNI_GEN] < 3)
	    max_dam += 2700;
	 else if (ch->pcdata->stats[UNI_GEN] < 4)
	    max_dam += 2600;
	 else if (ch->pcdata->stats[UNI_GEN] < 5)
	    max_dam += 2500;
	 else
	    max_dam += 2300;
	 if (weather_info.moonphase == MOON_HALF
	     && weather_info.time_of_day == NIGHT)
	    max_dam += 500;
	 if (weather_info.moonphase == MOON_FULL
	     && weather_info.time_of_day == NIGHT)
	    max_dam += 1000;
	 if (IS_SET (ch->special, SPC_WOLFMAN))
	    max_dam += (ch->pcdata->stats[UNI_RAGE]);
	 if (ch->gifts[PHILODOX] >= 3)
	    max_dam += 400;
	 if (ch->gifts[SILVERFANGS] > 0)
	    max_dam += 300;
	 if (ch->gifts[GETOFFENRIS] >= 3)
	    max_dam += 400;
	 if (IS_ITEMAFF (ch, ITEMA_SUNSHIELD))
	    max_dam += 500;
      }
      if (IS_CLASS (ch, CLASS_HIGHLANDER))
      {
	 if (get_eq_char (ch, WEAR_DUAL) != NULL)
	 {
	    max_dam += (ch->wpn[1] * 3.3);
	    //      max_dam += (ch->race * 10);
	 }
	 else
	 {
	    max_dam += (ch->wpn[0] * 3.0);
	    //      max_dam += (ch->race * 10);
	 }
      }

   }
/* Crab Monkey and Swallow take damcap? */

   if (victim->stance[0] != STANCE_MONKEY)
   {
      int stance = ch->stance[0];

      if (ch->stance[0] == STANCE_BULL)
	 max_dam += ch->stance[stance];
      else if (ch->stance[0] == STANCE_DRAGON)
	 max_dam += ch->stance[stance];
      else if (ch->stance[0] == STANCE_TIGER)
	 max_dam += ch->stance[stance];
   }
   if (ch->stance[0] != STANCE_MONKEY)
   {
      int stance = victim->stance[0];

      if (victim->stance[0] == STANCE_CRAB)
	 max_dam -= victim->stance[stance];
      else if (victim->stance[0] == STANCE_DRAGON)
	 max_dam -= victim->stance[stance];
      else if (victim->stance[0] == STANCE_SWALLOW)
	 max_dam -= victim->stance[stance];
   }

/* Legend Status Bonuses */
   if (!IS_NPC (ch))
   {
      if (ch->lstatus == 1)
	 max_dam += 50;
      if (ch->lstatus == 2)
	 max_dam += 100;
      if (ch->lstatus == 3)
	 max_dam += 200;
      if (ch->lstatus == 4)
	 max_dam += 300;
      if (ch->lstatus == 5)
	 max_dam += 400;
      if (ch->lstatus == 6)
	 max_dam += 500;
      if (ch->lstatus == 7)
	 max_dam += 1000;
      if (ch->lstatus == 8)
	 max_dam += 1500;
      if (ch->lstatus == 9)
	 max_dam += 2000;
      if (ch->lstatus == 10)
	 max_dam += 2500;
      if (ch->lstatus == 11)
	 max_dam += 3500;
   }

   /* Status Damcap 50/status */
   if (!IS_NPC (ch))
      max_dam += (ch->race * 100);

/*   if (IS_ITEMAFF (ch, ITEMA_ARTIFACT))
      max_dam += 500;
   if (IS_ITEMAFF (victim, ITEMA_ARTIFACT))
      max_dam -= 500;*/
   if (IS_SUPER_NPC (ch))
      max_dam += ch->level * 2;
   if (IS_SUPER_NPC (victim))
      max_dam -= victim->level / 2;	// Updated by Serenity to be victim not CH

   if (max_dam < 1000)
      max_dam = 1000;
   if (max_dam > 20000)
      max_dam = 20000;
   if (ch->level >= LEVEL_BUILDER)
      max_dam = 30000;
   if (IS_EXTRA2 (ch, EXTRA2_INFECTED) && IS_PARA (3))
      max_dam *= 1.25;		// moved this AHEAD of the setting of damcap otherwise it's worthless -- Serenity

   // wielded/held Arti stuff
   obj1 = get_eq_char (ch, WEAR_HOLD);
   obj2 = get_eq_char (ch, WEAR_WIELD);
   obj3 = get_eq_char (ch, WEAR_THIRD);
   obj4 = get_eq_char (ch, WEAR_FOURTH);
   if (obj4 == NULL) obj4 = get_eq_char (ch, WEAR_DUAL);

   if (WORN_ARTIFACT (ch, ARTI_MAIDENS_BREATH))
      max_dam += 500;
   else if (WORN_ARTIFACT (ch, ARTI_RING_AURELIUS))
      max_dam += 500;
   else if (WORN_ARTIFACT (ch, ARTI_DEMONS_HEART))
      max_dam += 500;
   else if (WORN_ARTIFACT (ch, ARTI_HEART_OF_DARKNESS))
      max_dam += 250;
   else if (WORN_ARTIFACT (ch, ARTI_PLATE_IRON_GAUNTLET))
      max_dam += 1000;
   else if (WORN_ARTIFACT (ch, ARTI_LIONS_MANE))
      max_dam += 750;
   else if (WORN_ARTIFACT (ch, ARTI_CROWN_OF_CHRYSTANCIA))
      max_dam += 500;
   else if (ANY_ARTIFACT (obj1, obj2, obj3, obj4, ARTI_METEORIC_AXE))
      max_dam += 500;
   else if (ANY_ARTIFACT (obj1, obj2, obj3, obj4, ARTI_ICE_SHARD))
      max_dam += 250;
   else if (ANY_ARTIFACT (obj1, obj2, obj3, obj4, ARTI_KATANA_MURAMASE))
      max_dam += 750;
   else if (ANY_ARTIFACT (obj1, obj2, obj3, obj4, ARTI_EMPERORS_BLADE))
      max_dam += 250;
   else
   {
      int x;
      for (x = ARTI_GREEN_PLANAR_RING; x <= ARTI_WYRM_BLADE; x++)
         if (WORN_ARTIFACT (ch, x))
            max_dam += 500;
   }

   ch->damcap[DAM_CAP] = max_dam;
   ch->damcap[DAM_CHANGE] = 0;

   return;
}

/*
 * Inflict damage from a hit.
 */
void damage (CHAR_DATA * ch, CHAR_DATA * victim, int dam, int dt)
{
   bool BYPASSING = FALSE;
   CHAR_DATA *emb;

   int max_dam = ch->damcap[DAM_CAP];

/* Embrace Fix!*/  
   if (!IS_NPC(ch) && ch->embracing != NULL )
   {
      if ( ( emb = ch->embracing ) != NULL )
         stop_embrace(ch,emb);
      else
         stop_embrace(ch,NULL);       
   }
   if (IS_CREATOR (ch))
      max_dam = 10000000;

   if (get_hours (ch) < 6 && !IS_NPC (ch) && !IS_SET (ch->extra2, PKREADY))
      dam *= 3;
   if (get_hours (victim) < 6 && !IS_NPC (victim)
       && !IS_SET (victim->extra2, PKREADY))
      dam /= 2;

   if (victim == NULL || victim->position == POS_DEAD)
      return;

   /*
    * Stop up any residual loopholes.
    */

   if (!IS_NPC (ch) && IS_ITEMAFF (ch, ITEMA_PEACE))
   {
      send_to_char ("You are unable to attack them.\n\r", ch);
      return;
   }

   if (!IS_NPC (victim) && IS_ITEMAFF (victim, ITEMA_PEACE))
   {
      send_to_char ("You can't seem to attack them.\n\r", ch);
      return;
   }

   if (ch->damcap[DAM_CHANGE] == 1)
   {
      update_damcap (ch, victim);
      max_dam = ch->damcap[DAM_CAP];	// after we update the damcap, let's assign it eh? -- serenity
   }


  if (dam > max_dam)
      dam = max_dam;


   if (victim != ch)
   {
      /*
       * Certain attacks are forbidden.
       * Most other attacks are returned.
       */
      if (is_safe (ch, victim))
	 return;
      check_killer (ch, victim);

      if (victim->position > POS_STUNNED)
      {
	 if (victim->fighting == NULL)
	    set_fighting (victim, ch);
	 victim->position = POS_FIGHTING;
      }

      if (victim->position > POS_STUNNED)
      {
	 if (ch->fighting == NULL)
	    set_fighting (ch, victim);

	 /*
	  * If victim is charmed, ch might attack victim's master.
	  */
	 if (IS_NPC (ch) && IS_NPC (victim) && IS_AFFECTED (victim, AFF_CHARM)
	     && victim->master != NULL
	     && victim->master->in_room == ch->in_room
	     && number_bits (3) == 0)
	 {
	    stop_fighting (ch, FALSE);
	    multi_hit (ch, victim->master, TYPE_UNDEFINED);
	    return;
	 }
      }

      /*
       * More charm stuff.
       */
      if (victim->master == ch)
	 stop_follower (victim);

      /*
       * Damage modifiers.
       */
      if ((IS_CLASS (ch, CLASS_HIGHLANDER))
	  && (IS_DEMPOWER (ch, HPOWER_HEAL)))
      {
	 if (IS_AFFECTED (ch, AFF_HIDE))
	 {
	    dam *= 1.65;
	    stc ("You use your healing knowledge to place a grievous wound in your foe.\n\r", ch);
	    //if ( number_range( 1, 100 ) < 95 )
	    REMOVE_BIT (ch->affected_by, AFF_HIDE);
	    act ("$n places a cruel blow deep into your vitals.", ch, NULL,
		 NULL, TO_ROOM);
	 }
      }
      else if (IS_AFFECTED (ch, AFF_HIDE))
      {
	 if (!can_see (victim, ch))
	 {
	    dam *= 1.5;
	    send_to_char
	       ("You use your concealment to get a surprise attack!\n\r", ch);
	 }
	 REMOVE_BIT (ch->affected_by, AFF_HIDE);
	 act ("$n leaps from $s concealment.", ch, NULL, NULL, TO_ROOM);
      }

      if (IS_CLASS (ch, CLASS_NINJA) && IS_SET (ch->act, PLR_WIZINVIS))
      {
	 if (!can_see (victim, ch))
	 {
	    dam *= 3;
	    send_to_char ("You leap from the shadows.\n\r", ch);
	 }
	 REMOVE_BIT (ch->act, PLR_WIZINVIS);
	 act ("$n leaps from the shadows.", ch, NULL, NULL, TO_ROOM);
	 BYPASSING = TRUE;
      }
      else if (IS_CLASS (ch, CLASS_MONK) && IS_SET (ch->act, PLR_WIZINVIS))
      {
	 if (!can_see (victim, ch))
	 {
	    dam *= 1.2;
            send_to_char ("You burst from a flash of light.\n\r", ch);
	 }
	 REMOVE_BIT (ch->act, PLR_WIZINVIS);
	 act ("$n bursts from a flash of light.", ch, NULL, NULL, TO_ROOM);
      }

	 if ( (IS_AFFECTED (victim, AFF_SANCTUARY) && dam > 1 ) || ( WORN_ARTIFACT( victim, ARTI_CLOAK_OF_THE_ARCHMAGI ) && dam > 1 ) )
         {/*
           if ( IS_CLASS( ch, CLASS_HIGHLANDER ) && IS_DEMPOWER( ch, HPOWER_USE_SHIELDLESS ) )
           {
	     if ( ch->quickening[0] >= 3 && number_percent() < 80 )
	     {
	       dam = dam;
	       ch->quickening[0] -= number_range( 0, 3 );
	     }
  	     else
	       dam *= 0.5;
           }
  	   else*/
 	     dam *= 0.5;
   	 }
	 if (IS_AFFECTED (victim, AFF_PROTECT) && IS_EVIL (ch) && dam > 1)
	    dam -= (dam * 0.25);

      if (dam < 0)
	 dam = 0;

      /*
       * Check for disarm, trip, parry, and dodge.
       */
      if (dt >= TYPE_HIT)
      {

	 if (IS_NPC (ch) && number_percent () < ch->level * 0.5)
	    disarm (ch, victim);
	 /*
	    if ( IS_NPC(ch) && number_percent( ) < ch->level * 0.5 )
	    trip( ch, victim );
	  */

	 if ((IS_CLASS (ch, CLASS_HIGHLANDER))
	     && (IS_DEMPOWER (ch, HPOWER_USE_BYPASS)) && (!BYPASSING))
	 {
	    if ((ch->quickening[0] >= 1) && (dam > 0))
	    {
	       ch->quickening[0] -= 1;	// Auto-Bypass...If they spend 1 quickening.
	       if (number_range (1, 100) < 70)
	       {
		  stc ("#c^#n", ch);
		  BYPASSING = TRUE;
	       }
	       else
	       {
		  BYPASSING = FALSE;
	       }
	    }
	 }


	 if (!BYPASSING)
	 {
            if (check_parry (ch, victim, dt))
	       return;
            if (IS_STANCE (victim, STANCE_CRANE)
		&& victim->stance[STANCE_CRANE] > 100 && !can_counter (ch)
		&& !can_bypass (ch, victim) && check_parry (ch, victim, dt))
	       return;
	    else if (IS_STANCE (victim, STANCE_MANTIS)
		     && victim->stance[STANCE_MANTIS] > 100
		     && !can_counter (ch) && !can_bypass (ch, victim)
		     && check_parry (ch, victim, dt))
	       return;
            if (check_dodge (ch, victim, dt))
	       return;
            if (IS_STANCE (victim, STANCE_MONGOOSE)
		&& victim->stance[STANCE_MONGOOSE] > 100 && !can_counter (ch)
		&& !can_bypass (ch, victim) && check_dodge (ch, victim, dt))
	       return;
	    else if (IS_STANCE (victim, STANCE_SWALLOW)
		     && victim->stance[STANCE_SWALLOW] > 100
		     && !can_counter (ch) && !can_bypass (ch, victim)
		     && check_dodge (ch, victim, dt))
	       return;
	 }
      }

      dam_message (ch, victim, dam, dt);
      if (!IS_NPC (ch) && IS_SET (ch->more, SHORT_COMBAT))
      {
	 ch->amount_damage_dealt += dam;
	 ch->amount_attacks_dealt++;
      }
      if (!IS_NPC (victim) && IS_SET (victim->more, SHORT_COMBAT))
      {
         victim->amount_damage_received += dam;
         victim->amount_attacks_received++;
      }


   }
   hurt_person (ch, victim, dam);
   return;
}

void adv_damage (CHAR_DATA * ch, CHAR_DATA * victim, int dam)
{

	int max_dam = 0;
	max_dam = ch->damcap[DAM_CAP];            // after we update the damcap, let's assign it eh? -- serenity

   if (victim == NULL)
      return;

   if (victim->position == POS_DEAD)
      return;

   if (ch->damcap[DAM_CHANGE] == 1)
   {
      update_damcap (ch, victim);
          max_dam = ch->damcap[DAM_CAP];            // after we update the damcap, let's assign it eh? -- serenity
   }


	if (dam > max_dam)
		dam = max_dam;


   if (victim != ch)
   {
      if (is_safe (ch, victim))
	 return;
      check_killer (ch, victim);

      if (victim->position > POS_STUNNED)
      {
	 if (victim->fighting == NULL)
	    set_fighting (victim, ch);
      }

      if (victim->position > POS_STUNNED)
      {
	 if (ch->fighting == NULL)
	    set_fighting (ch, victim);

	 /*
	  * If victim is charmed, ch might attack victim's master.
	  */
	 if (IS_NPC (ch) && IS_NPC (victim) && IS_AFFECTED (victim, AFF_CHARM)
	     && victim->master != NULL
	     && victim->master->in_room == ch->in_room
	     && number_bits (3) == 0)
	 {
	    stop_fighting (ch, FALSE);
	    multi_hit (ch, victim->master, TYPE_UNDEFINED);
	    return;
	 }
      }

      if (victim->master == ch)
	 stop_follower (victim);


	 if ( (IS_AFFECTED (victim, AFF_SANCTUARY) && dam > 1 ) || ( WORN_ARTIFACT( victim, ARTI_CLOAK_OF_THE_ARCHMAGI ) && dam > 1 ) )
			dam *= 0.5;
		if (IS_AFFECTED (victim, AFF_PROTECT) && IS_EVIL (ch) && dam > 1)
			dam -= (dam * 0.25);
	
		if (dam < 0)
			dam = 0;
   }
   return;
}

void hurt_person (CHAR_DATA * ch, CHAR_DATA * victim, int dam)
{
   bool is_npc = FALSE;
   bool same_room = FALSE;
   bool remote_room = FALSE;
   int old_hp = 0;
   int tierxp = 0;

//    int vnum;
   char buf[MSL];

#ifdef FUCK_PLAYERS
   if (IS_NPC (victim) && !IS_NPC (ch))
      dam /= 1000;
   if (!IS_NPC (ch) && !IS_NPC (victim))
      dam /= 1000;
#endif

   /*
    * Hurt the victim.
    * Inform the victim of his new state.
    */

   if (WORN_ARTIFACT (ch, ARTI_SHATTERED_BLADE))
      dam *= 1.25;
   if (WORN_ARTIFACT (ch, ARTI_DEMONS_HEART))
      dam *= 1.25;
   if (WORN_ARTIFACT (ch, ARTI_LIONS_MANE) && IS_SET(ch->more, MORE_LIONSMANE))
      dam *= 1.25;
   if (WORN_ARTIFACT (ch, ARTI_PLATE_IRON_GAUNTLET))
      dam *= 1.1;
   if (WORN_ARTIFACT (ch, ARTI_METEORIC_AXE))
      dam *= 1.1;
   if (WORN_ARTIFACT (ch, ARTI_CROWN_OF_CHRYSTANCIA))
      dam *= 1.1;

   if (WORN_ARTIFACT (victim, ARTI_GREENLEAF_CLOAK) && !IS_SET (victim->flag2, AFF2_INARENA) &&
      victim->in_room != NULL && victim->in_room->sector_type != SECT_INSIDE &&
      victim->in_room->sector_type != SECT_CITY)
      dam *= 0.75;

   if (WORN_ARTIFACT (victim, ARTI_ARCHANGELS_WING) && number_percent() > 50)
   {
      char buf [MAX_STRING_LENGTH];
      dam = (dam * number_range(1,99)) / 100;
      sprintf (buf, "The Archangel's Wing protects %s and reduces their damage to %d.\n\r", victim->name, dam);
      if (!IS_SET (ch->more, SHORT_COMBAT))
         send_to_char (buf, ch);
      if (!IS_SET (victim->more, SHORT_COMBAT))
         sprintf (buf, "The Archangel's Wing protects you and reduces the damage to %d.\n\r", dam);
      send_to_char (buf, victim);
   }

   if (WORN_ARTIFACT (victim, ARTI_CRYSTAL_SHIELD))
   {
      if (number_range(0,99) < number_range(5,10))
      {
         char buf [MAX_STRING_LENGTH];
         sprintf (buf, "%s uses the Crystal Shield to deflect your hit.\n\r", victim->name);
         if (!IS_SET (ch->more, SHORT_COMBAT))
            send_to_char (buf, ch);
         if (!IS_SET (victim->more, SHORT_COMBAT))
            stc ("You deflect their hit with the Crystal Shield.\n\r", victim);
         dam = 0;
      }
   }

   old_hp = victim->hit;
   victim->hit -= dam;

   if (IS_SET (victim->flag2, AFF2_INARENA) && victim->hit < 0)
      clean_arena (victim, ch);

   if (!IS_NPC (victim) && victim->level >= LEVEL_IMMORTAL && victim->hit < 1)
      victim->hit = 1;
   update_pos (victim);

   switch (victim->position)
   {
   case POS_MORTAL:
      act ("$n is mortally wounded, and spraying blood everywhere.", victim,
	   NULL, NULL, TO_ROOM);
      send_to_char
	 ("You are mortally wounded, and spraying blood everywhere.\n\r",
	  victim);
//MORTAL MESS
      if (!IS_NPC (victim) && !IS_NPC (ch) && ch->mort_count == 0
	  && ch != victim)
      {

	 if (!IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
	 {
	    sprintf (buf, "#r%s #whas been mortally wounded by #r%s at #y%s",
		     victim->name, ch->name,
		     (get_room_index (victim->in_room->vnum))->name);
	    if (old_hp > -5)
	       do_fatality (ch, buf);
//                                      ltf(buf, "mortalwound", FALSE);
	    ch->mort_count = 1;
	 }
      }
      if (WORN_ARTIFACT (victim, ARTI_HEART_OF_DARKNESS) && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
                REMOVE_BIT(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
      if (IS_CLASS (victim, CLASS_DROW)
	  && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
	 REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
      if (IS_CLASS(victim, CLASS_FAE) && IS_KITH (victim, KITH_SLUAGH) && IS_SET(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
         REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
      if (IS_CLASS (victim, CLASS_MONK)
	  && IS_SET (victim->monkstuff, MONK_HEAL))
	 REMOVE_BIT (victim->monkstuff, MONK_HEAL);

      break;

   case POS_INCAP:
      act ("$n is incapacitated, and bleeding badly.", victim, NULL, NULL,
	   TO_ROOM);
      send_to_char ("You are incapacitated, and bleeding badly.\n\r", victim);
      //victim->last_mort = 300;

      break;

   case POS_STUNNED:
      act ("$n is stunned, but will soon recover.", victim, NULL, NULL,
	   TO_ROOM);
      send_to_char ("You are stunned, but will soon recover.\n\r", victim);
      //victim->last_mort = 300;
      break;

   case POS_DEAD:
      act ("$n is DEAD!!", victim, 0, 0, TO_ROOM);
      send_to_char ("You have been KILLED!!\n\r\n\r", victim);
      break;

   default:
      if (dam > victim->max_hit / 4)
	 send_to_char ("That really did #rHURT!\n\r", victim);
      if (victim->hit < victim->max_hit / 4 && dam > 0)
      {
	 if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_VAMPIRE)
	     && number_percent () < victim->beast)
	    vamp_rage (victim);
      }
      break;
   }

   /*
    * Sleep spells and extremely wounded folks.
    */
   if (!IS_AWAKE (victim))
      stop_fighting (victim, FALSE);

   /*
    * Payoff for killing things.
    */
   if (victim->position == POS_DEAD)
   {
      
      group_gain (ch, victim);

      if (!IS_NPC (victim))
      {
	 sprintf (log_buf, "%s killed by %s at %d", victim->name,
		  (IS_NPC (ch) ? ch->short_descr : ch->name),
		  victim->in_room->vnum);
	 log_string (log_buf, ch);
	 wiznet (ch, WIZ_DEATHS, 7, log_buf);
// wiznet
	 /*
	  * Dying penalty:
	  * 1/2 your current exp.
	  */
	 if (victim->exp > 0)
	    victim->exp = victim->exp / 2;
      }
      demon_gain (ch, victim);

      if (IS_NPC (victim) && !IS_NPC (ch))
      {

//	 ch->mkill += 1;
      if ((IS_CLASS(ch, CLASS_DROW) && IS_SET (ch->special, SPC_DROW_CLE)))
      {
        if (ch->cleregen >= 100000) { stc("You have the maximum amount of points stored.\n\r",ch); }
        else { sprintf(buf,"#cYou store#e %d #cpoints from that kill.#n\n\r",victim->level / 2);
        stc(buf,ch);
        ch->cleregen += victim->level / 2; }
      }
  	 if (ch->level == 1 && ch->mkill > 4)
	 {
	    ch->level = 2;
	    do_save (ch, "");
	 }
      }
      if (!IS_NPC (ch) && ch->tier < 250 && IS_NPC(victim) && !IS_SET(victim->act, ACT_NOEXP))
      {
	 tierxp = number_range ((victim->level / 4), victim->level);
	 if ((WizConfig->xpbonus > 1) && (get_hours (ch) >= 6))
	    tierxp = tierxp * WizConfig->xpbonus;
	 ch->tierxp += tierxp;

	 if (ch->tierxp > (ch->tier * 100000))
	 {
	    ch->tierxp = 0;
	    ch->tier++;
	    stc ("#r->^1#wYou gain a Tier!#n#r<-#n\n\r", ch);
	    gainstats (ch);
	 }
      }

      if (IS_NPC (victim))
	 is_npc = TRUE;
      if (victim->in_room == ch->in_room)
	 same_room = TRUE;

      if (IS_CLASS (ch, CLASS_MAGE) && (!same_room) && (is_npc))
      {
	 raw_kill(victim, ch);
	 remote_room = TRUE;
      }
      else
	 raw_kill (victim, ch);
//ok raw kill is here.
      if (same_room)
      {
         OBJ_DATA *payday = NULL;
         bool winner = FALSE;
         if (ch != NULL && ch->in_room != NULL && ch->in_room->contents != NULL)
         for ( payday = ch->in_room->contents; payday != NULL; payday = payday->next_content )
         {
            if (!payday) break;
            if (payday->item_type != 23 && payday->item_type != 24) continue;
            if (payday->contains == NULL) break;
            winner = TRUE;
            break;
         }
         if (winner && IS_SET (ch->act, PLR_AUTOLOOT))
            do_get (ch, "all corpse");
         if (winner && IS_SET (ch->more, PLR_AUTOGOLD))
            do_get (ch, "all.priceless corpse auto");
      }

      if (IS_SET (ch->flag2, LOOKINCORPSE) && same_room)
	 do_look (ch, "in corpse");

      if (!IS_NPC (ch))
      {
	 if (IS_SET (ch->act, PLR_AUTOSAC) && same_room)
         {
            if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DRAGON))
               do_consume (ch, "corpse");
            else
               do_sacrifice (ch, "corpse");
         }
/*
         else if (IS_SET (ch->act, PLR_AUTOSAC) && remote_room)
	 {
	    do_get (ch, "all.priceless corpse auto");
	    do_silent_sacrifice (ch, "corpse");
	 }
*/
      }

/*      if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DRAGON))
      {
	 if (IS_SET (ch->extra2, AUTOCONSUME) && same_room)
	    do_consume (ch, "corpse");
      }*/
      return;
   }

   if (victim == ch)
      return;

   /*
    * Take care of link dead people.
    */
   if (!IS_NPC (victim) && victim->desc == NULL)
   {
      if (number_range (0, victim->wait) == 0)
      {
	 do_flee (victim, " ");
	 return;
      }
   }

   /*
    * Wimp out?
    */
   if (IS_NPC (victim) && dam > 0)
   {
      if ((IS_SET (victim->act, ACT_WIMPY) && number_bits (1) == 0
	   && victim->hit < victim->max_hit / 2)
	  || (IS_AFFECTED (victim, AFF_CHARM) && victim->master != NULL
	      && victim->master->in_room != victim->in_room))
	 do_flee (victim, "");
   }

   if (!IS_NPC (victim) && victim->hit > 0 && victim->hit <= victim->wimpy
       && number_range (0, victim->wait) == 0)
      do_flee (victim, "");

   tail_chain ();
   return;
}

bool newis_safe (CHAR_DATA * ch, CHAR_DATA * victim)
{
   OBJ_DATA *obj;
   OBJ_DATA *obj_next;

   if (ch->trust > LEVEL_BUILDER && ch != victim)
   {
      send_to_char ("You cannot fight if you have implementor powers!\n\r",
		    ch);
      return TRUE;
   }

   if (victim->trust > LEVEL_BUILDER && ch != victim)
   {
      send_to_char ("You cannot fight someone with implementor powers!\n\r",
		    ch);
      return TRUE;
   }
   if (IS_SET (ch->tag_flags, TAG_PLAYING)
       || IS_SET (victim->tag_flags, TAG_PLAYING))
   {
      stc ("Not during a game of Freeze Tag!\n\r", ch);
      return TRUE;
   }

   if (ch->in_room->vnum == ROOM_VNUM_ALOSER
       || ch->in_room->vnum == ROOM_VNUM_AWINNER)
   {
      stc ("Not in the Arena Winner/Loser rooms.\n\r", ch);
      return TRUE;
   }

   if (WORN_ARTIFACT (ch, ARTI_HEART_OF_DARKNESS) && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
      REMOVE_BIT(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (WORN_ARTIFACT (victim, ARTI_HEART_OF_DARKNESS) && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
      REMOVE_BIT(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS (ch, CLASS_DROW)
       && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS (victim, CLASS_DROW)
       && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH) && IS_SET(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
         REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS(victim, CLASS_FAE) && IS_KITH (victim, KITH_SLUAGH) && IS_SET(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
         REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);

   if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->flag2, AFF2_INARENA) && IS_SET(victim->flag2, AFF2_INARENA))
      return FALSE;
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->war, WARRING) && IS_SET (victim->war, WARRING))
      return FALSE;
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->war, JOINING))
   {
      stc ("You are unable to start hostilities just before your war!\n\r", ch);
      return TRUE;
   }
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (victim->war, JOINING))
   {
      stc ("You are unable to start hostilities just before their war!\n\r", ch);
      return TRUE;
   }

   /* Make it so newbies cant be killed by players. */
   if (!IS_NPC (victim) && (get_hours (ch) < 10) && !IS_NPC (ch)
       && (ch != victim) && !IS_SET (ch->extra2, PKREADY))
   {
      stc ("You are unable to attack players untill you reach 10 hours!.\n\r",
	   ch);
      return TRUE;
   }

   if (!IS_NPC (ch) && (get_hours (victim) < 10) && !IS_NPC (victim)
       && (ch != victim) && !IS_SET (victim->extra2, PKREADY))
   {
      stc ("You are unable to attack newbies of under 10 hours!\n\r", ch);
      return TRUE;
   }
   if (!IS_NPC (victim) && nosafe)
   {
      return FALSE;
   }

   if (!IS_NPC (victim) && IS_SET (victim->newbits, NEW_NOTEWRITE))
   {
      stc ("They are posting a note!\n\r", ch);
      return TRUE;
   }
/*
   if ((IS_SET(ch->flag2, AFF2_INARENA) && !IS_SET(victim->flag2,AFF2_INARENA))
         || (IS_SET(victim->flag2, AFF2_INARENA) && !IS_SET(ch->flag2,AFF2_INARENA)))
    {   
        send_to_char( "You cannot interfere with arena battles\n\r", ch );
        return TRUE;
    }      
       
       
*/
   // People with artifacts aren't safe. - Krynn
   for (obj = victim->carrying; obj != NULL; obj = obj_next)
   {
      obj_next = obj->next_content;
      if (IS_SET (obj->quest, QUEST_ARTIFACT))
	 return FALSE;
   }

   /* Ethereal people can only attack other ethereal people */
   if (!IS_NPC (ch) && get_trust (ch) == LEVEL_BUILDER)
   {
      send_to_char ("Don't fight, build.\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC (victim) && get_trust (victim) == LEVEL_BUILDER)
   {
      send_to_char ("They build, not fight.\n\r", ch);
      return TRUE;
   }

   if (IS_AFFECTED (ch, AFF_ETHEREAL) && !IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      send_to_char ("You cannot while ethereal.\n\r", ch);
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_ETHEREAL) && IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      send_to_char ("You cannot fight an ethereal person.\n\r", ch);
      return TRUE;
   }
   /* You cannot attack across planes */
   if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && !IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("You are too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("$E is too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }
   if (IS_HEAD (ch, LOST_HEAD) || IS_EXTRA (ch, EXTRA_OSWITCH))
   {
      send_to_char ("Objects cannot fight!\n\r", ch);
      return TRUE;
   }
   else if (IS_HEAD (victim, LOST_HEAD) || IS_EXTRA (victim, EXTRA_OSWITCH))
   {
      send_to_char ("You cannot attack an object.\n\r", ch);
      return TRUE;
   }
//EARTHMELD CHECK
   if (!IS_NPC (ch) && IS_EXTRA (ch, EXTRA_EARTHMELD))
      return TRUE;

   if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_EARTHMELD))
      return TRUE;

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return TRUE;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return TRUE;
   }

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD))
   {
      send_to_char ("You cannot attack while in Majesty.\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_STEELSHIELD))
   {
      send_to_char ("They are far to imposing.\n\r", ch);
      return TRUE;
   }
   /* Thx Josh! */
   if (victim->fighting == ch)
      return FALSE;

   /* You might be attacking them while they attack someone else */
   if (ch->fighting == victim)
      return FALSE;

   // People with artifacts aren't safe. - Krynn
   for (obj = victim->carrying; obj != NULL; obj = obj_next)
   {
      obj_next = obj->next_content;
      if (IS_SET (obj->quest, QUEST_ARTIFACT))
	 return FALSE;
   }
   /* Deal with safe rooms (either you or they are in one) */
   if (ch->in_room == NULL || victim->in_room == NULL
       || IS_SET (ch->in_room->room_flags, ROOM_SAFE)
       || IS_SET (victim->in_room->room_flags, ROOM_SAFE))
   {
      /* REASONING:
       * If you're in a safe room, you cannot attack someone if:
       * 1) They have no fight timer, AND:
       * 2) They do not have an artifact.
       * If either (or both) of the above statements are not true (ie
       * they DO have a fight timer, and/or they have an artifact) then
       * the safe room does not make them safe.
       *
       * The reverse logic is necessary because you cannot simply
       * return at this point - artifacts and fight timers ONLY
       * affect combat within safe rooms.  If you returned FALSE for
       * people with fight timers and artifacts, that would allow 
       * newbies to attack people with artifacts as long as they
       * were in safe rooms at the time!
       *
       * Note another interesting side affect is that the banner of
       * peace will now make you safe anywhere OTHER than safe rooms.
       */
      if (victim->fight_timer <= 0 && !IS_ITEMAFF (victim, ITEMA_ARTIFACT))
      {
	 send_to_char
	    ("Something in the air prevents you from attacking.\n\r", ch);
	 return TRUE;
      }
   }

   if (IS_ITEMAFF (ch, ITEMA_PEACE))
   {
      send_to_char ("You are unable to attack them.\n\r", ch);
      return TRUE;
   }

// Majesty CHECK
   if (!IS_NPC (victim))
   {
      CHAR_DATA *rch;

      for (rch = ch->in_room->people; rch; rch = rch->next_in_room)
      {
	 if (IS_CLASS (rch, CLASS_FAE) && !IS_NPC (rch)
	     && IS_SET (rch->extra2, EXTRA2_NEUTRAL) && rch->fight_timer <= 0)
	 {
	    send_to_char
	       ("Something in the air prevents your from attackin.\n\r", ch);
	    return TRUE;
	 }
      }
   }

   if (IS_NPC (ch) || IS_NPC (victim))
      return FALSE;


   if ((!CAN_PK (ch) || !CAN_PK (victim)) && ch != victim)
   {
      send_to_char ("Mortals are not permitted to fight other players.\n\r",
		    ch);
      return TRUE;
   }

   if (ch != victim && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF(ch, VAM_MORTAL))
       && IS_SET (ch->special, SPC_INCONNU)
       && (IS_CLASS (victim, CLASS_VAMPIRE)
	   || IS_VAMPAFF (victim, VAM_MORTAL)))
   {
      send_to_char ("You cannot attack another vampire.\n\r", ch);
      return TRUE;
   }
   else if (ch != victim && (IS_CLASS (victim, CLASS_VAMPIRE) || IS_VAMPAFF(victim, VAM_MORTAL))
       && IS_SET (victim->special, SPC_INCONNU)
       && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF (ch, VAM_MORTAL)))
   {
      send_to_char ("You cannot attack a member of the Inconnu.\n\r", ch);
      return TRUE;
   }

   return FALSE;
}

bool is_safe (CHAR_DATA * ch, CHAR_DATA * victim)
{
   OBJ_DATA *obj;
   OBJ_DATA *obj_next;
/*
if (victim->fighting == ch) return FALSE;
if (ch->fighting == victim) return FALSE;
*/
   if (ch->trust > LEVEL_BUILDER && !IS_NPC(victim) && ch != victim)
   {
      send_to_char ("You cannot fight if you have implementor powers!\n\r",
		    ch);
      return TRUE;
   }

   if (victim->trust > LEVEL_BUILDER && !IS_NPC(ch) && ch != victim)
   {
      send_to_char ("You cannot fight someone with implementor powers!\n\r",
		    ch);
      return TRUE;
   }
   /* Ethereal people can only attack other ethereal people */

   if (IS_AFFECTED (ch, AFF_ETHEREAL) && !IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      send_to_char ("You cannot while ethereal.\n\r", ch);
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_ETHEREAL) && IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      send_to_char ("You cannot fight an ethereal person.\n\r", ch);
      return TRUE;
   }

   /* You cannot attack across planes */
   if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && !IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("You are too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("$E is too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }
   if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && !IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("You are too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("$E is too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }

   if (IS_NPC (victim) && IS_SET (victim->act, ACT_NO_KILL))
   {
      stc ("You are unable to attack them!\n\r", ch);
      return TRUE;
   }
   if (IS_NPC (victim) && (victim->pIndexData->vnum == 3145))
   {
      stc ("You are unable to attack them!\n\r", ch);
      return TRUE;
   }
   if (IS_SET (victim->more, MORE_JAIL))
   {
      stc ("They are in Jail\n\r", ch);
      return TRUE;
   }

   if (IS_SET (ch->tag_flags, TAG_PLAYING)
       || IS_SET (victim->tag_flags, TAG_PLAYING))
   {
      stc ("Not during a game of Freeze Tag!\n\r", ch);
      return TRUE;
   }
   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      stc ("You cannot interfere with wars!\n\r", ch);
      return TRUE;
   }
   if ((IS_SET (ch->flag2, AFF2_INARENA)
	&& !IS_SET (victim->flag2, AFF2_INARENA))
       || (IS_SET (victim->flag2, AFF2_INARENA)
	   && !IS_SET (ch->flag2, AFF2_INARENA)))
   {
      send_to_char ("You cannot interfere with arena battles\n\r", ch);
      return TRUE;
   }

   if (WORN_ARTIFACT (ch, ARTI_HEART_OF_DARKNESS) && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
      REMOVE_BIT(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (WORN_ARTIFACT (victim, ARTI_HEART_OF_DARKNESS) && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
      REMOVE_BIT(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS (ch, CLASS_DROW)
       && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS (victim, CLASS_DROW)
       && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH) && IS_SET(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
         REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS(victim, CLASS_FAE) && IS_KITH (victim, KITH_SLUAGH) && IS_SET(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
         REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);

   if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->flag2, AFF2_INARENA) && IS_SET(victim->flag2, AFF2_INARENA))
      return FALSE;
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->war, WARRING) && IS_SET (victim->war, WARRING))
      return FALSE;
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->war, JOINING))
   {
      stc ("You are unable to start hostilities just before your war!\n\r", ch);
      return TRUE;
   }
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (victim->war, JOINING))
   {
      stc ("You are unable to start hostilities just before their war!\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC(victim) && !victim->desc && victim->pcdata->login_timer > 0 && victim->fight_timer < 1 && ( victim != ch ) && !IS_NPC(ch) )
   {
	stc("Not with a login timer!\n\r", ch);
	return TRUE;
   }
/*
   if (!IS_NPC(victim) && (victim->pcdata->login_timer > 0) && ( victim != ch ) && !IS_NPC(ch) )
   {
	stc("Not with a login timer!\n\r", ch);
	return TRUE;
   }
   if (!IS_NPC(ch) && (ch->pcdata->login_timer > 0) && ( victim != ch )&& !IS_NPC(victim) )
   {
	stc("Not with a login timer!\n\r", ch);
	return TRUE;
   }
*/
   if (!IS_NPC(victim) && (victim->pcdata->pkill_timer > 0) && ( victim != ch ) && !IS_NPC(ch) )
   {
	stc("You are unable to attack them as they have a Safe Timer!\n\r", ch);
	return TRUE;
   }
   if (!IS_NPC(ch) && (ch->pcdata->pkill_timer > 0) && ( victim != ch )&& !IS_NPC(victim) )
   {
	stc("You are unable to attack them with a Safe Timer!\n\r", ch);
	return TRUE;
   }
   if (!IS_NPC (victim) && IS_SET (ch->extra2, NHELPER) && (victim != ch))
   {
      if (IS_SET (ch->flag2, AFF2_INARENA)
	  && (IS_SET (victim->flag2, AFF2_INARENA)))
      {
	 // do nothing
      }
      else if (IS_SET (victim->war, WARRING) && IS_SET (ch->war, WARRING))
      {
	 // do nothing
      }
      else
      {
	 stc ("You are unable to attack them!\n\r", ch);
	 return TRUE;
      }
   }
   if (!IS_NPC (ch) && IS_SET (victim->extra2, NHELPER) && (victim != ch))
   {
      if (IS_SET (ch->flag2, AFF2_INARENA)
	  && (IS_SET (victim->flag2, AFF2_INARENA)))
      {
	 // do nothing
      }
      else if (IS_SET (victim->war, WARRING) && IS_SET (ch->war, WARRING))
      {
	 // do nothing
      }
      else
      {
	 stc ("You are unable to attack them!\n\r", ch);
	 return TRUE;
      }
   }


   if (!IS_NPC (ch) && ch->level < 3 && !IS_NPC (victim) && (ch != victim))
   {
      stc ("You must be an avatar to fight other avatars!\n\r", ch);
      return TRUE;
   }

   /* Make it so newbies cant be killed by players. */
   if (!IS_NPC (victim) && (get_hours (ch) < 10) && !IS_NPC (ch)
       && (ch != victim) && !IS_SET (ch->extra2, PKREADY))
   {
      stc ("You are unable to attack players untill you reach 10 hours!.\n\r",
	   ch);
      return TRUE;
   }

   if (!IS_NPC (ch) && (get_hours (victim) < 10) && !IS_NPC (victim)
       && (ch != victim) && !IS_SET (victim->extra2, PKREADY))
   {
      stc ("You are unable to attack newbies of under 10 hours!\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC (victim) && !IS_NPC (ch) && (victim->level < 3)
       && (ch != victim))
   {
      stc ("They must be an avatar!\n\r", ch);
      return TRUE;
   }
   if (!IS_NPC (victim) && nosafe)
   {
      return FALSE;
   }

   if (!IS_NPC (victim) && IS_SET (victim->newbits, NEW_NOTEWRITE))
   {
      stc ("They are posting a note!\n\r", ch);
      return TRUE;
   }

   if (IS_ITEMAFF (ch, ITEMA_PEACE))
   {
      send_to_char ("You are unable to attack them.\n\r", ch);
      return TRUE;
   }

   if (IS_ITEMAFF (victim, ITEMA_PEACE))
   {
      send_to_char ("You can't seem to attack them.\n\r", ch);
      return TRUE;
   }

   // People with artifacts aren't safe. - Krynn
   for (obj = victim->carrying; obj != NULL; obj = obj_next)
   {
      obj_next = obj->next_content;
      if (IS_SET (obj->quest, QUEST_ARTIFACT))
	 return FALSE;
   }
/*
    if ( IS_SET(ch->in_room->room_flags,ROOM_SAFE) )
    {
	send_to_char( "You cannot fight in a safe room.\n\r", ch );
	return TRUE;
    }
*/
   /* Deal with safe rooms (either you or they are in one) */

   if (!ch || !victim)
      return TRUE;
   if (!ch->in_room || !victim->in_room)
      return TRUE;
   if (ch->in_room == NULL || victim->in_room == NULL
       || IS_SET (ch->in_room->room_flags, ROOM_SAFE)
       || IS_SET (victim->in_room->room_flags, ROOM_SAFE))
   {
      if (IS_NPC (victim))
      {
	 stc ("Something in the air prevents you from attacking!\n\r", ch);
	 return TRUE;
      }

      else if ( /*!IS_NPC(victim) && */ victim->fight_timer <= 0
	       && !IS_ITEMAFF (victim, ITEMA_ARTIFACT))
      {
	 send_to_char
	    ("Something in the air prevents you from attacking!!\n\r", ch);
	 return TRUE;
      }

   }
   if (!IS_NPC (victim))
   {
      CHAR_DATA *rch;

      for (rch = ch->in_room->people; rch; rch = rch->next_in_room)
      {
	 if (IS_CLASS (rch, CLASS_FAE) && !IS_NPC (rch)
	     && IS_SET (rch->extra2, EXTRA2_NEUTRAL) && rch->fight_timer <= 0)
	 {
	    send_to_char
	       ("Something in the air prevents your from attackin.\n\r", ch);
	    return TRUE;
	 }
      }
   }

   if (IS_HEAD (ch, LOST_HEAD) || IS_EXTRA (ch, EXTRA_OSWITCH))
   {
      send_to_char ("Objects cannot fight!\n\r", ch);
      return TRUE;
   }
   else if (IS_HEAD (victim, LOST_HEAD) || IS_EXTRA (victim, EXTRA_OSWITCH))
   {
      send_to_char ("You cannot attack an object.\n\r", ch);
      return TRUE;
   }

   if (IS_NPC (ch) || IS_NPC (victim))
      return FALSE;

   /* Thx Josh! */
   if (victim->fighting == ch)
      return FALSE;

   if (ch->fighting == victim)
      return FALSE;

   if (!IS_NPC (ch) && IS_EXTRA (ch, EXTRA_EARTHMELD))
      return TRUE;

   if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_EARTHMELD))
      return TRUE;

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return TRUE;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return TRUE;
   }

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD))
   {
      send_to_char ("You cannot attack while in Majesty.\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_STEELSHIELD))
   {
      send_to_char ("They are far to imposing.\n\r", ch);
      return TRUE;
   }


   if ((!CAN_PK (ch) || !CAN_PK (victim)) && ch != victim)
   {
      send_to_char ("Mortals are not permitted to fight other players.\n\r",
		    ch);
      return TRUE;
   }

   if (ch != victim && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF(ch, VAM_MORTAL))
       && IS_SET (ch->special, SPC_INCONNU)
       && (IS_CLASS (victim, CLASS_VAMPIRE)
       || IS_VAMPAFF (victim, VAM_MORTAL)))
   {
      send_to_char ("You cannot attack another vampire.\n\r", ch);
      return TRUE;
   }
   else if (ch != victim && (IS_CLASS (victim, CLASS_VAMPIRE) || IS_VAMPAFF(victim, VAM_MORTAL))
       && IS_SET (victim->special, SPC_INCONNU)
       && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF (ch, VAM_MORTAL)))
   {
      send_to_char ("You cannot attack a member of the Inconnu.\n\r", ch);
      return TRUE;
   }

   return FALSE;
}

bool no_attack (CHAR_DATA * ch, CHAR_DATA * victim)
{
   OBJ_DATA *obj;
   OBJ_DATA *obj_next;

   if (!IS_NPC (ch))
   {
      if (ch->pcdata->obj_vnum != 0)
      {
	 stc ("Objects can't fight.\n\r", ch);
	 stc ("Objects can't fight.\n\r", victim);
	 return TRUE;
      }
   }
   if (!IS_NPC (victim))
   {
      if (victim->pcdata->obj_vnum != 0)
      {
	 stc ("Objects can't fight.\n\r", ch);
	 stc ("Objects can't fight.\n\r", victim);
	 return TRUE;
      }
   }
   if (IS_NPC (victim) && IS_SET (ch->act, ACT_NO_KILL))
   {
      stc ("You are unable to attack them!\n\r", ch);
      return TRUE;
   }
   /* Ethereal people can only attack other ethereal people */
   if (IS_AFFECTED (ch, AFF_ETHEREAL) && !IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      send_to_char ("You cannot while ethereal.\n\r", ch);
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_ETHEREAL) && IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      send_to_char ("You cannot fight an ethereal person.\n\r", ch);
      return TRUE;
   }

   /* You cannot attack across planes */
   if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && !IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("You are too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      act ("$E is too insubstantial!", ch, NULL, victim, TO_CHAR);
      return TRUE;
   }

   if (WORN_ARTIFACT (ch, ARTI_HEART_OF_DARKNESS) && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
      REMOVE_BIT(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (WORN_ARTIFACT (victim, ARTI_HEART_OF_DARKNESS) && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
      REMOVE_BIT(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS (ch, CLASS_DROW)
       && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS (victim, CLASS_DROW)
       && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH) && IS_SET(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
         REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
   else if (IS_CLASS(victim, CLASS_FAE) && IS_KITH (victim, KITH_SLUAGH) && IS_SET(victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
         REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);

   if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->flag2, AFF2_INARENA) && IS_SET(victim->flag2, AFF2_INARENA))
      return FALSE;
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->war, WARRING) && IS_SET (victim->war, WARRING))
      return FALSE;
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (ch->war, JOINING))
   {
      stc ("You are unable to start hostilities just before your war!\n\r", ch);
      return TRUE;
   }
   else if (!IS_NPC(ch) && !IS_NPC(victim) && IS_SET (victim->war, JOINING))
   {
      stc ("You are unable to start hostilities just before their war!\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC (ch) && ch->level < 3 && !IS_NPC (victim))
   {
      stc ("You must be an avatar to fight other avatars!\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC (victim) && !IS_NPC (ch) && victim->level < 3)
   {
      stc ("They must be an avatar!\n\r", ch);
      return TRUE;
   }
   if (!IS_NPC (victim) && nosafe)
   {
      return FALSE;
   }
/*
    if ( victim->fight_timer > 0 )
      return FALSE;
*/

   // People with artifacts aren't safe. - Krynn
   for (obj = victim->carrying; obj != NULL; obj = obj_next)
   {
      obj_next = obj->next_content;
      if (IS_SET (obj->quest, QUEST_ARTIFACT))
	 return FALSE;
   }

/* Old Code
    if ( IS_SET(ch->in_room->room_flags,ROOM_SAFE) )
    {
	send_to_char( "You cannot fight in a safe room.\n\r", ch );
	return TRUE;
    }
*/
   if (!ch || !victim)
      return TRUE;
   if (ch->in_room == NULL || victim->in_room == NULL
       || IS_SET (ch->in_room->room_flags, ROOM_SAFE)
       || IS_SET (victim->in_room->room_flags, ROOM_SAFE))
   {
      if (!IS_NPC (victim)
	  || (victim->fight_timer <= 0
	      && !IS_ITEMAFF (victim, ITEMA_ARTIFACT)))
      {
	 send_to_char
	    ("Something in the air prevents you from attacking!!!\n\r", ch);
	 return TRUE;
      }
   }
   if (!IS_NPC (ch) && IS_EXTRA (ch, EXTRA_EARTHMELD))
      return TRUE;

   if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_EARTHMELD))
      return TRUE;

//    if (!IS_NPC(ch) && IS_AFFECTED(ch, AFF_SAFE) )

   if (IS_HEAD (ch, LOST_HEAD) || IS_EXTRA (ch, EXTRA_OSWITCH))
   {
      send_to_char ("Objects cannot fight!\n\r", ch);
      return TRUE;
   }
   else if (IS_HEAD (victim, LOST_HEAD) || IS_EXTRA (victim, EXTRA_OSWITCH))
   {
      send_to_char ("You cannot attack objects.\n\r", ch);
      return TRUE;
   }

   if (!IS_NPC(ch) && !IS_NPC(victim)
       && ch != victim
       && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF(ch, VAM_MORTAL))
       && IS_SET (ch->special, SPC_INCONNU)
       && (IS_CLASS (victim, CLASS_VAMPIRE)
	   || IS_VAMPAFF (victim, VAM_MORTAL)))
   {
      send_to_char ("You cannot attack another vampire.\n\r", ch);
      return TRUE;
   }
   else if (!IS_NPC(ch) && !IS_NPC(victim)
       && ch != victim
       && (IS_CLASS (victim, CLASS_VAMPIRE) || IS_VAMPAFF(victim, VAM_MORTAL))
       && IS_SET (victim->special, SPC_INCONNU)
       && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF (ch, VAM_MORTAL)))
   {
      send_to_char ("You cannot attack a member of the Inconnu.\n\r", ch);
      return TRUE;
   }

   return FALSE;
}

/*
 * See if an attack justifies a KILLER flag.
 */
void check_killer (CHAR_DATA * ch, CHAR_DATA * victim)
{
   /*
    * Follow charm thread to responsible character.
    * Attacking someone's charmed char is hostile!
    */
   while (IS_AFFECTED (victim, AFF_CHARM) && victim->master != NULL)
      victim = victim->master;

   /*
    * NPC's are fair game.
    * So are killers and thieves.
    */
   if (IS_NPC (victim))
      return;

   /*
    * Charm-o-rama.
    */
   if (IS_SET (ch->affected_by, AFF_CHARM))
   {
      if (ch->master == NULL)
      {
	 affect_strip (ch, gsn_charm_person);
	 REMOVE_BIT (ch->affected_by, AFF_CHARM);
	 return;
      }
      stop_follower (ch);
      return;
   }
   return;
}

/*
 * Check for parry.
 */
bool check_parry (CHAR_DATA * ch, CHAR_DATA * victim, int dt)
{
   OBJ_DATA *obj = NULL;
   int chance = 0;
   int thingy;
   bool fist = FALSE;
   bool claws = FALSE;
   bool hands = FALSE;

   if (!IS_AWAKE (victim))
      return FALSE;

   else if (IS_CLASS (victim, CLASS_WEREWOLF) && victim->gifts[AHROUN] >= 2
	    && IS_VAMPAFF (victim, VAM_CLAWS)
	    && get_eq_char (victim, WEAR_WIELD) == NULL
            && get_eq_char (victim, WEAR_HOLD) == NULL
            && get_eq_char (victim, WEAR_DUAL) == NULL)
   {
      obj = NULL;
      claws = TRUE;
   }
   else if (IS_CLASS (victim, CLASS_DRAGON)
	    && get_eq_char (victim, WEAR_WIELD) == NULL
            && get_eq_char (victim, WEAR_HOLD) == NULL
            && get_eq_char (victim, WEAR_DUAL) == NULL)
   {
      obj = NULL;
      claws = TRUE;
   }
   else if (IS_CLASS (victim, CLASS_MONK)
	    && IS_SET (victim->newbits, NEW_MONKADAM)
	    && get_eq_char (victim, WEAR_WIELD) == NULL
            && get_eq_char (victim, WEAR_HOLD) == NULL
            && get_eq_char (victim, WEAR_DUAL) == NULL)
   {
      obj = NULL;
      hands = TRUE;
   }

   else if (IS_CLASS (victim, CLASS_NINJA)
	    && IS_SET (victim->more, MORE_STEELFISTS)
	    && get_eq_char (victim, WEAR_WIELD) == NULL
            && get_eq_char (victim, WEAR_HOLD) == NULL
            && get_eq_char (victim, WEAR_DUAL) == NULL)
   {
      obj = NULL;
      fist = TRUE;
   }
   else if (!IS_NPC(victim) && !IS_CLASS (victim, CLASS_WEREWOLF)
	    && IS_VAMPAFF (victim, VAM_CLAWS)
	    && get_eq_char (victim, WEAR_WIELD) == NULL
            && get_eq_char (victim, WEAR_HOLD) == NULL
            && get_eq_char (victim, WEAR_DUAL) == NULL)
   {
      obj = NULL;
      claws = TRUE;
   }


   else
   {
        if ((obj = get_eq_char(victim, WEAR_DUAL)) == NULL)
        {

      if ((obj = get_eq_char (victim, WEAR_WIELD)) == NULL
	  || obj->item_type != ITEM_WEAPON)
      {
	 if ((obj = get_eq_char (victim, WEAR_HOLD)) == NULL
	     || obj->item_type != ITEM_WEAPON)
             if ((obj = get_eq_char (victim, WEAR_DUAL)) == NULL
                 || obj->item_type != ITEM_WEAPON)
                return FALSE;
      }
        }

   }

   if (obj && dt == 1000)
      return FALSE;
   if (dt < 1000 || dt > 1012)
      return FALSE;

   if (!IS_NPC (ch))
      chance -= (ch->wpn[dt - 1000] * 0.1);
   else
      chance -= (ch->level * 0.2);

   chance -= (char_hitroll (ch) * 0.1);

   if (!IS_NPC (ch))
   {
      if (IS_CLASS (ch, CLASS_VAMPIRE))
      {
         if (get_disc(ch, VAM_CELE) > 0)
            chance -= (4 * get_disc(ch, VAM_CELE));
      }

      if (IS_CLASS (ch, CLASS_NINJA))
      {
	 if (ch->pcdata->powers[NPOWER_CHIKYU] >= 6
	     && ch->pcdata->powers[HARA_KIRI] > 0)
            chance -= 10;
	 if (ch->pcdata->powers[NPOWER_CHIKYU] > 2)
            chance -= 10;
	 if (ch->pcdata->powers[NINJAKI] > 4)
	    chance -= (ch->pcdata->powers[NINJAKI] / 4);
      }
      if (IS_CLASS (ch, CLASS_DEMON))
      {
	 if (IS_DEMPOWER (ch, DEM_SPEED))
	 {
	    if (IS_SET (ch->special, SPC_DEMON_LORD))
	       chance -= 30;
	    else if (IS_SET (ch->special, SPC_PRINCE))
	       chance -= 25;
	    else if (IS_SET (ch->special, SPC_SIRE))
	       chance -= 20;
	    else
	       chance -= 15;
	 }
         if (!IS_SET (ch->warp, WARP_QUICKNESS))
            chance -= 10;
      }
      if (IS_CLASS (ch, CLASS_FAE))
      {
	 if (IS_SET (ch->extra2, EXTRA2_FAESPEED))
	    chance -= 20;
      }
      if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DRAGON))
      {
         chance -= (GET_AGE(ch) * 2);
      }

      if (IS_CLASS (ch, CLASS_MAGE))
      {
	 if (IS_SET (ch->mflags, MAGE_POLYAPPEAR))
	    chance -= 15;
	 if (ch->spheres[MTIM] > 0)
            chance -= (ch->spheres[MTIM] * 2);
      }

      if (IS_CLASS (ch, CLASS_DROW))
      {
	 if (IS_SET (ch->pcdata->powers[1], DPOWER_ARMS))
	    chance -= 20;
         if (IS_SET (ch->pcdata->powers[1], DPOWER_SPEED))
            chance -= 20;
      }
        if ( IS_CLASS(ch, CLASS_WRAITH))
        {
        chance -= 20;
        }
      if (IS_CLASS (ch, CLASS_WEREWOLF))
      {
	 if (IS_SET (ch->special, SPC_WOLFMAN))
	    chance -= 5;
	 if (ch->gifts[SILENTSTRIDERS] > 0)
	    chance -= 5;
	 if (ch->gifts[SILENTSTRIDERS] > 1)
            chance -= 5;
	 if (ch->gifts[SILENTSTRIDERS] > 2)
            chance -= 5;
	 if (ch->gifts[STARGAZERS] > 3)
	    chance -= 5;
      }
      if (IS_CLASS (ch, CLASS_MONK))
      {
	 if (ch->chi[CURRENT] > 0)
            chance -= (ch->chi[CURRENT] * 4);
      }
      if (IS_CLASS (ch, CLASS_HIGHLANDER))
      {
	 if (get_eq_char (ch, WEAR_DUAL) != NULL)
	    chance -= ch->race * 2 / 3;
      }
   }

   /* Some shit for Earth Embrace )Mage Power(, works on NPC's.. */
   if (IS_SET (ch->mflags, MAGE_EMBRACED2))
      chance -= 10;
   if (IS_SET (ch->mflags, MAGE_EMBRACED1))
      chance -= 5;

   if (!IS_NPC (victim))
      chance += (victim->wpn[dt - 1000] * 0.5);
   else
      chance += victim->level;

   if (IS_STANCE (victim, STANCE_CRANE)
       && victim->stance[STANCE_CRANE] > 0 && !can_counter (ch)
       && !can_bypass (ch, victim))
      chance += (victim->stance[STANCE_CRANE] * 0.25);
   else if (IS_STANCE (victim, STANCE_MANTIS)
	    && victim->stance[STANCE_MANTIS] > 0 && !can_counter (ch)
	    && !can_bypass (ch, victim))
      chance += (victim->stance[STANCE_MANTIS] * 0.25);

   if (claws || hands || fist)
      chance += (char_hitroll (victim) * 0.075);
   else
      chance += (char_hitroll (victim) * 0.1);

   /* Some shit for Earth Embrace )Mage Power(, works on NPC's.. */
   if (IS_SET (victim->mflags, MAGE_EMBRACED2))
      chance += 10;
   if (IS_SET (victim->mflags, MAGE_EMBRACED1))
      chance += 5;

   if (!IS_NPC (victim))
   {
      if (IS_CLASS (victim, CLASS_VAMPIRE))
      {
         if (get_disc(victim, VAM_CELE) > 0)
            chance += (4 * get_disc(victim, VAM_CELE));
      }
      if (IS_CLASS (victim, CLASS_NINJA))
      {
	 if (victim->pcdata->powers[NPOWER_CHIKYU] >= 6
	     && victim->pcdata->powers[HARA_KIRI] > 0)
            chance += 10;
	 if (victim->pcdata->powers[NPOWER_CHIKYU] > 2)
            chance += 10;
	 if (victim->pcdata->powers[NINJAKI] > 4)
	    chance += (victim->pcdata->powers[NINJAKI] / 4);
      }
      if (IS_CLASS (victim, CLASS_DEMON))
      {
	 if (IS_DEMPOWER (victim, DEM_SPEED))
	 {
	    if (IS_SET (victim->special, SPC_DEMON_LORD))
	       chance += 30;
	    else if (IS_SET (victim->special, SPC_PRINCE))
	       chance += 25;
	    else if (IS_SET (victim->special, SPC_SIRE))
	       chance += 20;
	    else
	       chance += 15;
	 }
      }
      if (IS_CLASS (victim, CLASS_FAE))
      {
	 if (IS_SET (victim->extra2, EXTRA2_FAESPEED))
            chance += 20;
      }
      if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_DRAGON))
      {
         chance += (GET_AGE(victim) * 2);
      }
      if (IS_CLASS (victim, CLASS_DROW))
      {
	 if (IS_SET (victim->pcdata->powers[1], DPOWER_ARMS))
            chance += 10;
         if (IS_SET (victim->pcdata->powers[1], DPOWER_SPEED))
            chance += 15;
      }
      if (IS_CLASS (victim, CLASS_MAGE))
      {
	 if (IS_SET (victim->mflags, MAGE_POLYAPPEAR))
	    chance += 15;
	 if (victim->spheres[MTIM] > 0)
	    chance += (victim->spheres[MTIM] * 2);
      }
      if (IS_CLASS (victim, CLASS_MONK))
      {
	 if (victim->chi[CURRENT] > 0)
            chance += (victim->chi[CURRENT] * 4);
      }
        if ( IS_CLASS(victim, CLASS_WRAITH))
        {
        chance += 20;
        }
      if (IS_CLASS (victim, CLASS_WEREWOLF))
      {
	 if (IS_SET (victim->special, SPC_WOLFMAN))
	    chance += 5;
	 if (victim->gifts[SILENTSTRIDERS] > 0)
	    chance += 5;
	 if (victim->gifts[SILENTSTRIDERS] > 1)
            chance += 5;
	 if (victim->gifts[SILENTSTRIDERS] > 2)
            chance += 5;
	 if (victim->gifts[STARGAZERS] > 3)
	    chance += 5;
      }
      if (IS_CLASS (victim, CLASS_HIGHLANDER))
      {
	 if (get_eq_char (victim, WEAR_DUAL) != NULL)
	    chance += ch->race * 2 / 3;
      }

   }

   if (!IS_NPC (ch) && get_disc(ch, VAM_CELE) > 0
       && IS_CLASS (ch, CLASS_VAMPIRE))
   {
      if (ch->pcdata->rank == AGE_METHUSELAH)
         chance -= 15;
      else if (ch->pcdata->rank == AGE_ELDER)
         chance -= 10;
      else if (ch->pcdata->rank == AGE_ANCILLA)
         chance -= 5;
   }
   if (!IS_NPC (victim) && get_disc(victim, VAM_CELE) > 0
       && IS_CLASS (victim, CLASS_VAMPIRE))
   {
      if (victim->pcdata->rank == AGE_METHUSELAH)
         chance += 15;
      else if (victim->pcdata->rank == AGE_ELDER)
         chance += 10;
      else if (victim->pcdata->rank == AGE_ANCILLA)
         chance += 5;
   }
   if (IS_NPC (victim))
   {
      if (victim->level < 100)
	 chance = 15;
      if (victim->level >= 100)
	 chance = (victim->level * .01);
      if (victim->level >= 500)
	 chance = 50;
   }
   if (IS_SUPER_NPC (ch))
      chance -= ch->level / 50;
   if (IS_SUPER_NPC (victim))
      chance += victim->level / 50;

   if (chance > 75)
      chance = 75;
   else if (chance < 25)
      chance = 25;

   thingy = number_range (1, 100);

   if (thingy >= chance)
      return FALSE;

   if (IS_SET (ch->extra2, DROW_FIGHTDANCE)
       && IS_CLASS (ch, CLASS_DROW)
       && number_percent () >= 50
       &&
       (((obj
	  = get_eq_char (ch, WEAR_WIELD)) != NULL && (obj->value[3] == 4
						      || obj->value[3] == 11))
	|| ((obj = get_eq_char (ch, WEAR_HOLD)) != NULL
            && (obj->value[3] == 4 || obj->value[3] == 11))
        || ((obj = get_eq_char (ch, WEAR_DUAL)) != NULL
	    && (obj->value[3] == 4 || obj->value[3] == 11))))
   {
      act ("$n's dark weapon dances around your defences, making a strange sound.", ch, NULL, victim, TO_VICT);
      act ("Your sacrificial weapon hums in the air as it dances $N's defences.", ch, obj, victim, TO_CHAR);
      return FALSE;
   }
   if (claws)
   {
      if (IS_NPC (victim) || !IS_SET (victim->act, PLR_BRIEF))
	 act ("You parry $n's blow with your claws.", ch, NULL, victim,
	      TO_VICT);
      if (IS_NPC (ch) || !IS_SET (ch->act, PLR_BRIEF))
	 act ("$N parries your blow with $S claws.", ch, NULL, victim,
	      TO_CHAR);
      return TRUE;
   }
   if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_MONK)
       && victim->monkblock < 150)
      victim->monkblock++;

   if (hands)
   {
      if (IS_NPC (victim) || !IS_SET (victim->act, PLR_BRIEF))
	 act ("You parry $n's blow with your adamantium hands.", ch, NULL,
	      victim, TO_VICT);
      if (IS_NPC (ch) || !IS_SET (ch->act, PLR_BRIEF))
	 act ("$N parries your blow with $S adamantium hands.", ch, NULL,
	      victim, TO_CHAR);
      return TRUE;
   }
   if (fist)
   {
      if (IS_NPC (victim) || !IS_SET (victim->act, PLR_BRIEF))
	 act ("You parry $n's blow with your iron fists.", ch, NULL, victim,
	      TO_VICT);
      if (IS_NPC (ch) || !IS_SET (ch->act, PLR_BRIEF))
	 act ("#p$N parries your blow with $S iron fists.", ch, NULL, victim,
	      TO_CHAR);
      return TRUE;
   }

   if (!IS_NPC (victim) && obj != NULL && obj->item_type == ITEM_WEAPON
       && obj->value[3] >= 0 && obj->value[3] <= 12)
   {
      if (IS_NPC (victim) || !IS_SET (victim->act, PLR_BRIEF))
	 act ("You parry $n's blow with $p.", ch, obj, victim, TO_VICT);
      if (IS_NPC (ch) || !IS_SET (ch->act, PLR_BRIEF))
	 act ("$N parries your blow with $p.", ch, obj, victim, TO_CHAR);
      return TRUE;
   }
   if (IS_NPC (victim) || !IS_SET (victim->act, PLR_BRIEF))
      act ("You parry $n's attack.", ch, NULL, victim, TO_VICT);
   if (IS_NPC (ch) || !IS_SET (ch->act, PLR_BRIEF))
      act ("$N parries your attack.", ch, NULL, victim, TO_CHAR);
   return TRUE;
}

/*
 * Check for dodge.
 */
bool check_dodge (CHAR_DATA * ch, CHAR_DATA * victim, int dt)
{
   int chance = 0;
   int thingy;
   int dodge_type = number_range (1, 9);

   if (!IS_AWAKE (victim))
      return FALSE;

   if (!IS_NPC (ch))
      chance -= (ch->wpn[dt - 1000] * 0.1);
   else
      chance -= (ch->level * 0.2);
   if (!IS_NPC (victim))
      chance += (victim->wpn[0] * 0.5);
   else
      chance += victim->level;

   if (IS_STANCE (victim, STANCE_MONGOOSE)
       && victim->stance[STANCE_MONGOOSE] > 0 && !can_counter (ch)
       && !can_bypass (ch, victim))
      (chance += victim->stance[STANCE_MONGOOSE] * 0.25);
   if (IS_STANCE (victim, STANCE_SWALLOW)
       && victim->stance[STANCE_SWALLOW] > 0 && !can_counter (ch)
       && !can_bypass (ch, victim))
      (chance += victim->stance[STANCE_SWALLOW] * 0.25);

   if (!IS_NPC (ch))
   {
      if (IS_CLASS (ch, CLASS_VAMPIRE))
      {
         if (get_disc(ch, VAM_CELE) > 0)
            chance -= (5 * get_disc(ch, VAM_CELE));
      }
      if (IS_CLASS (ch, CLASS_NINJA))
      {
	 if (ch->pcdata->powers[NPOWER_CHIKYU] >= 6
	     && ch->pcdata->powers[HARA_KIRI] > 0)
	    chance -= 25;
	 if (ch->pcdata->powers[NPOWER_CHIKYU] > 2)
	    chance -= 20;
	 if (ch->pcdata->powers[NINJAKI] > 4)
	    chance -= (ch->pcdata->powers[NINJAKI] / 4);
      }
      if (IS_CLASS (ch, CLASS_DEMON))
      {
         if (!IS_SET (ch->warp, WARP_QUICKNESS))
            chance -= 10;
	 if (IS_DEMPOWER (ch, DEM_SPEED))
	 {
	    if (IS_SET (ch->special, SPC_DEMON_LORD))
	       chance -= 30;
	    else if (IS_SET (ch->special, SPC_DEMON_LORD))
	       chance -= 25;
	    else if (IS_SET (ch->special, SPC_SIRE))
	       chance -= 20;
	    else
	       chance -= 15;
	 }
      }
      if (IS_CLASS (ch, CLASS_FAE))
      {
	 if (IS_SET (ch->extra2, EXTRA2_FAESPEED))
            chance -= 30;
      }

      if (IS_CLASS (ch, CLASS_MAGE))
      {
	 if (IS_SET (ch->mflags, MAGE_POLYAPPEAR))
	    chance -= 15;
	 if (ch->spheres[MTIM] > 0)
	    chance -= (ch->spheres[MTIM] * 2);
      }
      if (IS_CLASS (ch, CLASS_DROW))
      {
	 if (IS_SET (ch->pcdata->powers[1], DPOWER_ARMS))
            chance -= 40;
      }
        if ( IS_CLASS(ch, CLASS_WRAITH))
        {
        chance -= 30;
        }
      if (IS_CLASS (ch, CLASS_WEREWOLF))
      {
	 if (IS_SET (ch->special, SPC_WOLFMAN))
	    chance -= 5;
	 if (ch->gifts[SILENTSTRIDERS] > 0)
	    chance -= 5;
	 if (ch->gifts[SILENTSTRIDERS] > 1)
	    chance -= 10;
	 if (ch->gifts[SILENTSTRIDERS] > 2)
	    chance -= 10;
	 if (ch->gifts[STARGAZERS] > 3)
	    chance -= 5;
      }
      if (IS_CLASS (ch, CLASS_MONK))
      {
	 if (ch->chi[CURRENT] > 0)
	    chance -= (ch->chi[CURRENT] * 7);
      }
      if (IS_CLASS (ch, CLASS_HIGHLANDER))
      {
	 if (get_eq_char (ch, WEAR_DUAL) != NULL)
	    chance -= ch->race * 2 / 3;
      }
   }

   /* Some shit for Earth Embrace )Mage Power(, works on NPC's.. */
   if (IS_SET (victim->mflags, MAGE_EMBRACED2))
      chance += 10;
   if (IS_SET (victim->mflags, MAGE_EMBRACED1))
      chance += 5;
   if (IS_SET (ch->mflags, MAGE_EMBRACED2))
      chance -= 10;
   if (IS_SET (ch->mflags, MAGE_EMBRACED1))
      chance -= 5;
   if (IS_SUPER_NPC (ch))
      chance -= ch->level / 100;
   if (IS_SUPER_NPC (victim))
      chance += ch->level / 100;

   if (!IS_NPC (victim))
   {
      if (IS_CLASS (victim, CLASS_VAMPIRE))
      {
         if (get_disc(victim, VAM_CELE) > 0)
            chance += (5 * get_disc(victim, VAM_CELE));
      }
      if (IS_CLASS (victim, CLASS_NINJA))
      {
	 if (victim->pcdata->powers[NPOWER_CHIKYU] >= 6
	     && victim->pcdata->powers[HARA_KIRI] > 0)
	    chance += 25;
	 if (victim->pcdata->powers[NPOWER_CHIKYU] > 2)
	    chance += 20;
	 if (victim->pcdata->powers[NINJAKI] > 4)
	    chance += (victim->pcdata->powers[NINJAKI] / 4);
      }
      if (IS_CLASS (victim, CLASS_DEMON))
      {
         if (IS_SET (victim->warp, WARP_QUICKNESS))
            chance += 10;
	 if (IS_DEMPOWER (victim, DEM_SPEED))
	 {
	    if (IS_SET (victim->special, SPC_DEMON_LORD))
	       chance += 30;
	    else if (IS_SET (victim->special, SPC_PRINCE))
	       chance += 25;
	    else if (IS_SET (victim->special, SPC_SIRE))
	       chance += 20;
	    else
	       chance += 15;
	 }
      }
      if (IS_CLASS (victim, CLASS_FAE))
      {
	 if (IS_SET (victim->extra2, EXTRA2_FAESPEED))
            chance += 30;
      }
      if (IS_CLASS (victim, CLASS_DROW))
      {
	 if (IS_SET (victim->pcdata->powers[1], DPOWER_ARMS))
            chance += 40;
      }

      if (IS_CLASS (victim, CLASS_MAGE))
      {
	 if (IS_SET (victim->mflags, MAGE_POLYAPPEAR))
	    chance += 15;
	 if (victim->spheres[MTIM] > 0)
	    chance += (victim->spheres[MTIM] * 2);
      }
      if (IS_CLASS (victim, CLASS_MONK))
      {
	 if (victim->chi[CURRENT] > 0)
	    chance += (victim->chi[CURRENT] * 7);
      }
        if ( IS_CLASS(victim, CLASS_WRAITH))
        {
        chance += 30;
        }
      if (IS_CLASS (victim, CLASS_WEREWOLF))
      {
	 if (IS_SET (victim->special, SPC_WOLFMAN))
	    chance += 5;
	 if (victim->gifts[SILENTSTRIDERS] > 0)
	    chance += 5;
	 if (victim->gifts[SILENTSTRIDERS] > 1)
	    chance += 10;
	 if (victim->gifts[SILENTSTRIDERS] > 2)
	    chance += 10;
	 if (victim->gifts[STARGAZERS] > 3)
	    chance += 5;
      }
      if (IS_CLASS (victim, CLASS_HIGHLANDER))
      {
	 if (get_eq_char (victim, WEAR_DUAL) != NULL)
	    chance += ch->race * 2 / 3;
      }

   }

   if (IS_SUPER_NPC (ch))
      chance -= ch->level / 100;
   if (IS_SUPER_NPC (victim))
      chance += ch->level / 100;

   if (!IS_NPC (ch) && IS_VAMPAFF (ch, VAM_CELERITY)
       && IS_CLASS (ch, CLASS_VAMPIRE))
   {
      if (ch->pcdata->rank == AGE_METHUSELAH)
	 chance -= 20;
      else if (ch->pcdata->rank == AGE_ELDER)
	 chance -= 15;
      else if (ch->pcdata->rank == AGE_ANCILLA)
	 chance -= 10;
   }
   if (!IS_NPC (victim) && IS_VAMPAFF (victim, VAM_CELERITY)
       && IS_CLASS (victim, CLASS_VAMPIRE))
   {
      if (victim->pcdata->rank == AGE_METHUSELAH)
	 chance += 20;
      else if (victim->pcdata->rank == AGE_ELDER)
	 chance += 15;
      else if (victim->pcdata->rank == AGE_ANCILLA)
	 chance += 10;
   }

   if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_MONK)
       && (victim->monkblock / 4 > 0))
      chance += (victim->monkblock / 4);

   if (chance > 75)
      chance = 75;
   else if (chance < 25)
      chance = 25;

   if (IS_NPC (victim))
   {
      if (victim->level < 100)
	 chance = 15;
      if (victim->level >= 100)
	 chance = (victim->level * .01);
      if (victim->level >= 500)
	 chance = 50;
   }
   thingy = number_range (1, 100);
   if (thingy >= chance)
      return FALSE;

   if (IS_POLYAFF (victim, POLY_BAT) || IS_POLYAFF (victim, POLY_SERPENT))
      dodge_type = 0;

   if (IS_NPC (victim) || !IS_SET (victim->act, PLR_BRIEF))
   {
      switch (dodge_type)
      {
      default:
	 act ("You dodge $n's blow.", ch, NULL, victim, TO_VICT);
	 break;
      case 1:
	 act ("You duck under $n's blow.", ch, NULL, victim, TO_VICT);
	 break;
      case 2:
      case 3:
      case 4:
      case 5:
      case 6:
	 act ("You sidestep $n's blow.", ch, NULL, victim, TO_VICT);
	 break;
      case 7:
	 act ("You jump over $n's blow.", ch, NULL, victim, TO_VICT);
	 break;
      case 8:
	 act ("You leap out of the way of $n's blow.", ch, NULL, victim,
	      TO_VICT);
	 break;
      case 9:
	 act ("You roll under $n's blow.", ch, NULL, victim, TO_VICT);
	 break;
      }
   }
   if (IS_NPC (ch) || !IS_SET (ch->act, PLR_BRIEF))
   {
      switch (dodge_type)
      {
      default:
	 act ("$N dodges your blow.", ch, NULL, victim, TO_CHAR);
	 break;
      case 1:
	 act ("$N ducks under your blow.", ch, NULL, victim, TO_CHAR);
	 break;
      case 2:
      case 3:
      case 4:
      case 5:
      case 6:
	 act ("$N sidesteps your blow.", ch, NULL, victim, TO_CHAR);
	 break;
      case 7:
	 act ("$N jumps over your blow.", ch, NULL, victim, TO_CHAR);
	 break;
      case 8:
	 act ("$N leaps out of the way of your blow.", ch, NULL, victim,
	      TO_CHAR);
	 break;
      case 9:
	 act ("$N rolls under your blow.", ch, NULL, victim, TO_CHAR);
	 break;
      }
   }
   return TRUE;
}

/*
 * Set position of a victim.
 */
void update_pos (CHAR_DATA * victim)
{
   CHAR_DATA *mount;

   if (victim->hit > 0)
   {
      if (victim->position <= POS_STUNNED)
      {
	 bool gm_stance = FALSE;

	 victim->position = POS_STANDING;
	 if (!IS_NPC (victim) && victim->stance[0] > 0)
	 {
	    int stance = victim->stance[0];

	    if (victim->stance[stance] >= 200)
	       gm_stance = TRUE;
	 }
	 if (IS_NPC (victim) || victim->max_hit * 0.25 > victim->hit
	     || !gm_stance)
	 {
	    act ("$n clambers back to $s feet.", victim, NULL, NULL, TO_ROOM);
	    act ("You clamber back to your feet.", victim, NULL, NULL,
		 TO_CHAR);
	 }
	 else
	 {
	    act ("$n flips back up to $s feet.", victim, NULL, NULL, TO_ROOM);
	    act ("You flip back up to your feet.", victim, NULL, NULL,
		 TO_CHAR);
	 }
      }
      return;
   }
   else if ((mount = victim->mount) != NULL)
   {
      if (victim->mounted == IS_MOUNT)
      {
	 act ("$n rolls off $N.", mount, NULL, victim, TO_ROOM);
	 act ("You roll off $N.", mount, NULL, victim, TO_CHAR);
      }
      else if (victim->mounted == IS_RIDING)
      {
	 act ("$n falls off $N.", victim, NULL, mount, TO_ROOM);
	 act ("You fall off $N.", victim, NULL, mount, TO_CHAR);
      }
      mount->mount = NULL;
      victim->mount = NULL;
      mount->mounted = IS_ON_FOOT;
      victim->mounted = IS_ON_FOOT;
   }

   if (!IS_NPC (victim) && victim->hit <= -11 && IS_HERO (victim))
   {
      victim->hit = -10;
      if (victim->position == POS_FIGHTING)
	 stop_fighting (victim, TRUE);
      return;
   }

   if (IS_NPC (victim) || victim->hit <= -11)
   {
      victim->position = POS_DEAD;
      return;
   }

   if (victim->hit <= -6)
      victim->position = POS_MORTAL;
   else if (victim->hit <= -3)
      victim->position = POS_INCAP;
   else
      victim->position = POS_STUNNED;

   return;
}

/*
 * Start fights.
 */
void set_fighting (CHAR_DATA * ch, CHAR_DATA * victim)
{
   if (ch->fighting != NULL)
   {
      //bug( "Set_fighting: already fighting", 0 );
      return;
   }

   if (!IS_NPC (ch) && IS_AFFECTED(ch, AFF_ETHEREAL) )
   {
	REMOVE_BIT(ch->affected_by, AFF_ETHEREAL);
        stc("You fade into the real world!\n\r", ch);
        //return;
   }
   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD))
   {
      REMOVE_BIT (ch->affected_by, AFF_STEELSHIELD);
      stc ("You lower your majesty.\n\r", ch);

      //return;
   }
   if (!IS_NPC (ch) && IS_ITEMAFF (ch, ITEMA_PEACE))
      REMOVE_BIT(ch->itemaffect, ITEMA_PEACE);

/* Drow Darkness vanishes on fight start
 * MAC 11/12/99 */

   if (IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS) )
                REMOVE_BIT(ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);

   if (!IS_NPC (victim) && (IS_CLASS (ch, CLASS_DROW)
       || (IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH)))
       && IS_SET (ch->newbits, NEW_DARKNESS))
   {
      REMOVE_BIT (ch->newbits, NEW_DARKNESS);
      if ((ch->in_room != NULL)
	  && IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
	 REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
      send_to_char ("Your darkness fades away.\n\r", ch);
   }
   if (!IS_NPC (ch) && !IS_NPC (victim))
      ch->fight_timer = 30;

   if (!IS_NPC (victim) && !IS_NPC (ch))
      victim->fight_timer = 30;

   if (IS_AFFECTED (ch, AFF_SLEEP))
      affect_strip (ch, gsn_sleep);

   ch->damcap[DAM_CHANGE] = 1;

   if (ch->in_room != victim->in_room)
      return;

   ch->fighting = victim;
   ch->position = POS_FIGHTING;

   autodrop (ch);
   autodrop (victim);

   return;
}

void stop_embrace (CHAR_DATA * ch, CHAR_DATA * victim)
{
   if (victim == NULL)
   {
      ch->embracing = NULL;
      return;
   }
   victim->embraced = NULL;
   ch->embracing = NULL;

   return;

}

/*
 * Stop fights.
 */
void stop_fighting (CHAR_DATA * ch, bool fBoth)
{
   CHAR_DATA *fch;

   for (fch = char_list; fch != NULL; fch = fch->next)
   {
     if (fch->fighting == NULL && fch->position != POS_FIGHTING)
         continue;
      if (fch == ch || (fBoth && fch->fighting && fch->fighting == ch))
      {
	 fch->fighting = NULL;
	 fch->position = POS_STANDING;
	 update_pos (fch);
      }
   }

   return;
}

/*
 * Make a corpse out of a character.
 */
OBJ_DATA *make_corpse (CHAR_DATA * ch)
{
   char buf[MAX_STRING_LENGTH];
   OBJ_DATA *corpse;
   OBJ_DATA *obj;
   OBJ_DATA *obj_next;
   char *name;

   if (IS_NPC (ch))
   {
      if (ch->pIndexData->vnum == 25)
      {
         for (obj = ch->carrying; obj != NULL; obj = obj_next)
         {
            obj_next = obj->next_content;
            extract_obj (obj);
         }
         do_say(ch, "This area has become too dangerous...");
         do_say(ch, "Time to move on.");
         act ("You heft your backpack over your shoulder and wander out of the room.", ch, NULL, NULL,
            TO_CHAR);
         act ("$n hefts $s backpack over $s shoulder and wanders out of the room.", ch, NULL, NULL,
            TO_ROOM);
         load_oaka(TRUE);
         return NULL;
      }
      name = ch->short_descr;
      corpse = create_object (get_obj_index (OBJ_VNUM_CORPSE_NPC), 0);
      corpse->timer = number_range (60, 120);
      corpse->value[2] = ch->pIndexData->vnum;
      if (ch->gold > 0)
      {
	 obj_to_obj (create_money (ch->gold), corpse);
	 ch->gold = 0;
      }
   }
   else
   {
      name = ch->name;
      corpse = create_object (get_obj_index (OBJ_VNUM_CORPSE_PC), 0);
      corpse->timer = number_range (600, 1200);
      /* Why should players keep their gold? */
      if (ch->gold > 0)
      {
	 obj = create_money (ch->gold);
	 if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
	     && (!IS_SET (obj->extra_flags, ITEM_SHADOWPLANE)))
	    SET_BIT (obj->extra_flags, ITEM_SHADOWPLANE);
	 obj_to_obj (obj, corpse);
	 ch->gold = 0;
      }
   }

   sprintf (buf, corpse->short_descr, name);
   free_string (corpse->short_descr);
   corpse->short_descr = str_dup (buf);

   sprintf (buf, corpse->description, name);
   free_string (corpse->description);
   corpse->description = str_dup (buf);

   for (obj = ch->carrying; obj != NULL; obj = obj_next)
   {
      obj_next = obj->next_content;

      obj_from_char (obj);
      if (IS_SET (obj->extra_flags, ITEM_VANISH))
	 extract_obj (obj);
      else if (IS_SET (obj->quest, QUEST_ARTIFACT) ||
	       obj->item_type == ITEM_PIECE || obj->item_type == ITEM_STOKEN)
      {
	 if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
	     && (!IS_SET (obj->extra_flags, ITEM_SHADOWPLANE)))
	    SET_BIT (obj->extra_flags, ITEM_SHADOWPLANE);
         if (IS_ARTIFACT(obj, ARTI_LIONS_MANE) && IS_SET(ch->more, MORE_LIONSMANE))
            do_pull(ch, obj->name);
	 act ("$p rolls off your corpse.", ch, obj, NULL, TO_CHAR);
	 act ("$p rolls off $P.", ch, obj, corpse, TO_ROOM);
	 obj_to_room (obj, ch->in_room);
      }
      else if (obj->questowner != NULL && strlen (obj->questowner) > 1)
      {
	 if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
	     && (!IS_SET (obj->extra_flags, ITEM_SHADOWPLANE)))
	    SET_BIT (obj->extra_flags, ITEM_SHADOWPLANE);
	 act ("$p rolls off your corpse.", ch, obj, NULL, TO_CHAR);
	 act ("$p rolls off $P.", ch, obj, corpse, TO_ROOM);
	 obj_to_room (obj, ch->in_room);
      }
      else if (obj->item_type == ITEM_NEWTOKEN)
      {
         if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
             && (!IS_SET (obj->extra_flags, ITEM_SHADOWPLANE)))
            SET_BIT (obj->extra_flags, ITEM_SHADOWPLANE);
         act ("$p rolls off your corpse.", ch, obj, NULL, TO_CHAR);
         act ("$p rolls off $P.", ch, obj, corpse, TO_ROOM);
         obj_to_room (obj, ch->in_room);
      }
      else if (obj->item_type == ITEM_QPRIZE)
      {
	 if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
	     && (!IS_SET (obj->extra_flags, ITEM_SHADOWPLANE)))
	    SET_BIT (obj->extra_flags, ITEM_SHADOWPLANE);
	 act ("$p rolls off your corpse.", ch, obj, NULL, TO_CHAR);
	 act ("$p rolls off $P.", ch, obj, corpse, TO_ROOM);
	 obj_to_room (obj, ch->in_room);
      }
      else
      {
	 if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
	     && (!IS_SET (obj->extra_flags, ITEM_SHADOWPLANE)))
	    SET_BIT (obj->extra_flags, ITEM_SHADOWPLANE);
	 obj_to_obj (obj, corpse);
      }
   }

   /* If you die in the shadowplane, your corpse should stay there */
   if (IS_AFFECTED (ch, AFF_SHADOWPLANE))
      SET_BIT (corpse->extra_flags, ITEM_SHADOWPLANE);

   obj_to_room (corpse, ch->in_room);
   return corpse;
}

void death_cry (CHAR_DATA * ch)
{
   ROOM_INDEX_DATA *was_in_room;
   char *msg;
   int door;

   if (IS_SET (ch->more, MORE_MESSAGE))
   {
      if (IS_NPC (ch))
	 msg = "You hear something's death cry.";
      else
	 msg = "You hear someone's death cry.";

      was_in_room = ch->in_room;
      for (door = 0; door <= 5; door++)
      {
	 EXIT_DATA *pexit;

	 if ((pexit = was_in_room->exit[door]) != NULL
	     && pexit->to_room != NULL && pexit->to_room != was_in_room)
	 {
	    ch->in_room = pexit->to_room;
	    act (msg, ch, NULL, NULL, TO_ROOM);
	 }
      }
      ch->in_room = was_in_room;
   }
   return;
}

void make_part (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   int vnum;

   argument = one_argument (argument, arg);
   vnum = 0;

   if (arg[0] == '\0')
      return;
/* Is the player in a  room? */

   if (ch->in_room == NULL)
      return;

   if (!str_cmp (arg, "head"))
      vnum = OBJ_VNUM_SEVERED_HEAD;
   else if (!str_cmp (arg, "arm"))
      vnum = OBJ_VNUM_SLICED_ARM;
   else if (!str_cmp (arg, "leg"))
      vnum = OBJ_VNUM_SLICED_LEG;
   else if (!str_cmp (arg, "heart"))
      vnum = OBJ_VNUM_TORN_HEART;
   else if (!str_cmp (arg, "turd"))
      vnum = OBJ_VNUM_TORN_HEART;
   else if (!str_cmp (arg, "entrails"))
      vnum = OBJ_VNUM_SPILLED_ENTRAILS;
   else if (!str_cmp (arg, "brain"))
      vnum = OBJ_VNUM_QUIVERING_BRAIN;
   else if (!str_cmp (arg, "eyeball"))
      vnum = OBJ_VNUM_SQUIDGY_EYEBALL;
   else if (!str_cmp (arg, "blood"))
      vnum = OBJ_VNUM_SPILT_BLOOD;
   else if (!str_cmp (arg, "face"))
      vnum = OBJ_VNUM_RIPPED_FACE;
   else if (!str_cmp (arg, "windpipe"))
      vnum = OBJ_VNUM_TORN_WINDPIPE;
   else if (!str_cmp (arg, "cracked_head"))
      vnum = OBJ_VNUM_CRACKED_HEAD;
   else if (!str_cmp (arg, "ear"))
      vnum = OBJ_VNUM_SLICED_EAR;
   else if (!str_cmp (arg, "nose"))
      vnum = OBJ_VNUM_SLICED_NOSE;
   else if (!str_cmp (arg, "tooth"))
      vnum = OBJ_VNUM_KNOCKED_TOOTH;
   else if (!str_cmp (arg, "tongue"))
      vnum = OBJ_VNUM_TORN_TONGUE;
   else if (!str_cmp (arg, "hand"))
      vnum = OBJ_VNUM_SEVERED_HAND;
   else if (!str_cmp (arg, "foot"))
      vnum = OBJ_VNUM_SEVERED_FOOT;
   else if (!str_cmp (arg, "thumb"))
      vnum = OBJ_VNUM_SEVERED_THUMB;
   else if (!str_cmp (arg, "index"))
      vnum = OBJ_VNUM_SEVERED_INDEX;
   else if (!str_cmp (arg, "middle"))
      vnum = OBJ_VNUM_SEVERED_MIDDLE;
   else if (!str_cmp (arg, "ring"))
      vnum = OBJ_VNUM_SEVERED_RING;
   else if (!str_cmp (arg, "little"))
      vnum = OBJ_VNUM_SEVERED_LITTLE;
   else if (!str_cmp (arg, "toe"))
      vnum = OBJ_VNUM_SEVERED_TOE;

   if (vnum != 0)
   {
      char buf[MAX_STRING_LENGTH];
      OBJ_DATA *obj;
      char *name;

      name = IS_NPC (ch) ? ch->short_descr : ch->name;
      obj = create_object (get_obj_index (vnum), 0);
      if (IS_NPC (ch))
	 obj->timer = number_range (2, 5);
      else
	 obj->timer = -1;
      if (!str_cmp (arg, "head") && IS_NPC (ch))
	 obj->value[1] = ch->pIndexData->vnum;
      else if (!str_cmp (arg, "head") && !IS_NPC (ch))
      {
	 ch->pcdata->chobj = obj;
	 obj->chobj = ch;
	 obj->timer = number_range (2, 3);
      }
      else if (!str_cmp (arg, "arm"))
	 SET_BIT (obj->extra_flags, ITEM_ARM);
      else if (!str_cmp (arg, "brain") && !IS_NPC (ch)
	       && IS_AFFECTED (ch, AFF_POLYMORPH) && IS_HEAD (ch, LOST_HEAD))
      {
	 if (ch->pcdata->chobj != NULL)
	    ch->pcdata->chobj->chobj = NULL;
	 ch->pcdata->chobj = obj;
	 obj->chobj = ch;
	 obj->timer = number_range (2, 3);
      }

      /* For blood :) KaVir */
      if (vnum == OBJ_VNUM_SPILT_BLOOD)
	 obj->timer = 2;

      /* For voodoo dolls - KaVir */
      if (!IS_NPC (ch))
      {
	 sprintf (buf, obj->name, name);
	 free_string (obj->name);
	 obj->name = str_dup (buf);
      }
      else
      {
	 sprintf (buf, obj->name, "mob");
	 free_string (obj->name);
	 obj->name = str_dup (buf);
      }

      sprintf (buf, obj->short_descr, name);
      free_string (obj->short_descr);
      obj->short_descr = str_dup (buf);

      sprintf (buf, obj->description, name);
      free_string (obj->description);
      obj->description = str_dup (buf);

      if (IS_AFFECTED (ch, AFF_SHADOWPLANE))
	 SET_BIT (obj->extra_flags, ITEM_SHADOWPLANE);

      obj_to_room (obj, ch->in_room);
   }
   return;
}

void raw_kill (CHAR_DATA * victim, CHAR_DATA * ch)
{
   CHAR_DATA *mount;
   char buf[MSL];
   stop_fighting (victim, TRUE);
if (IS_NPC(victim) && !IS_NPC(ch)) ch->mkill++;
    if (!IS_NPC(victim) && IS_NPC(ch)) victim->mdeath++;
   if (!IS_NPC (victim) && victim->form > 0)
      death_message (ch, victim);
   death_cry (victim);
   mmake_corpse (victim);

   if (victim == quest_target)
      quest_target = NULL;
   if (victim == quest_mob)
   {
      sprintf (buf,
	       "Oh well, I guess the quest is over, since I am about to DIE!!!!!");
      do_qtalk (victim, buf);
      quest_mob = NULL;
   }
   if ((mount = victim->mount) != NULL)
   {
      if (victim->mounted == IS_MOUNT)
      {
	 act ("$n rolls off the corpse of $N.", mount, NULL, victim, TO_ROOM);
	 act ("You roll off the corpse of $N.", mount, NULL, victim, TO_CHAR);
      }
      else if (victim->mounted == IS_RIDING)
      {
	 act ("$n falls off $N.", victim, NULL, mount, TO_ROOM);
	 act ("You fall off $N.", victim, NULL, mount, TO_CHAR);
      }
      mount->mount = NULL;
      victim->mount = NULL;
      mount->mounted = IS_ON_FOOT;
      victim->mounted = IS_ON_FOOT;
   }

   if (IS_NPC (victim))
   {
      victim->pIndexData->killed++;
mobs_killed++;
      kill_table[URANGE (0, victim->level, MAX_LEVEL - 1)].killed++;
      extract_char (victim, TRUE, FALSE);
      return;
   }

   extract_char (victim, FALSE, FALSE);
   while (victim->affected)
      affect_remove (victim, victim->affected);
   if (IS_AFFECTED (victim, AFF_POLYMORPH)
       && IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      victim->affected_by = AFF_POLYMORPH + AFF_ETHEREAL;
   }
   else if (IS_AFFECTED (victim, AFF_POLYMORPH))
      victim->affected_by = AFF_POLYMORPH;
   else if (IS_AFFECTED (victim, AFF_ETHEREAL))
      victim->affected_by = AFF_ETHEREAL;
   else
      victim->affected_by = 0;

   REMOVE_BIT (victim->immune, IMM_STAKE);
   REMOVE_BIT (victim->extra, TIED_UP);
   REMOVE_BIT (victim->extra, GAGGED);
   REMOVE_BIT (victim->extra, BLINDFOLDED);
   REMOVE_BIT (victim->extra, EXTRA_PREGNANT);
   REMOVE_BIT (victim->extra, EXTRA_LABOUR);
   REMOVE_BIT (victim->newbits, NEW_CALM);
   victim->pcdata->stats[DEMON_POWER] = 0;
      victim->disquiet_counter = 0;
   victim->itemaffect = 0;
   victim->loc_hp[0] = 0;
   victim->loc_hp[1] = 0;
   victim->loc_hp[2] = 0;
   victim->loc_hp[3] = 0;
   victim->loc_hp[4] = 0;
   victim->loc_hp[5] = 0;
   victim->loc_hp[6] = 0;
   victim->armor = 100;
   victim->position = POS_RESTING;
   victim->hit = UMAX (1, victim->hit);
   victim->mana = UMAX (1, victim->mana);
   victim->move = UMAX (1, victim->move);
   victim->hitroll = 0;
   victim->damroll = 0;
   victim->saving_throw = 0;
   victim->carry_weight = 0;
   victim->carry_number = 0;
   victim->specxtype = 0;
   do_call (victim, "bags");
   do_call (victim, "all");
   save_char_obj (victim);
   return;
}

void decaptot()
{
   extern int nosafecount;
   extern int decaps;
   char buf[MSL];
   
      decaps++;
            
      if (decaps % 100 == 10) { do_tokenquest(NULL,"50"); return; }
      else if (decaps % 100 == 20) { do_stoken(NULL, "10"); return; }
      else if (decaps % 100 == 30) { rparasite (); return; }
      else if (decaps % 100 == 40)
      {
        if (nosafe) return;
        do_info (NULL, "Safe rooms have been removed for #w15 Minutes#n");
        nosafecount = 15 * 60;
        nosafe = TRUE;
        return;
      }
      else if (decaps % 100 == 50)
      {
        do_info (NULL, "The mud has reached enough decaps to lower the time till the next MOD.");
        WizConfig->modtimer = WizConfig->modtimer / 2;
        return;
      }
      else if (decaps % 100 == 60)
      {
        WizConfig->paradoxlimit += number_range(1,10);
        sprintf(buf,"The mud has received 60 total decaps this boot, rasing the status window.");
        do_info(NULL,buf);
        sprintf(buf,"The new status window is %d",WizConfig->paradoxlimit);
        do_info(NULL,buf);
        return;
      }
      else if (decaps % 100 == 0)
      {
        do_info(NULL,"Congratulations, the mud has received 100 total decaps. JACKPOT TIME!");
        do_tokenquest(NULL,"50");
        do_stoken(NULL,"25");
        rparasite ();
        if (!nosafe) return;
        do_info (NULL, "Safe rooms have been removed for #w15 Minutes#n");
        nosafecount = 15 * 60;
        nosafe = TRUE;
        WizConfig->paradoxlimit += number_range(1,10);
        sprintf(buf,"The new status window is %d",WizConfig->paradoxlimit);
        do_info(NULL,buf);
        if (WizConfig->xptimer == 0) {
         sprintf (buf, "A 3x Experience Multiplier is now ON!");
         do_info (NULL, buf);
         WizConfig->xpbonus = 3;
         WizConfig->xptimer = 20;
         save_wizconfig (); }
         if (WizConfig->qptimer == 0) {
         sprintf (buf, "A 3x Quest Point Multiplier is now ON!");
         do_info (NULL, buf);
         WizConfig->qpbonus = 3;
         WizConfig->qptimer = 20;
         save_wizconfig ();
       }
        return;
       }
}

void behead (CHAR_DATA * victim)
{
   char buf[MAX_STRING_LENGTH];
   ROOM_INDEX_DATA *location;

   if (IS_NPC (victim))
      return;
   SET_BIT (victim->loc_hp[0], LOST_HEAD);

   location = victim->in_room;

   stop_fighting (victim, TRUE);

   mmake_corpse (victim);

   extract_char (victim, FALSE, FALSE);

   char_from_room (victim);
   char_to_room (victim, location);

   if (victim == NULL)
   {
      bug ("Behead: Victim no longer exists.", 0);
      return;
   }

   make_part (victim, "head");

   while (victim->affected)
      affect_remove (victim, victim->affected);
   if (IS_AFFECTED (victim, AFF_POLYMORPH)
       && IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      victim->affected_by = AFF_POLYMORPH + AFF_ETHEREAL;
   }
   else if (IS_AFFECTED (victim, AFF_POLYMORPH))
      victim->affected_by = AFF_POLYMORPH;
   
   else if (IS_AFFECTED (victim, AFF_ETHEREAL))
      victim->affected_by = AFF_ETHEREAL;
   else
      victim->affected_by = 0;


   if (IS_SET (victim->extra2, EXTRA2_INFECTED))
   {
      REMOVE_BIT (victim->extra2, EXTRA2_INFECTED);
      SET_BIT (victim->extra2, EXTRA2_VACCINATED);
      mal_info.parasite_timer = 1;
      act ("The Parasite has fled $n's body.", victim, NULL, NULL, TO_ROOM);
      stc ("The Parasite has fled your body.", victim);
      update_parasite ();
   }

   REMOVE_BIT (victim->immune, IMM_STAKE);
   REMOVE_BIT (victim->extra, TIED_UP);
   REMOVE_BIT (victim->extra, GAGGED);
   REMOVE_BIT (victim->extra, BLINDFOLDED);
   REMOVE_BIT (victim->extra, EXTRA_PREGNANT);
   REMOVE_BIT (victim->extra, EXTRA_LABOUR);
   REMOVE_BIT (victim->newbits, NEW_CALM);
      victim->disquiet_counter = 0;
   victim->pcdata->stats[DEMON_POWER] = 0;

   if (IS_SET (victim->garou1, GAROU_WHELP1))
      victim->max_hit = victim->max_hit + 1500;
   REMOVE_BIT (victim->garou1, GAROU_WHELP1);
   if (IS_SET (victim->garou1, GAROU_WHELP2))
      victim->max_hit = victim->max_hit + 1500;
   REMOVE_BIT (victim->garou1, GAROU_WHELP2);

   victim->itemaffect = 0;
   victim->loc_hp[0] = 0;
   victim->loc_hp[1] = 0;
   victim->loc_hp[2] = 0;
   victim->loc_hp[3] = 0;
   victim->loc_hp[4] = 0;
   victim->loc_hp[5] = 0;
   victim->loc_hp[6] = 0;
   victim->affected_by = 0;
   victim->armor = 100;
   victim->position = POS_STANDING;
   victim->hit = 1;
   victim->mana = UMAX (1, victim->mana);
   victim->move = UMAX (1, victim->move);
   victim->hitroll = 0;
   victim->damroll = 0;
   victim->saving_throw = 0;
   victim->carry_weight = 0;
   victim->carry_number = 0;
   victim->fight_timer = 0;
   victim->specxtype = 0;
   if (victim->lstatus == 10 || victim->race > 0)
   {
      victim->captimer = 120;
   }
   SET_BIT (victim->loc_hp[0], LOST_HEAD);
   SET_BIT (victim->affected_by, AFF_POLYMORPH);
   sprintf (buf, "the severed head of %s", victim->name);
   free_string (victim->morph);
   victim->morph = str_dup (buf);
   do_call (victim, "all");
   save_char_obj (victim);
   decaptot();
   return;
}

void group_gain (CHAR_DATA * ch, CHAR_DATA * victim)
{
//   char buf[MAX_STRING_LENGTH];
   CHAR_DATA *gch;
   CHAR_DATA *lch;
   CHAR_DATA *mount;
   int xp;
   int members;

   /*
    * Monsters don't get kill xp's or alignment changes.
    * P-killing doesn't help either.
    * Dying of mortal wounds or poison doesn't give xp to anyone!
    */
   if ((IS_NPC (ch) && (mount = ch->mount) == NULL) || victim == ch)
      return;

   if (IS_SET (ch->extra2, NHELPER))
   return;
        
   members = 0;
   for (gch = ch->in_room->people; gch != NULL; gch = gch->next_in_room)
   {
      if (is_same_group (gch, ch))
	 members++;
   }

   if (members == 0)
   {
      bug ("Group_gain: members.", members);
      members = 1;
   }

   lch = (ch->leader != NULL) ? ch->leader : ch;

   for (gch = ch->in_room->people; gch != NULL; gch = gch->next_in_room)
   {
//      int xpmod = 100;
      OBJ_DATA *obj;
      OBJ_DATA *obj_next;
      char buf[100];

      if (!is_same_group (gch, ch))
	 continue;

      if (!IS_SET (gch->extra2, AGREED) && gch->mkill > 20)
      {
         stc ("#wYou are unable to gain any more EXP until you type: #rRULES\n\r", gch);
	 continue;
      }
      xp = xp_compute (gch, victim) / members;
//      xp = xp * xpmod / 100;
       
      if (xp > 0 && gch->in_room == victim->in_room) // tidied this up so it looks much better - Serenity
      {
	 bool gain_qp_bonus = FALSE;
	 bool gain_status_bonus = FALSE;
	 int gainstatus = number_range (1,1000000);
	 switch (gainstatus)
	 {
	 default:
	    break;
	 case 50000:
	    gain_status_bonus = TRUE;
	    break;
	 }

	 int gainqp = number_range (1, 2000);
	 switch (gainqp)
	 {
	 default:
	    break;
	 case 999:
	 case 666:
	 case 500:
	 case 200:
	 case 150:
	 case 100:
	 case 50:
	    gain_qp_bonus = TRUE;
	    break;
	 }

	 if (gain_status_bonus)
         {
          if (ch->race > 0)
          {
	    sprintf (buf,
		     "#w#FYou are blessed with 1 status for this kill.#n\n\r");
          ch->race = ch->race + 1;
          }
         }
	 if (gain_qp_bonus)
	 {
            if (IS_EXTRA2 (gch, EXTRA2_INFECTED) && IS_PARA (5))
               gainqp *= 1.5;
            if (WizConfig->qpbonus > 1)
               gainqp *= WizConfig->qpbonus;

	    sprintf (buf,
		     "#w#FYou are blessed with %d quest points for this kill.#n\n\r",
		     gainqp);
            if (gch->pcdata->score[SCORE_QUEST] < 45000) gch->pcdata->score[SCORE_QUEST] += gainqp;
            gch->pcdata->quest += gainqp;
            stc (buf, gch);
	 }
      }
      //stc("#rM#ga#yL#cs#wT#oa#rR #bb#gI#cr#rT#wh#gD#ra#yY #bb#cO#gn#rU#ys#o!#n\n\r",gch);
      if (get_hours (gch) < 6)
      {
	 if (gch->master == NULL || gch->leader == NULL)
	 {

	    sprintf (buf,
		     "#w[You receive #r%d#w newbie experience points]#n\n\r",
		     xp);
	    if (IS_SET (gch->more, PLR_COMB_EXP))
	    {
	       gch->combined_exp += xp;
	       xp = 0;
	       if (IS_CLASS (gch, CLASS_DEMON))
		  gch->combined_cp += victim->level;
	       if (IS_CLASS (gch, CLASS_DROW))
		  gch->combined_cp += ((victim->level * 4) / 3);
	    }
	    else
	    {
	       stc (buf, gch);
	    }
	 }
	 else
	 {
	    sprintf (buf, "#w[You receive #r%d #wexperience points]#n\n\r",
		     xp);
	    if (IS_SET (gch->more, PLR_COMB_EXP))
	    {
	       gch->combined_exp += xp;
	       xp = 0;
	       if (IS_CLASS (gch, CLASS_DEMON))
		  gch->combined_cp += victim->level;
	       if (IS_CLASS (gch, CLASS_DROW))
		  gch->combined_cp += ((victim->level * 4) / 3);
	    }
	    else
	    {
	       stc (buf, gch);
	    }
	 }
      }
      else
      {
	 sprintf (buf, "#w[You receive #r%d #wexperience points]#n\n\r", xp);
	 if (IS_SET (gch->more, PLR_COMB_EXP))
	 {
	    gch->combined_exp += xp;
	    xp = 0;
	    if (IS_CLASS (gch, CLASS_DEMON))
	       gch->combined_cp += victim->level;
	    if (IS_CLASS (gch, CLASS_DROW))
	       gch->combined_cp += ((victim->level * 4) / 3);
	 }
	 else
	 {
	    stc (buf, gch);
	 }
      }

        if (IS_SET(gch->more, MORE_AQUEST)&&IS_NPC(victim))
        {
            if (gch->questmob == victim->pIndexData->vnum)
            {
                send_to_char("#rYou have almost completed your QUEST!#n\n\r",gch);
                send_to_char("#rReturn to the questmaster before your time runs out!#n\n\r",gch);
                gch->questmob = -1;
            }
        }

      // hmm

      if (IS_CLASS (gch, CLASS_DEMON) && (xp > 0)
          && (!IS_SET (gch->more, PLR_COMB_EXP)))
	 stcprintf (gch, "You receive %d Demon Points for this kill.\n\r",
		    victim->level);

      if (IS_CLASS (gch, CLASS_DROW) && (xp > 0)
          && (!IS_SET (gch->more, PLR_COMB_EXP)))
         stcprintf (gch, "You receive %d Drow Points.\n\r",
		    (victim->level * 4) / 3);

      if (IS_SET (gch->more, MORE_QUESTOR) && IS_NPC (victim))
      {
         if (gch->questmob == victim->pIndexData->vnum)
	 {
            send_to_char ("You have almost completed your QUEST!\n\r", gch);
	    send_to_char
	       ("Return to the questmaster before your time runs out!\n\r",
                gch);
            gch->questmob = -1;
	 }
      }

      if ((mount = gch->mount) != NULL)
	 send_to_char (buf, mount);
      if ((xp > 0) && (!IS_SET (gch->more, PLR_COMB_EXP)))
	 gain_exp (gch, xp);

      for (obj = gch->carrying; obj != NULL; obj = obj_next)
      {
	 obj_next = obj->next_content;
	 if (obj->wear_loc == WEAR_NONE)
	    continue;

         if ((IS_OBJ_STAT (obj, ITEM_ANTI_EVIL) && IS_EVIL (gch))
             || (IS_OBJ_STAT (obj, ITEM_ANTI_GOOD) && IS_GOOD (gch))
             || (IS_OBJ_STAT (obj, ITEM_ANTI_NEUTRAL) && IS_NEUTRAL (gch)))
	 {
            act ("You are zapped by $p.", gch, obj, NULL, TO_CHAR);
            act ("$n is zapped by $p.", gch, obj, NULL, TO_ROOM);
	    obj_from_char (obj);
            obj_to_room (obj, gch->in_room);
	 }
      }
   }
   return;
}

/*
 * Compute xp for a kill.
 * Also adjust alignment of killer.
 * Edit this function to change xp computations.
 */

int xp_compute (CHAR_DATA * gch, CHAR_DATA * victim)
{
   CHAR_DATA *xch;
//   char buf[MAX_STRING_LENGTH]; 
   bool newbieexp = FALSE;
   int align, vnum, level, number, extra;
   long long xp;
//   int ldr,ldrz;
   int xtra_xp = number_range (1, 1500);

   xp = 300 - URANGE (-3, 3 - victim->level, 6) * 50;
   align = gch->alignment - victim->alignment;

   if (IS_HERO (gch))
   {
      /* Avatars shouldn't be able to change their alignment */
      if (IS_CLASS (gch, CLASS_DEMON)) gch->alignment = -1000;
      else gch->alignment = gch->alignment;
   }
   else if (align > 500)
      gch->alignment = UMIN (gch->alignment + (align - 500) / 4, 1000);
   else if (align < -500)
      gch->alignment = UMAX (gch->alignment + (align + 500) / 4, -1000);
   else
      gch->alignment -= gch->alignment / 4;

   if (IS_NPC (victim) && (vnum = victim->pIndexData->vnum) > 29000)
   {
      switch (vnum)
      {
      default:
	 break;
      case 29600:
      case 30000:
      case 30001:
      case 30006:
      case 30007:
      case 30008:
      case 30009:
      case 30010:
      case 30012:
      case 30013:
      case 30014:
      case 30015:
      case 30016:
	 return 0;
      }
   }

   if (IS_NPC (victim) && (IS_SET (victim->act, ACT_NOEXP)))
      return 0;

   level = URANGE (0, victim->level, MAX_LEVEL - 1);
   number = UMAX (1, kill_table[level].number);

   extra =
      IS_NPC (victim) ? (victim->pIndexData->killed -
			 kill_table[level].killed / number) : 0;

   xp -= xp * URANGE (-2, extra, 2) / 8;

   xp = number_range (xp * 3 / 4, xp * 5 / 4);
   xp = UMAX (0, xp);

     xp     = (xp * (victim->level+1)/3);
   xp = xp*1.5;
   if (IS_NEWBIE(gch))
   {
     for (xch = gch->in_room->people; xch != NULL; xch = xch->next_in_room)
     {
         if (is_same_group (gch, xch))
           newbieexp = FALSE;
         else
           newbieexp = TRUE;
     }
   }
   if (newbieexp)
      xp = xp * 3;

   if ((global_exp) && get_hours (gch) >= 6)
      xp = xp * 2;
   if (IS_SET (gch->extra2, EXTRA2_INFECTED) && IS_PARA (2)
       && get_hours (gch) >= 6)
      xp *= 3;
/*
    ldr = 0;
    if (!str_cmp(gch->name,leader_board.bestpk_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.pk_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.aw_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.mk_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.tt_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.xp_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.qp_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.qc_name)) ldr += 10;
    if (!str_cmp(gch->name,leader_board.tl_name)) ldr += 10;
    if (ldr > 40) ldr = 40;

    ldrz = (xp * ldr)/100;
    xp += ldrz;
*/
/* So people dont get Rediculous exp payouts */

   if (WizConfig->xpbonus < 1)
   {
      if (xtra_xp == 1500)
	 xp = xp * 4;
      else if (xtra_xp == 1400)
	 xp = xp * 3;
      else if (xtra_xp == 1300)
	 xp = xp * 2;
   }

   if ((WizConfig->xpbonus > 1) && !IS_NEWBIE(gch))

      xp = xp * WizConfig->xpbonus;

   if (!IS_NPC (gch) && IS_NPC (victim))
   {
      if (victim->level > gch->pcdata->score[SCORE_HIGH_LEVEL])
	 gch->pcdata->score[SCORE_HIGH_LEVEL] = victim->level;

      if (xp > gch->pcdata->score[SCORE_HIGH_XP])
	 gch->pcdata->score[SCORE_HIGH_XP] = xp;

   }
   //xp = xp * 2;
   return xp;
}

void dam_message (CHAR_DATA * ch, CHAR_DATA * victim, int dam, int dt)
{
   static char *const attack_table[] = {
      "hit",
      "slice", "stab", "slash", "whip", "claw",
      "blast", "pound", "crush", "grep", "bite",
      "pierce", "suck"
   };
   static char *const attack_table2[] = {
      "hits",
      "slices", "stabs", "slashes", "whips", "claws",
      "blasts", "pounds", "crushes", "greps", "bites",
      "pierces", "sucks"
   };

   char buf1[512], buf2[512], buf3[512];
   const char *vs;
   const char *vp;
   const char *attack=NULL;
   const char *attack2;
   int damp;
   int bodyloc;
   int recover = 0;

   bool critical = FALSE;
   char punct;

#ifdef FUCK_PLAYERS
   if (IS_NPC (victim) && !IS_NPC (ch))
      dam /= 1000;
   if (!IS_NPC (ch) && !IS_NPC (victim))
      dam /= 1000;
#endif

	 if (dt == TYPE_HIT && !IS_NPC (ch)
	     && (IS_VAMPAFF (ch, VAM_CLAWS) || IS_CLASS (ch, CLASS_DRAGON)))
	 {
	    attack = attack_table[dt - TYPE_HIT + 5];
	    attack2 = attack_table2[dt - TYPE_HIT + 5];
	 }
	 else if (dt >= 0 && dt < MAX_SKILL)
	 {
	    attack = skill_table[dt].noun_damage;
	    attack2 = skill_table[dt].noun_damage;
	 }
	 else if (dt >= TYPE_HIT
		  && dt <
		  TYPE_HIT + sizeof (attack_table) / sizeof (attack_table[0]))
	 {
	    attack = attack_table[dt - TYPE_HIT];
	    attack2 = attack_table2[dt - TYPE_HIT];
	 }
	 else
	 {			/*
				   bug( "Dam_mes\sage: bad dt %d.", dt );
				 */
	    dt = TYPE_HIT;
	    attack = attack_table[0];
	    attack2 = attack_table2[0];
	 }

      if (IS_IMMUNE (victim, IMM_SLASH)
          && (attack == "slash" || attack == "slice") && dam > 0)
	 recover = number_range (1, dam);
      if (IS_IMMUNE (victim, IMM_STAB)
	  && (attack == "stab" || attack == "pierce") && dam > 0)
	 recover = number_range (1, dam);
      if (IS_IMMUNE (victim, IMM_SMASH)
	  && (attack == "blast" || attack == "pound" || attack == "crush")
	  && dam > 0)
	 recover = number_range (1, dam);
      if (IS_IMMUNE (victim, IMM_ANIMAL)
          && (attack == "hit" || attack == "bite" || attack == "claw") && dam > 0)
	 recover = number_range (1, dam);
      if (IS_IMMUNE (victim, IMM_MISC)
	  && (attack == "grep" || attack == "suck" || attack == "whip")
	  && dam > 0)
	 recover = number_range (1, dam);
      if (IS_SUPER_NPC (victim))
	 recover = number_range (1, dam);
      if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_DEMON)
	  && (dam - recover) > 0 && IS_DEMPOWER (victim, DEM_TOUGH))
         recover += number_range (1, (dam - recover));
      if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_WEREWOLF)
	  && (dam - recover) > 0 && (victim->pcdata->stats[UNI_RAGE] > 200))
         recover += number_range (50, (dam - recover));
      /*herematt */
      if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_DRAGON)
	  && (dam - recover) > 0
	  && IS_SET (victim->pcdata->dragonaff, DRA_TOUGHNESS))
         recover += (number_range (50, (dam - recover)));
      if (recover > dam) recover = dam;
      dam -= recover;
      victim->hit += recover;

      if (!IS_NPC (ch) && IS_SET (ch->more, SHORT_COMBAT))
      {
         ch->amount_damage_dealt -= recover;
         if (dam < 1) ch->amount_attacks_dealt--;
      }
      if (!IS_NPC (victim) && IS_SET (victim->more, SHORT_COMBAT))
      {
         victim->amount_damage_received -= recover;
         if (dam < 1) victim->amount_attacks_received--;
      }

   if (WORN_ARTIFACT (ch, ARTI_SHATTERED_BLADE) || WORN_ARTIFACT (ch, ARTI_DEMONS_HEART) || (WORN_ARTIFACT (ch, ARTI_LIONS_MANE) && IS_SET(ch->more, MORE_LIONSMANE)))
   {
      victim->amount_damage_received += dam * .25;
      dam *= 1.25;
   }
   if (WORN_ARTIFACT (ch, ARTI_PLATE_IRON_GAUNTLET) || WORN_ARTIFACT (ch, ARTI_METEORIC_AXE) || WORN_ARTIFACT (ch, ARTI_CROWN_OF_CHRYSTANCIA))
   {
      victim->amount_damage_received += dam * .1;
      dam *= 1.1;
   }
   if (WORN_ARTIFACT (victim, ARTI_GREENLEAF_CLOAK) && !IS_SET (victim->flag2, AFF2_INARENA) &&
      victim->in_room != NULL && victim->in_room->sector_type != SECT_INSIDE &&
      victim->in_room->sector_type != SECT_CITY)
   {
      victim->amount_damage_received -= dam * .25;
      dam *= 0.75;
   }


   if (!IS_NPC (ch) && IS_SET (ch->extra2, NEW_REND) && dam > 0
       && number_range (1, 7) == 5)
      critical = TRUE;
   if (dam == 0)
   {
      vs = " #cmiss#n";
      vp = " #cmisses#n";
   }
   else if (dam <= 25)
   {
      vs = " #ylike a wuss#n";
      vp = " #ylike a wuss#n";
   }
   else if (dam <= 50)
   {
      vs = " #glightly#n";
      vp = " #glightly#n";
   }
   else if (dam <= 100)
   {
      vs = " #ghard#n";
      vp = " #ghard#n";
   }
   else if (dam <= 250)
   {
      vs = " #bvery hard#n";
      vp = " #bvery hard#n";
   }
   else if (dam <= 500)
   {
      vs = " #bextremely hard#n";
      vp = " #bextremely hard#n";
   }
   else if (dam <= 1000)
   {
      vs = "#r incredibly hard#n";
      vp = " #rincredibly hard#n";
   }
   else if (dam <= 1500)
   {
      vs = " #ramazingly hard#n";
      vp = " #ramazingly hard#n";
   }
   else if (dam <= 2000)
   {
      vs = " #rinsanely hard#n";
      vp = " #rinsanely hard#n";
   }
   else if (dam <= 2750)
   {
      vs = " #runbelievably hard#n";
      vp = " #runbelievably hard#n";
   }
   else if (dam <= 4000)
   {
      vs = " #Rwith #rU#RL#rT#RI#rM#RA#rT#RE#r power#n";
      vp = " #Rwith #rU#RL#rT#RI#rM#RA#rT#RE#r power#n";
   }
   else if (dam <= 5500)
   {
      vs = " #pwith #cU#pN#cG#pO#cD#pL#cY #pvengeance#n";
      vp = " #pwith #cU#pN#cG#pO#cD#pL#cY #pvengeance#n";
   }
   else
   {
      vs = " #ywith #wUNMERCIFUL #ystrength!#n";
      vp = " #ywith #wUNMERCIFUL #ystrength!#n";
   }



   /* If victim's hp are less/equal to 'damp', attacker gets a death blow */
   if (IS_NPC (victim))
      damp = 0;
   else
      damp = -10;
   if ((victim->hit - dam > damp) || (dt >= 0 && dt < MAX_SKILL)
       || (IS_NPC (victim) && IS_SET (victim->act, ACT_NOPARTS)))
   {
      punct = (dam <= 250) ? '.' : '!';

      if (dt == TYPE_HIT && !IS_NPC (ch) && !IS_VAMPAFF (ch, VAM_CLAWS))
      {
	 if (dam == 0)
	 {
	    sprintf (buf1, "$n%s $N%c", vp, punct);
	    sprintf (buf2, "You%s $N%c", vs, punct);
	    sprintf (buf3, "$n%s you%c", vp, punct);
	 }
	 else
	 {
	    sprintf (buf1, "$n hits $N%s%c", vp, punct);
            sprintf (buf2, "You hit $N%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]", vs, punct, dam, ch->mult, victim->reduct);
            sprintf (buf3, "$n hits you%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]", vp, punct, dam, ch->mult, victim->reduct);
	    critical = TRUE;
	 }
      }
      else
      {
	 if (dam == 0)
	 {
	    sprintf (buf1, "$n's %s%s $N%c", attack, vp, punct);
	    sprintf (buf2, "Your %s%s $N%c", attack, vp, punct);
	    sprintf (buf3, "$n's %s%s you%c", attack, vp, punct);
	 }
	 else if (IS_SET (ch->newbits, NEW_MONKFLAME) && (dam == 0))
	 {
	    sprintf (buf1, "$n's flaming %s%s $N%c", attack2, vp, punct);
            sprintf (buf2, "Your flaming %s%s $N%c", attack, vp,
                     punct);
            sprintf (buf3, "$n's flaming %s%s you%c", attack2, vp,
                     punct);
	 }

	 else
	 {
//Mac- This is where i think the checks for NO_SHIELDS Needs to go
//Now i just gotta work it out :(

	    if (dt >= 0 && dt < MAX_SKILL)
	    {

	       sprintf (buf1, "$n's %s strikes $N%s%c", attack2, vp, punct);
               sprintf (buf2, "Your %s strikes $N%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]", attack, vp,
                        punct, dam, ch->mult, victim->reduct);
               sprintf (buf3, "$n's %s strikes you%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]", attack2,
                        vp, punct, dam, ch->mult, victim->reduct);
	    }
	    else if (IS_SET (ch->newbits, NEW_MONKFLAME))
	    {
	       sprintf (buf1, "$n's flaming %s hits $N%s%c", attack2, vp,
			punct);
               sprintf (buf2, "Your flaming %s hits $N%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]", attack,
                        vp, punct, dam, ch->mult, victim->reduct);
               sprintf (buf3, "$n's flaming %s hits you%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]",
                        attack2, vp, punct, dam, ch->mult, victim->reduct);
	    }

	    else
	    {
	       sprintf (buf1, "$n %s $N%s%c", attack2, vp, punct);
               sprintf (buf2, "You %s $N%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]", attack, vp, punct,
                        dam, ch->mult, victim->reduct);
               sprintf (buf3, "$n %s you%s%c#w[#r%d#w][#g%.1f#w:#g%.1f#w]", attack2, vp, punct,
                        dam, ch->mult, victim->reduct);
	       critical = TRUE;
	    }
	 }
      }
      if (!(IS_SET (ch->more, MORE_SHIELDS)
	    && (dt == 37 || dt == 48 || dt == 12 || dt == 1 || dam == 0)))
	 act (buf1, ch, NULL, victim, TO_NOTVICT);
      if (!IS_SET (ch->more, SHORT_COMBAT))
      {
	 if (!(IS_SET (ch->more, MORE_SHIELDS)
	       && (dt == 37 || dt == 48 || dt == 12 || dt == 1 || dam == 0)))
	    act (buf2, ch, NULL, victim, TO_CHAR);
      }
      if (!IS_SET (victim->more, SHORT_COMBAT))
      {
	 if (!(IS_SET (ch->more, MORE_SHIELDS)
	       && (dt == 37 || dt == 48 || dt == 12 || dt == 1 || dam == 0)))
	    act (buf3, ch, NULL, victim, TO_VICT);
      }
      if (critical)
	 critical_hit (ch, victim, dt, dam);
      return;
   }
   if (dt == TYPE_HIT && !IS_NPC (ch) && !IS_VAMPAFF (ch, VAM_CLAWS)
       && !IS_VAMPAFF (ch, VAM_FANGS))
   {
      damp = number_range (1, 5);
      if (damp == 1)
      {
	 act ("You ram your fingers into $N's eye sockets and rip $S face off.", ch, NULL, victim, TO_CHAR);
	 act ("$n rams $s fingers into $N's eye sockets and rips $S face off.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n rams $s fingers into your eye sockets and rips your face off.", ch, NULL, victim, TO_VICT);
	 victim->form = 21;
	 make_part (victim, "face");
      }
      else if (damp == 2)
      {
	 act ("You grab $N by the throat and tear $S windpipe out.", ch, NULL,
	      victim, TO_CHAR);
	 act ("$n grabs $N by the throat and tears $S windpipe out.", ch,
	      NULL, victim, TO_NOTVICT);
	 act ("$n grabs you by the throat and tears your windpipe out.", ch,
	      NULL, victim, TO_VICT);
	 victim->form = 22;
	 make_part (victim, "windpipe");
      }
      else if (damp == 3)
      {
	 act ("You punch your fist through $N's stomach and rip out $S entrails.", ch, NULL, victim, TO_CHAR);
	 act ("$n punches $s fist through $N's stomach and rips out $S entrails.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n punches $s fist through your stomach and rips out your entrails.", ch, NULL, victim, TO_VICT);
	 victim->form = 23;
	 make_part (victim, "entrails");
      }
      else if (damp == 4)
      {
	 if (!IS_BODY (victim, BROKEN_SPINE))
	    SET_BIT (victim->loc_hp[1], BROKEN_SPINE);
	 act ("You hoist $N above your head and slam $M down upon your knee.\n\rThere is a loud cracking sound as $N's spine snaps.", ch, NULL, victim, TO_CHAR);
	 act ("$n hoists $N above $s head and slams $M down upon $s knee.\n\rThere is a loud cracking sound as $N's spine snaps.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n hoists you above $s head and slams you down upon $s knee.\n\rThere is a loud cracking sound as your spine snaps.", ch, NULL, victim, TO_VICT);
	 victim->form = 24;
      }
      else if (damp == 5)
      {
	 act ("You lock your arm around $N's head, and give it a vicious twist.", ch, NULL, victim, TO_CHAR);
	 act ("$n locks $s arm around $N's head, and gives it a vicious twist.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n locks $s arm around your head, and gives it a vicious twist.", ch, NULL, victim, TO_VICT);
	 if (!IS_BODY (victim, BROKEN_NECK))
	 {
	    act ("There is a loud snapping noise as your neck breaks.",
		 victim, NULL, NULL, TO_CHAR);
	    act ("There is a loud snapping noise as $n's neck breaks.",
		 victim, NULL, NULL, TO_ROOM);
	    SET_BIT (victim->loc_hp[1], BROKEN_NECK);
	 }
	 victim->form = 25;
      }
      return;
   }
   if (dt >= 0 && dt < MAX_SKILL)
      attack = skill_table[dt].noun_damage;
   else if (dt >= TYPE_HIT
	    && dt <
	    TYPE_HIT + sizeof (attack_table) / sizeof (attack_table[0]))
      attack = attack_table[dt - TYPE_HIT];
   else
   {
      dt = TYPE_HIT;
      attack = attack_table[0];
   }

   if (attack == "slash" || attack == "slice")
   {
      damp = number_range (1, 8);
      if (damp == 1)
      {
	 act ("You swing your blade in a low arc, rupturing $N's abdominal cavity.\n\r$N's entrails spray out over a wide area.", ch, NULL, victim, TO_CHAR);
	 act ("$n swings $s blade in a low arc, rupturing $N's abdominal cavity.\n\r$N's entrails spray out over a wide area.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n swings $s blade in a low arc, rupturing your abdominal cavity.\n\rYour entrails spray out over a wide area.", ch, NULL, victim, TO_VICT);
	 victim->form = 26;
	 make_part (victim, "entrails");
      }
      else if (damp == 2)
      {
	 act ("You thrust your blade into $N's mouth and twist it viciously.\n\rThe end of your blade bursts through the back of $S head.", ch, NULL, victim, TO_CHAR);
	 act ("$n thrusts $s blade into $N's mouth and twists it viciously.\n\rThe end of the blade bursts through the back of $N's head.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n thrusts $s blade into your mouth and twists it viciously.\n\rYou feel the end of the blade burst through the back of your head.", ch, NULL, victim, TO_VICT);
	 victim->form = 27;
      }
      else if (damp == 3)
      {
	 if (!IS_BODY (victim, CUT_THROAT))
	    SET_BIT (victim->loc_hp[1], CUT_THROAT);
	 if (!IS_BLEEDING (victim, BLEEDING_THROAT))
	    SET_BIT (victim->loc_hp[6], BLEEDING_THROAT);
	 act ("Your blow slices open $N's carotid artery, spraying blood everywhere.", ch, NULL, victim, TO_CHAR);
	 act ("$n's blow slices open $N's carotid artery, spraying blood everywhere.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n's blow slices open your carotid artery, spraying blood everywhere.", ch, NULL, victim, TO_VICT);
	 victim->form = 28;
	 make_part (victim, "blood");
      }
      else if (damp == 4)
      {
	 if (!IS_BODY (victim, CUT_THROAT))
	    SET_BIT (victim->loc_hp[1], CUT_THROAT);
	 if (!IS_BLEEDING (victim, BLEEDING_THROAT))
	    SET_BIT (victim->loc_hp[6], BLEEDING_THROAT);
	 act ("You swing your blade across $N's throat, showering the area with blood.", ch, NULL, victim, TO_CHAR);
	 act ("$n swings $s blade across $N's throat, showering the area with blood.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n swings $s blade across your throat, showering the area with blood.", ch, NULL, victim, TO_VICT);
	 victim->form = 29;
	 make_part (victim, "blood");
      }
      else if (damp == 5)
      {
	 if (!IS_HEAD (victim, BROKEN_SKULL))
	 {
	    act ("You swing your blade down upon $N's head, splitting it open.\n\r$N's brains pour out of $S forehead.", ch, NULL, victim, TO_CHAR);
	    act ("$n swings $s blade down upon $N's head, splitting it open.\n\r$N's brains pour out of $S forehead.", ch, NULL, victim, TO_NOTVICT);
	    act ("$n swings $s blade down upon your head, splitting it open.\n\rYour brains pour out of your forehead.", ch, NULL, victim, TO_VICT);
	    victim->form = 30;
	    make_part (victim, "brain");
	    SET_BIT (victim->loc_hp[0], BROKEN_SKULL);
	 }
	 else
	 {
	    act ("You plunge your blade deep into $N's chest.", ch, NULL,
		 victim, TO_CHAR);
	    act ("$n plunges $s blade deep into $N's chest.", ch, NULL,
		 victim, TO_NOTVICT);
	    act ("$n plunges $s blade deep into your chest.", ch, NULL,
		 victim, TO_VICT);
	    victim->form = 31;
	 }
      }
      else if (damp == 6)
      {
	 act ("You swing your blade between $N's legs, nearly splitting $M in half.", ch, NULL, victim, TO_CHAR);
	 act ("$n swings $s blade between $N's legs, nearly splitting $M in half.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n swings $s blade between your legs, nearly splitting you in half.", ch, NULL, victim, TO_VICT);
	 victim->form = 32;
      }
      else if (damp == 7)
      {
	 if (!IS_ARM_L (victim, LOST_ARM))
	 {
	    act ("You swing your blade in a wide arc, slicing off $N's arm.",
		 ch, NULL, victim, TO_CHAR);
	    act ("$n swings $s blade in a wide arc, slicing off $N's arm.",
		 ch, NULL, victim, TO_NOTVICT);
	    act ("$n swings $s blade in a wide arc, slicing off your arm.",
		 ch, NULL, victim, TO_VICT);
	    victim->form = 33;
	    make_part (victim, "arm");
	    SET_BIT (victim->loc_hp[2], LOST_ARM);
	    if (!IS_BLEEDING (victim, BLEEDING_ARM_L))
	       SET_BIT (victim->loc_hp[6], BLEEDING_ARM_L);
	    if (IS_BLEEDING (victim, BLEEDING_HAND_L))
	       REMOVE_BIT (victim->loc_hp[6], BLEEDING_HAND_L);
	 }
	 else if (!IS_ARM_R (victim, LOST_ARM))
	 {
	    act ("You swing your blade in a wide arc, slicing off $N's arm.",
		 ch, NULL, victim, TO_CHAR);
	    act ("$n swings $s blade in a wide arc, slicing off $N's arm.",
		 ch, NULL, victim, TO_NOTVICT);
	    act ("$n swings $s blade in a wide arc, slicing off your arm.",
		 ch, NULL, victim, TO_VICT);
	    victim->form = 33;
	    make_part (victim, "arm");
	    SET_BIT (victim->loc_hp[3], LOST_ARM);
	    if (!IS_BLEEDING (victim, BLEEDING_ARM_R))
	       SET_BIT (victim->loc_hp[6], BLEEDING_ARM_R);
	    if (IS_BLEEDING (victim, BLEEDING_HAND_R))
	       REMOVE_BIT (victim->loc_hp[6], BLEEDING_HAND_R);
	 }
	 else
	 {
	    act ("You plunge your blade deep into $N's chest.", ch, NULL,
		 victim, TO_CHAR);
	    act ("$n plunges $s blade deep into $N's chest.", ch, NULL,
		 victim, TO_NOTVICT);
	    act ("$n plunges $s blade deep into your chest.", ch, NULL,
		 victim, TO_VICT);
	    victim->form = 31;
	 }
      }
      else if (damp == 8)
      {
	 if (!IS_LEG_L (victim, LOST_LEG))
	 {
	    act ("You swing your blade in a low arc, slicing off $N's leg at the hip.", ch, NULL, victim, TO_CHAR);
	    act ("$n swings $s blade in a low arc, slicing off $N's leg at the hip.", ch, NULL, victim, TO_NOTVICT);
	    act ("$n swings $s blade in a wide arc, slicing off your leg at the hip.", ch, NULL, victim, TO_VICT);
	    victim->form = 34;
	    make_part (victim, "leg");
	    SET_BIT (victim->loc_hp[4], LOST_LEG);
	    if (!IS_BLEEDING (victim, BLEEDING_LEG_L))
	       SET_BIT (victim->loc_hp[6], BLEEDING_LEG_L);
	    if (IS_BLEEDING (victim, BLEEDING_FOOT_L))
	       REMOVE_BIT (victim->loc_hp[6], BLEEDING_FOOT_L);
	 }
	 else if (!IS_LEG_R (victim, LOST_LEG))
	 {
	    act ("You swing your blade in a low arc, slicing off $N's leg at the hip.", ch, NULL, victim, TO_CHAR);
	    act ("$n swings $s blade in a low arc, slicing off $N's leg at the hip.", ch, NULL, victim, TO_NOTVICT);
	    act ("$n swings $s blade in a wide arc, slicing off your leg at the hip.", ch, NULL, victim, TO_VICT);
	    victim->form = 34;
	    make_part (victim, "leg");
	    SET_BIT (victim->loc_hp[5], LOST_LEG);
	    if (!IS_BLEEDING (victim, BLEEDING_LEG_R))
	       SET_BIT (victim->loc_hp[6], BLEEDING_LEG_R);
	    if (IS_BLEEDING (victim, BLEEDING_FOOT_R))
	       REMOVE_BIT (victim->loc_hp[6], BLEEDING_FOOT_R);
	 }
	 else
	 {
	    act ("You plunge your blade deep into $N's chest.", ch, NULL,
		 victim, TO_CHAR);
	    act ("$n plunges $s blade deep into $N's chest.", ch, NULL,
		 victim, TO_NOTVICT);
	    act ("$n plunges $s blade deep into your chest.", ch, NULL,
		 victim, TO_VICT);
	    victim->form = 31;
	 }
      }
   }
   else if (attack == "stab" || attack == "pierce")
   {
      damp = number_range (1, 5);
      if (damp == 1)
      {
	 act ("You defty invert your weapon and plunge it point first into $N's chest.\n\rA shower of blood sprays from the wound, showering the area.", ch, NULL, victim, TO_CHAR);
	 act ("$n defty inverts $s weapon and plunge it point first into $N's chest.\n\rA shower of blood sprays from the wound, showering the area.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n defty inverts $s weapon and plunge it point first into your chest.\n\rA shower of blood sprays from the wound, showering the area.", ch, NULL, victim, TO_VICT);
	 make_part (victim, "blood");
	 victim->form = 31;
      }
      else if (damp == 2)
      {
	 act ("You thrust your blade into $N's mouth and twist it viciously.\n\rThe end of your blade bursts through the back of $S head.", ch, NULL, victim, TO_CHAR);
	 act ("$n thrusts $s blade into $N's mouth and twists it viciously.\n\rThe end of the blade bursts through the back of $N's head.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n thrusts $s blade into your mouth and twists it viciously.\n\rYou feel the end of the blade burst through the back of your head.", ch, NULL, victim, TO_VICT);
	 victim->form = 35;
      }
      else if (damp == 3)
      {
	 act ("You thrust your weapon up under $N's jaw and through $S head.",
	      ch, NULL, victim, TO_CHAR);
	 act ("$n thrusts $s weapon up under $N's jaw and through $S head.",
	      ch, NULL, victim, TO_NOTVICT);
	 act ("$n thrusts $s weapon up under your jaw and through your head.",
	      ch, NULL, victim, TO_VICT);
	 victim->form = 27;
      }
      else if (damp == 4)
      {
	 act ("You ram your weapon through $N's body, pinning $M to the ground.", ch, NULL, victim, TO_CHAR);
	 act ("$n rams $s weapon through $N's body, pinning $M to the ground.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n rams $s weapon through your body, pinning you to the ground.", ch, NULL, victim, TO_VICT);
	 victim->form = 31;
      }
      else if (damp == 5)
      {
	 act ("You stab your weapon into $N's eye and out the back of $S head.", ch, NULL, victim, TO_CHAR);
	 act ("$n stabs $s weapon into $N's eye and out the back of $S head.",
	      ch, NULL, victim, TO_NOTVICT);
	 act ("$n stabs $s weapon into your eye and out the back of your head.", ch, NULL, victim, TO_VICT);
	 victim->form = 36;
	 if (!IS_HEAD (victim, LOST_EYE_L) && number_percent () < 50)
	    SET_BIT (victim->loc_hp[0], LOST_EYE_L);
	 else if (!IS_HEAD (victim, LOST_EYE_R))
	    SET_BIT (victim->loc_hp[0], LOST_EYE_R);
	 else if (!IS_HEAD (victim, LOST_EYE_L))
	    SET_BIT (victim->loc_hp[0], LOST_EYE_L);
      }
   }
   else if (attack == "blast" || attack == "pound" || attack == "crush")
   {
      damp = number_range (1, 3);
      bodyloc = 0;
      if (damp == 1)
      {
	 act ("Your blow smashes through $N's chest, caving in half $S ribcage.", ch, NULL, victim, TO_CHAR);
	 act ("$n's blow smashes through $N's chest, caving in half $S ribcage.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n's blow smashes through your chest, caving in half your ribcage.", ch, NULL, victim, TO_VICT);
	 victim->form = 37;
	 if (IS_BODY (victim, BROKEN_RIBS_1))
	 {
	    bodyloc += 1;
	    REMOVE_BIT (victim->loc_hp[1], BROKEN_RIBS_1);
	 }
	 if (IS_BODY (victim, BROKEN_RIBS_2))
	 {
	    bodyloc += 2;
	    REMOVE_BIT (victim->loc_hp[1], BROKEN_RIBS_2);
	 }
	 if (IS_BODY (victim, BROKEN_RIBS_4))
	 {
	    bodyloc += 4;
	    REMOVE_BIT (victim->loc_hp[1], BROKEN_RIBS_4);
	 }
	 if (IS_BODY (victim, BROKEN_RIBS_8))
	 {
	    bodyloc += 8;
	    REMOVE_BIT (victim->loc_hp[1], BROKEN_RIBS_8);
	 }
	 if (IS_BODY (victim, BROKEN_RIBS_16))
	 {
	    bodyloc += 16;
	    REMOVE_BIT (victim->loc_hp[1], BROKEN_RIBS_16);
	 }
	 bodyloc += number_range (1, 3);
	 if (bodyloc > 24)
	    bodyloc = 24;
	 if (bodyloc >= 16)
	 {
	    bodyloc -= 16;
	    SET_BIT (victim->loc_hp[1], BROKEN_RIBS_16);
	 }
	 if (bodyloc >= 8)
	 {
	    bodyloc -= 8;
	    SET_BIT (victim->loc_hp[1], BROKEN_RIBS_8);
	 }
	 if (bodyloc >= 4)
	 {
	    bodyloc -= 4;
	    SET_BIT (victim->loc_hp[1], BROKEN_RIBS_4);
	 }
	 if (bodyloc >= 2)
	 {
	    bodyloc -= 2;
	    SET_BIT (victim->loc_hp[1], BROKEN_RIBS_2);
	 }
	 if (bodyloc >= 1)
	 {
	    bodyloc -= 1;
	    SET_BIT (victim->loc_hp[1], BROKEN_RIBS_1);
	 }
      }
      else if (damp == 2)
      {
	 act ("Your blow smashes $N's spine, shattering it in several places.", ch, NULL, victim, TO_CHAR);
	 act ("$n's blow smashes $N's spine, shattering it in several places.", ch, NULL, victim, TO_NOTVICT);
	 act ("$n's blow smashes your spine, shattering it in several places.", ch, NULL, victim, TO_VICT);
	 victim->form = 38;
	 if (!IS_BODY (victim, BROKEN_SPINE))
	    SET_BIT (victim->loc_hp[1], BROKEN_SPINE);
      }
      else if (damp == 3)
      {
	 if (!IS_HEAD (victim, BROKEN_SKULL))
	 {
	    act ("You swing your weapon down upon $N's head.\n\r$N's head cracks open like an overripe melon, leaking out brains.", ch, NULL, victim, TO_CHAR);
	    act ("$n swings $s weapon down upon $N's head.\n\r$N's head cracks open like an overripe melon, covering you with brains.", ch, NULL, victim, TO_NOTVICT);
	    act ("$n swings $s weapon down upon your head.\n\rYour head cracks open like an overripe melon, spilling your brains everywhere.", ch, NULL, victim, TO_VICT);
	    make_part (victim, "brain");
	    victim->form = 30;
	    SET_BIT (victim->loc_hp[0], BROKEN_SKULL);
	 }
	 else
	 {
	    act ("You hammer your weapon into $N's side, crushing bone.", ch,
		 NULL, victim, TO_CHAR);
	    act ("$n hammers $s weapon into $N's side, crushing bone.", ch,
		 NULL, victim, TO_NOTVICT);
	    act ("$n hammers $s weapon into your side, crushing bone.", ch,
		 NULL, victim, TO_VICT);
	    victim->form = 37;
	 }
      }
   }
   else if (!IS_NPC (ch) && (attack == "bite" || IS_VAMPAFF (ch, VAM_FANGS)))
   {
      act ("You sink your teeth into $N's throat and tear out $S jugular vein.\n\rYou wipe the blood from your chin with one hand.", ch, NULL, victim, TO_CHAR);
      act ("$n sink $s teeth into $N's throat and tears out $S jugular vein.\n\r$n wipes the blood from $s chin with one hand.", ch, NULL, victim, TO_NOTVICT);
      act ("$n sink $s teeth into your throat and tears out your jugular vein.\n\r$n wipes the blood from $s chin with one hand.", ch, NULL, victim, TO_VICT);
      make_part (victim, "blood");
      victim->form = 39;
      if (!IS_BODY (victim, CUT_THROAT))
	 SET_BIT (victim->loc_hp[1], CUT_THROAT);
      if (!IS_BLEEDING (victim, BLEEDING_THROAT))
	 SET_BIT (victim->loc_hp[6], BLEEDING_THROAT);
   }
   else if (!IS_NPC (ch) && (attack == "claw" || IS_VAMPAFF (ch, VAM_CLAWS)))
   {
      damp = number_range (1, 2);
      if (damp == 1)
      {
	 act ("You tear out $N's throat, showering the area with blood.", ch,
	      NULL, victim, TO_CHAR);
	 act ("$n tears out $N's throat, showering the area with blood.", ch,
	      NULL, victim, TO_NOTVICT);
	 act ("$n tears out your throat, showering the area with blood.", ch,
	      NULL, victim, TO_VICT);
	 victim->form = 40;
	 make_part (victim, "blood");
	 if (!IS_BODY (victim, CUT_THROAT))
	    SET_BIT (victim->loc_hp[1], CUT_THROAT);
	 if (!IS_BLEEDING (victim, BLEEDING_THROAT))
	    SET_BIT (victim->loc_hp[6], BLEEDING_THROAT);
      }
      if (damp == 2)
      {
	 if (!IS_HEAD (victim, LOST_EYE_L) && number_percent () < 50)
	 {
	    act ("You rip an eyeball from $N's face.", ch, NULL, victim,
		 TO_CHAR);
	    act ("$n rips an eyeball from $N's face.", ch, NULL, victim,
		 TO_NOTVICT);
	    act ("$n rips an eyeball from your face.", ch, NULL, victim,
		 TO_VICT);
	    make_part (victim, "eyeball");
	    victim->form = 41;
	    SET_BIT (victim->loc_hp[0], LOST_EYE_L);
	 }
	 else if (!IS_HEAD (victim, LOST_EYE_R))
	 {
	    act ("You rip an eyeball from $N's face.", ch, NULL, victim,
		 TO_CHAR);
	    act ("$n rips an eyeball from $N's face.", ch, NULL, victim,
		 TO_NOTVICT);
	    act ("$n rips an eyeball from your face.", ch, NULL, victim,
		 TO_VICT);
	    make_part (victim, "eyeball");
	    victim->form = 41;
	    SET_BIT (victim->loc_hp[0], LOST_EYE_R);
	 }
	 else if (!IS_HEAD (victim, LOST_EYE_L))
	 {
	    act ("You rip an eyeball from $N's face.", ch, NULL, victim,
		 TO_CHAR);
	    act ("$n rips an eyeball from $N's face.", ch, NULL, victim,
		 TO_NOTVICT);
	    act ("$n rips an eyeball from your face.", ch, NULL, victim,
		 TO_VICT);
	    make_part (victim, "eyeball");
	    victim->form = 41;
	    SET_BIT (victim->loc_hp[0], LOST_EYE_L);
	 }
	 else
	 {
	    act ("You claw open $N's chest.", ch, NULL, victim, TO_CHAR);
	    act ("$n claws open $N's chest.", ch, NULL, victim, TO_NOTVICT);
	    act ("$n claws open $N's chest.", ch, NULL, victim, TO_VICT);
	    victim->form = 42;
	 }
      }
   }
   else if (attack == "whip")
   {
      act ("You entangle $N around the neck, and squeeze the life out of $M.",
	   ch, NULL, victim, TO_CHAR);
      act ("$n entangle $N around the neck, and squeezes the life out of $M.",
	   ch, NULL, victim, TO_NOTVICT);
      act ("$n entangles you around the neck, and squeezes the life out of you.", ch, NULL, victim, TO_VICT);
      victim->form = 25;
      if (!IS_BODY (victim, BROKEN_NECK))
	 SET_BIT (victim->loc_hp[1], BROKEN_NECK);
   }
   else if (attack == "suck" || attack == "grep")
   {
      act ("You place your weapon on $N's head and suck out $S brains.", ch,
	   NULL, victim, TO_CHAR);
      act ("$n places $s weapon on $N's head and suck out $S brains.", ch,
	   NULL, victim, TO_NOTVICT);
      act ("$n places $s weapon on your head and suck out your brains.", ch,
	   NULL, victim, TO_VICT);
      victim->form = 43;
   }
   else
   {
      /*bug( "Dam_message: bad dt %d.", dt ); */
   }
   return;
}

/*
 * Disarm a creature.
 * Caller must check for successful attack.
 */
void disarm (CHAR_DATA * ch, CHAR_DATA * victim)
{
   OBJ_DATA *obj;
   char buf[MAX_STRING_LENGTH];

   /* I'm fed up of being disarmed every 10 seconds - KaVir */
   if (IS_NPC (ch) && victim->level > 2 && number_percent () > 5)
      return;
   if (IS_SUPER_NPC (victim))
      return;

   if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_DISARM)
       && !IS_SET (ch->warp, WARP_CLUMSY))
      return;
/*
    if ( ( (obj = get_eq_char( ch, WEAR_WIELD ) == NULL) || obj->item_type != ITEM_WEAPON )
    &&   ( (obj = get_eq_char( ch, WEAR_HOLD  ) == NULL) || obj->item_type != ITEM_WEAPON ) )
	return;
*/
   if (((obj = get_eq_char (victim, WEAR_WIELD)) == NULL)
       || obj->item_type != ITEM_WEAPON)
   {
      if (((obj = get_eq_char (victim, WEAR_HOLD)) == NULL)
	  || obj->item_type != ITEM_WEAPON)
          if (((obj = get_eq_char (victim, WEAR_DUAL)) == NULL)
              || obj->item_type != ITEM_WEAPON)
             return;
   }

   sprintf (buf, "#w$n disarms you!#n");
   act (buf, ch, NULL, victim, TO_VICT);
   sprintf (buf, "#wYou disarm $N!#n");
   act (buf, ch, NULL, victim, TO_CHAR);
   sprintf (buf, "#w$n disarms $N!#n");
   act (buf, ch, NULL, victim, TO_NOTVICT);

   obj_from_char (obj);

   /* Loyal weapons come back ;)  KaVir */
   if (IS_SET (obj->extra_flags, ITEM_LOYAL) && (!IS_NPC (victim)))
   {
      act ("$p leaps back into your hand!", victim, obj, NULL, TO_CHAR);
      act ("$p leaps back into $n's hand!", victim, obj, NULL, TO_ROOM);
      obj_to_char (obj, victim);
      do_wear (victim, obj->name);
   }
   else if (IS_NPC (victim))
      obj_to_char (obj, victim);
   else
      obj_to_room (obj, victim->in_room);

   return;
}

/*
 * Trip a creature.
 * Caller must check for successful attack.
 */
void trip (CHAR_DATA * ch, CHAR_DATA * victim)
{
   char buf[MAX_STRING_LENGTH];

   if (IS_AFFECTED (victim, AFF_FLYING))
      return;

   if (IS_NPC (ch) && victim->level > 2 && number_percent () > 5)
      return;
   if (IS_SUPER_NPC (victim))
      return;

   if (!IS_NPC (victim))
   {
      if (IS_CLASS (victim, CLASS_VAMPIRE) && IS_VAMPAFF (victim, VAM_FLYING))
	 return;
      if (IS_CLASS (victim, CLASS_DEMON) && IS_DEMAFF (victim, DEM_UNFOLDED))
	 return;
      if (IS_SET (victim->special, SPC_CHAMPION)
	  && IS_DEMAFF (victim, DEM_UNFOLDED))
	 return;
      if (IS_CLASS (victim, CLASS_DROW)
	  && IS_SET (victim->pcdata->powers[1], DPOWER_LEVITATION))
	 return;
   }
   if (victim->wait == 0)
   {
      sprintf (buf, "#w$n trips you and you go down!#n");
      act (buf, ch, NULL, victim, TO_VICT);
      sprintf (buf, "#wYou trip $N and $E goes down!#n");
      act (buf, ch, NULL, victim, TO_CHAR);
      sprintf (buf, "#w$n trips $N and $E goes down!#n");
      act (buf, ch, NULL, victim, TO_NOTVICT);

      WAIT_STATE (ch, 2 * PULSE_VIOLENCE);
      WAIT_STATE (victim, 2 * PULSE_VIOLENCE);
      victim->position = POS_RESTING;
   }

   return;
}

void do_kill (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;

   one_argument (argument, arg);
   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");

   if (arg[0] == '\0')
   {
      send_to_char ("Kill whom?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }

   if (victim == ch)
   {
      send_to_char ("You cannot kill yourself!\n\r", ch);
      return;
   }

   if (is_safe (ch, victim))
      return;

   if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
   {
      act ("$N is your beloved master.", ch, NULL, victim, TO_CHAR);
      return;
   }

   if (ch->position == POS_FIGHTING)
   {
      send_to_char ("You do the best you can!\n\r", ch);
      return;
   }

/* Autostancing - Loki */
   if (!IS_NPC (victim) && IS_SET (victim->extra, EXTRA_STANCE))
   {
      if (victim->stance[11] == STANCE_VIPER)
	 do_stance (victim, "viper");
      else if (victim->stance[11] == STANCE_CRANE)
	 do_stance (victim, "crane");
      else if (victim->stance[11] == STANCE_CRAB)
	 do_stance (victim, "crab");
      else if (victim->stance[11] == STANCE_MONGOOSE)
	 do_stance (victim, "mongoose");
      else if (victim->stance[11] == STANCE_BULL)
	 do_stance (victim, "bull");
      else if (victim->stance[11] == STANCE_MANTIS)
	 do_stance (victim, "mantis");
      else if (victim->stance[11] == STANCE_DRAGON)
	 do_stance (victim, "dragon");
      else if (victim->stance[11] == STANCE_TIGER)
	 do_stance (victim, "tiger");
      else if (victim->stance[11] == STANCE_MONKEY)
	 do_stance (victim, "monkey");
      else if (victim->stance[11] == STANCE_SWALLOW)
	 do_stance (victim, "swallow");
   }

/* Autostancing - Loki */
   if (!IS_NPC (ch) && IS_SET (ch->extra, EXTRA_STANCE))
   {
      if (ch->stance[11] == STANCE_VIPER)
	 do_stance (ch, "viper");
      else if (ch->stance[11] == STANCE_CRANE)
	 do_stance (ch, "crane");
      else if (ch->stance[11] == STANCE_CRAB)
	 do_stance (ch, "crab");
      else if (ch->stance[11] == STANCE_MONGOOSE)
	 do_stance (ch, "mongoose");
      else if (ch->stance[11] == STANCE_BULL)
	 do_stance (ch, "bull");
      else if (ch->stance[11] == STANCE_MANTIS)
	 do_stance (ch, "mantis");
      else if (ch->stance[11] == STANCE_DRAGON)
	 do_stance (ch, "dragon");
      else if (ch->stance[11] == STANCE_TIGER)
	 do_stance (ch, "tiger");
      else if (ch->stance[11] == STANCE_MONKEY)
	 do_stance (ch, "monkey");
      else if (ch->stance[11] == STANCE_SWALLOW)
	 do_stance (ch, "swallow");
   }

   WAIT_STATE (ch, (1 * PULSE_VIOLENCE) / 2);
   check_killer (ch, victim);
   if (!IS_NPC (ch) && !IS_NPC (victim) && !is_safe (ch, victim)
       && !is_safe (victim, ch))
   {
      ch->fight_timer += 3;
      victim->fight_timer += 3;
   }

   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_WEREWOLF)
       && number_range (1, 3) == 1 && ch->pcdata->powers[WPOWER_BOAR] > 1
       && victim->position == POS_STANDING)
   {
      act ("You charge into $N, knocking $M from $S feet.", ch, NULL, victim,
	   TO_CHAR);
      act ("$n charge into $N, knocking $M from $S feet.", ch, NULL, victim,
	   TO_NOTVICT);
      act ("$n charge into you, knocking you from your feet.", ch, NULL,
	   victim, TO_VICT);
      victim->position = POS_STUNNED;
      multi_hit (ch, victim, TYPE_UNDEFINED);
      multi_hit (ch, victim, TYPE_UNDEFINED);
      return;
   }

   else if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_NINJA)
	    && ch->pcdata->powers[NPOWER_NINGENNO] > 1
	    && IS_SET (ch->act, PLR_WIZINVIS)
	    && victim->position == POS_STANDING)
   {
      act ("Your arms multiply, hitting $N many times.", ch, NULL, victim,
	   TO_CHAR);
      act ("$n's arms multiply, hitting $N many times.", ch, NULL, victim,
	   TO_NOTVICT);
      act ("$n's arms multiply, hitting you many times.", ch, NULL, victim,
	   TO_VICT);
      multi_hit (ch, victim, TYPE_UNDEFINED);
      multi_hit (ch, victim, TYPE_UNDEFINED);
      return;
   }

   multi_hit (ch, victim, TYPE_UNDEFINED);
   return;
}

void do_circle (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   OBJ_DATA *obj;
   int dam;

   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_NINJA) || ch->pcdata->powers[NPOWER_NINGENNO] < 6)
   {
      send_to_char ("Huh?\n\r", ch);
      return;
   }

    if ( ( victim = ch->fighting ) == NULL )
    {
	if ( ( victim = get_char_room( ch, arg ) ) == NULL )
	{
	    send_to_char( "They aren't here.\n\r", ch );
	    return;
	}
    }

   if (victim == ch)
   {
      send_to_char ("How can you circle yourself?\n\r", ch);
      return;
   }

   if (is_safe (ch, victim))
      return;

   if (((obj = get_eq_char (ch, WEAR_WIELD)) == NULL || obj->value[3] != 11)
       && ((obj = get_eq_char (ch, WEAR_HOLD)) == NULL
           || obj->value[3] != 11)
       && ((obj = get_eq_char (ch, WEAR_DUAL)) == NULL
	   || obj->value[3] != 11))
   {
      send_to_char ("You need to wield a piercing weapon.\n\r", ch);
      return;
   }

   check_killer (ch, victim);
   dam = ch->wpn[11] * 5;
   dam += ch->race * 10;
   dam += char_damroll (ch);
   dam += ch->damcap[0]/2;

   damage (ch, victim, dam, gsn_circle);
   if (number_range(1,20) == 20)
   {
       damage (ch, victim, dam, gsn_circle);
   }
   WAIT_STATE (ch, skill_table[gsn_kick].beats);
   return;
}

void do_backstab (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   OBJ_DATA *obj;

   one_argument (argument, arg);

   if (arg[0] == '\0')
   {
      send_to_char ("Backstab whom?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }

   if (victim == ch)
   {
      send_to_char ("How can you sneak up on yourself?\n\r", ch);
      return;
   }

   if (is_safe (ch, victim))
      return;

   if (((obj = get_eq_char (ch, WEAR_WIELD)) == NULL || obj->value[3] != 11)
       && ((obj = get_eq_char (ch, WEAR_HOLD)) == NULL
           || obj->value[3] != 11)
       && ((obj = get_eq_char (ch, WEAR_DUAL)) == NULL
	   || obj->value[3] != 11))
   {
      send_to_char ("You need to wield a piercing weapon.\n\r", ch);
      return;
   }

   if (victim->fighting != NULL)
   {
      send_to_char ("You can't backstab a fighting person.\n\r", ch);
      return;
   }

   if (victim->hit < victim->max_hit && !IS_CLASS (ch, CLASS_DROW))
   {
      act ("$N is hurt and suspicious ... you can't sneak up.", ch, NULL,
	   victim, TO_CHAR);
      return;
   }

   check_killer (ch, victim);
   WAIT_STATE (ch, skill_table[gsn_backstab].beats);

   if (!IS_CLASS (ch, CLASS_DROW) && !IS_CLASS (ch, CLASS_NINJA)
       && !IS_NPC (victim) && IS_IMMUNE (victim, IMM_BACKSTAB))
   {
      if ((IS_CLASS (ch, CLASS_NINJA)
	   && ch->pcdata->powers[NPOWER_NINGENNO] < 2)
	  || (!IS_CLASS (ch, CLASS_DROW) && !IS_CLASS (ch, CLASS_NINJA)))
	 damage (ch, victim, 0, gsn_backstab);
   }

   else if (!IS_AWAKE (victim) || IS_NPC (ch)
	    || number_percent () < ch->pcdata->learned[gsn_backstab])
      multi_hit (ch, victim, gsn_backstab);
   else
   {
      one_hit (ch, victim, gsn_backstab, 1);
   }
   return;
}

void do_flee (CHAR_DATA * ch, char *argument)
{
   ROOM_INDEX_DATA *was_in;
   ROOM_INDEX_DATA *now_in;
   CHAR_DATA *victim;
   char buf[MAX_STRING_LENGTH];
   int attempt;

   if (IS_CLASS (ch, CLASS_HIGHLANDER))
      WAIT_STATE (ch, 24);
   else
      WAIT_STATE (ch, 20);

   if ((victim = ch->fighting) == NULL)
   {
      if (ch->position == POS_FIGHTING)
	 ch->position = POS_STANDING;
      send_to_char ("You aren't fighting anyone.\n\r", ch);
      return;
   }
   if (ch->move <= 0)
   {
      send_to_char ("You can't find the energy to leave.\n\r", ch);
      return;
   }
   if (IS_CLASS (ch, CLASS_HIGHLANDER) && (ch->fight_timer > 0)
       && (ch->quickening[0] > 0))
   {
      stc ("You were unable to escape!!\n\r", ch);
      WAIT_STATE (ch, 12);
      return;
   }
   if (IS_AFFECTED (ch, AFF_WEBBED))
   {
      send_to_char
	 ("You are unable to move with all this sticky webbing on.\n\r", ch);
      return;
   }
   if (IS_SET (ch->affected_by, AFF_ENTRAILS))
   {
      send_to_char
	 ("You are unable to move with these entrails entrapping you.\n\r",
	  ch);
      return;
   }
   if (is_garou (victim) && victim->gifts[GETOFFENRIS] >= 1)
   {
      if (number_range (1, 4) == 2)
      {
	 stc ("Gaia prevents you from fleeing her child.\n\r", ch);
	 return;
      }
   }

   if (IS_CLASS (victim, CLASS_VAMPIRE) && IS_SET (victim->newbits, NEW_COIL)
       && number_percent () > 15)
   {
      sprintf (buf, "Not with %s coiled around you!", victim->name);
      send_to_char (buf, ch);
      act ("$n cant escape with $N coiled around them.", ch, NULL, victim,
	   TO_ROOM);
      return;
   }

   if (IS_SET (ch->flag2, AFF2_TENDRILS))
   {
      send_to_char ("You are unable to move while tangled in tendrils.\n\r",
		    ch);
      return;
   }
   if (IS_SET (ch->flag2, AFF_TOTALBLIND))
   {
      stc ("You are unable to see anything, let alone flee!\n\r", ch);
      return;
   }
   if (!IS_NPC (ch) && ch->pcdata->stats[UNI_RAGE] >= 0)
   {
      if (IS_CLASS (ch, CLASS_VAMPIRE)
	  && number_percent () <= ch->pcdata->stats[UNI_RAGE])
      {
	 send_to_char ("Your inner beast refuses to let you run!\n\r", ch);
	 WAIT_STATE (ch, 12);
	 return;
      }
      else if (IS_CLASS (ch, CLASS_WEREWOLF)
	       && number_percent () <= ch->pcdata->stats[UNI_RAGE] * 0.3)
      {
	 send_to_char ("Your rage is too great!\n\r", ch);
	 WAIT_STATE (ch, 12);
	 return;
      }
   }

   was_in = ch->in_room;
   for (attempt = 0; attempt < 6; attempt++)
   {
      EXIT_DATA *pexit;
      int door;

      if (WORN_ARTIFACT(ch, ARTI_MAIDENS_BREATH))
         break;

      door = number_door ();

      if ((pexit = was_in->exit[door]) == 0 || pexit->to_room == NULL
	  || IS_SET (pexit->exit_info, EX_CLOSED) || (IS_NPC (ch)
						      &&
						      IS_SET
						      (pexit->to_room->
						       room_flags,
						       ROOM_NO_MOB)))
	 continue;
      if (ch->in_room->vnum >= 32900 && ch->in_room->vnum <= 32904
	  && door == 4)
	 continue;
      if (ch->fight_timer > 0 && ch->in_room->vnum == 3001 && door == 0)
	 continue;
      move_char (ch, door);
      if ((now_in = ch->in_room) == was_in)
	 continue;

      ch->in_room = was_in;
      act ("$n has fled!", ch, NULL, NULL, TO_ROOM);
      ch->in_room = now_in;

      if (!IS_NPC (ch))
	 send_to_char ("You flee from combat!  Coward!\n\r", ch);
      WAIT_STATE (ch, 12);

      if ((IS_CLASS (victim, CLASS_DROW)
          || (IS_CLASS(victim, CLASS_FAE) && IS_KITH (victim, KITH_SLUAGH)))
	  && IS_SET (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS))
	 REMOVE_BIT (victim->in_room->room_flags, ROOM_TOTAL_DARKNESS);
      if ((IS_CLASS (victim, CLASS_DROW)
          || (IS_CLASS(victim, CLASS_FAE) && IS_KITH (victim, KITH_SLUAGH)))
	  && IS_SET (victim->newbits, NEW_DARKNESS))
      {
	 stc ("You leave your darkness in a panic!\n\r", ch);
	 REMOVE_BIT (victim->newbits, NEW_DARKNESS);
	 act ("$N leaves $S darkness in a panic!", ch, NULL, victim,
	      TO_NOTVICT);
      }
      stop_fighting (ch, TRUE);
      return;
   }
   send_to_char ("You were unable to escape!\n\r", ch);
   return;
}

void do_rescue (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   CHAR_DATA *fch;

   one_argument (argument, arg);
   if (arg[0] == '\0')
   {
      send_to_char ("Rescue whom?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }

   if (victim == ch)
   {
      send_to_char ("What about fleeing instead?\n\r", ch);
      return;
   }

   if (!IS_NPC (ch) && IS_NPC (victim))
   {
      send_to_char ("Doesn't need your help!\n\r", ch);
      return;
   }

   if (ch->fighting == victim)
   {
      send_to_char ("Too late.\n\r", ch);
      return;
   }

   if ((fch = victim->fighting) == NULL)
   {
      send_to_char ("That person is not fighting right now.\n\r", ch);
      return;
   }

   if (is_safe (ch, fch) || is_safe (ch, victim))
      return;

   WAIT_STATE (ch, skill_table[gsn_rescue].beats);
   if (!IS_NPC (ch) && number_percent () > ch->pcdata->learned[gsn_rescue])
   {
      send_to_char ("You fail the rescue.\n\r", ch);
      return;
   }

   act ("You rescue $N!", ch, NULL, victim, TO_CHAR);
   act ("$n rescues you!", ch, NULL, victim, TO_VICT);
   act ("$n rescues $N!", ch, NULL, victim, TO_NOTVICT);

   stop_fighting (fch, FALSE);
   stop_fighting (victim, FALSE);

   check_killer (ch, fch);
   set_fighting (ch, fch);
   set_fighting (fch, ch);

   do_humanity (ch, "");
   return;
}

void do_kick (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   OBJ_DATA *boots;
   int dam;
   int stance;
   int chance;

   one_argument (argument, arg);

   chance = number_percent ();
   if (IS_NPC (ch) && !IS_SUPER_NPC (ch))
   {
      stc ("You cant kick!\n\r", ch);
      return;
   }
   if (!IS_NPC (ch) && ch->level < skill_table[gsn_kick].skill_level)
   {
      send_to_char ("First you should learn to kick.\n\r", ch);
      return;
   }

   if (!IS_NPC (ch) && chance > 40 && IS_CLASS (ch, CLASS_DEMON)
       && IS_SET (ch->warp, WARP_CLUMSY))
   {
      stc ("You are so clumsy you fall on your ass trying to kick!\n\r", ch);
      ch->move -= 500;
      return;
   }

   if (!IS_NPC (ch) && IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD)
       && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD)
       && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");

   if (arg[0] == '\0' && ch->fighting == NULL)
   {
      send_to_char ("Who do you wish to kick?\n\r", ch);
      return;
   }

   if ((victim = ch->fighting) == NULL)
   {
      if ((victim = get_char_room (ch, arg)) == NULL)
      {
	 send_to_char ("They aren't here.\n\r", ch);
	 return;
      }
   }

   if (ch == victim)
   {
      send_to_char ("Kick YOURSELF?\n\r", ch);
      return;
   }

   if (!IS_NPC (ch) && IS_ITEMAFF (ch, ITEMA_PEACE))
   {
      send_to_char ("You are unable to attack them.\n\r", ch);
      return;
   }

   if (!IS_NPC (victim) && IS_ITEMAFF (victim, ITEMA_PEACE))
   {
      send_to_char ("You can't seem to attack them.\n\r", ch);
      return;
   }

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_SAFE))
   {
      send_to_char ("You cannot attack people under Gaia's protection.\n\r",
		    ch);
      return;
   }

   if (is_safe (ch, victim))
      return;
   WAIT_STATE (ch, skill_table[gsn_kick].beats);
   if (IS_NPC (ch) || number_percent () < ch->pcdata->learned[gsn_kick])
      dam = number_range (1, 4);
   else
   {
      dam = 0;
      damage (ch, victim, dam, gsn_kick);
      return;
   }
if (ch->damcap[DAM_CHANGE] == 1)
   {
      update_damcap (ch, victim);
   }
 
   if (IS_CLASS(ch, CLASS_DEMON) )
       dam += ch->damcap[0];
   dam += char_damroll (ch);
   if (dam == 0)
      dam = 1;
   if (!IS_AWAKE (victim))
      dam *= 2;


   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DRAGON))
      dam *= 1.5;

   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DEMON)
       && IS_SET (ch->warp, WARP_STRONGLEGS))
   {
      dam *= 1.5;
   }

/*
    if ( !IS_NPC(ch) && IS_CLASS(ch, CLASS_VAMPIRE) &&
	IS_VAMPAFF(ch, VAM_POTENCE) )
*/
   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_VAMPIRE)
       && get_disc(ch, VAM_POTE) > 1)

      dam *= 1 + (get_disc(ch, VAM_POTE) * .1);
//      dam *= get_disc(ch, VAM_POTE);
//      dam *= 1.2;
   else if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_MONK)
       && ch->chi[CURRENT] > 0)
      dam *= 1 + (ch->chi[CURRENT] * .1);
   else if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_NINJA)
	    && ch->pcdata->powers[NPOWER_CHIKYU] > 2)
      dam *= 1.25;

   /*drow */
   else if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_DROW))
   {
      if (IS_SET (ch->pcdata->powers[1], DPOWER_TOUGHSKIN))
	 dam *= 1.6;
   }
/*drow*/

//Wraith

   else if (!IS_NPC (ch)
	    && (IS_SET (ch->special, SPC_CHAMPION)
		|| IS_CLASS (ch, CLASS_DEMON)) && IS_DEMPOWER (ch, DEM_MIGHT))
      dam *= 1.2;
   else if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_HIGHLANDER))
   {
      if IS_DEMPOWER
	 (ch, HPOWER_MIGHT) dam *= 2;
   }

   if (!IS_NPC (ch) && IS_NDEMPOWER (ch, DEM_FLAMEHOOVES)
       && !IS_AFFECTED (victim, AFF_FLAMING)
       && !WORN_ARTIFACT (victim, ARTI_DEMONS_HEART))
   {
      if (number_percent () > 65)
	 SET_BIT (victim->affected_by, AFF_FLAMING);
   }
   if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_WEREWOLF))
   {
      if (IS_SET (victim->special, SPC_WOLFMAN))
	 dam *= 0.5;
      if ((boots = get_eq_char (ch, WEAR_FEET)) != NULL
	  && IS_SET (boots->spectype, SITEM_SILVER))
	 dam *= 2;
   }
   /* Vampires should be tougher at night and weaker during the day. */
   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_VAMPIRE))
   {
      if (weather_info.sunlight == SUN_LIGHT && dam > 1 && !IS_IMMUNE (ch,IMM_SUNLIGHT))
	 dam /= 1.5;
      else
	 dam *= 1.5;
   }
   if (!IS_NPC (ch))
      dam = dam + (dam * ((ch->wpn[0] + 1) / 100));

   if (!IS_NPC (ch))
   {
      stance = ch->stance[0];
      if (IS_STANCE (ch, STANCE_NORMAL))
	 dam *= 1.25;
      else
	 dam = dambonus (ch, victim, dam, stance);
   }

   if (dam <= 0)
      dam = 1;

   if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_KICK)
       && !(IS_DEMAFF (ch, DEM_HOOVES)
	    || IS_CLASS (ch, CLASS_DRAGON)))
   {
      dam = 0;
      damage (ch, victim, dam, gsn_kick);
   }
   else if (IS_SUPER_NPC (victim))
   {
      dam = 0;
      damage (ch, victim, dam, gsn_kick);
   }
/*
    if (!IS_NPC(victim) && IS_CLASS(victim, CLASS_HIGHLANDER) && IS_DEMPOWER(victim,HPOWER_TOUGHNESS))
    {
        char buf [MAX_STRING_LENGTH];
        int skin;
        int rebound;

        skin = number_range(1,50);
        rebound = number_range(1,50);
        if (skin == 10 || skin == 20 || skin == 30 || skin == 40 || skin == 50)
        {
            stc("#3You bounce their pathetic kick off your skin#n.\n\r",victim);
            stc("#3Your opponent bounces your kick off their skin#n.\n\r",ch);
			if (rebound == 10 || rebound == 30 || rebound == 50)
			{
					sprintf(buf,"#3The bounced kick slams into them#n. [#1%d#n]\n\r",dam  / 2);
					stc(buf,victim);
					sprintf(buf,"#3Your kick bounces and slams into you#n. [#1%d#n]\n\r",dam / 2);
					stc(buf,ch);
					dam /= 2;
					damage( ch, ch, dam, gsn_kick );
			}
			dam = 0;
        }
    }
*/
   else
      damage (ch, victim, dam, gsn_kick);
   return;
}

int dambonus (CHAR_DATA * ch, CHAR_DATA * victim, int dam, int stance)
{
   if (dam < 1)
      return 0;
   if (stance < 1)
      return dam;
   if (!IS_NPC (ch) && !can_counter (victim))
   {
      if (IS_STANCE (ch, STANCE_MONKEY))
      {
	 int mindam = dam * 0.25;

	 dam *= (ch->stance[STANCE_MONKEY] + 1) / 200;
	 if (dam < mindam)
	    dam = mindam;
      }
/* Tijer - Testing Something
		else if (IS_STANCE(ch, STANCE_BULL) && ch->stance[STANCE_BULL] > 100)
			dam += dam * (ch->stance[STANCE_BULL] / 100);
		else if (IS_STANCE(ch, STANCE_DRAGON) && ch->stance[STANCE_DRAGON] > 100)
			dam += dam * (ch->stance[STANCE_DRAGON] / 100);
		else if (IS_STANCE(ch, STANCE_TIGER) && ch->stance[STANCE_TIGER] > 100)
			dam += dam * (ch->stance[STANCE_TIGER] / 100);
		else if (ch->stance[0] > 0 && ch->stance[stance] < 100)
			dam *= 0.5;
*/
      else if (IS_STANCE (ch, STANCE_BULL) && ch->stance[STANCE_BULL] > 100)
	 dam += dam * (ch->stance[STANCE_BULL] * 0.01);
      else if (IS_STANCE (ch, STANCE_DRAGON)
	       && ch->stance[STANCE_DRAGON] > 100)
	 dam += dam * (ch->stance[STANCE_DRAGON] * 0.01);
      else if (IS_STANCE (ch, STANCE_TIGER) && ch->stance[STANCE_TIGER] > 100)
	 dam += dam * (ch->stance[STANCE_TIGER] * 0.01);
      else if (ch->stance[0] > 0 && ch->stance[stance] < 100)
	 dam *= 0.5;
   }
   if (!IS_NPC (victim) && !can_counter (ch))
   {
      if (IS_STANCE (victim, STANCE_CRAB)
	  && victim->stance[STANCE_CRAB] > 100)
	 dam /= victim->stance[STANCE_CRAB] * 0.01;
      else if (IS_STANCE (victim, STANCE_DRAGON)
	       && victim->stance[STANCE_DRAGON] > 100)
	 dam /= victim->stance[STANCE_DRAGON] * 0.01;
      else if (IS_STANCE (victim, STANCE_SWALLOW)
	       && victim->stance[STANCE_SWALLOW] > 100)
	 dam /= victim->stance[STANCE_SWALLOW] * 0.01;
/*
		if (IS_STANCE(victim, STANCE_CRAB) && victim->stance[STANCE_CRAB] > 100)
			dam /= victim->stance[STANCE_CRAB] / 100;
		else if (IS_STANCE(victim, STANCE_DRAGON) && victim->stance[STANCE_DRAGON] > 100)
			dam /= victim->stance[STANCE_DRAGON] / 100;
		else if (IS_STANCE(victim, STANCE_SWALLOW) && victim->stance[STANCE_SWALLOW] > 100)
			dam /= victim->stance[STANCE_SWALLOW] / 100;
*/

   }
   return dam;
}

void do_punch (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   int dam;
   bool broke = FALSE;

   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (ch->level < skill_table[gsn_punch].skill_level)
   {
      send_to_char ("First you should learn to punch.\n\r", ch);
      return;
   }
   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("You aren't fighting anyone.\n\r", ch);
      return;
   }

   if (ch == victim)
   {
      send_to_char ("You cannot punch yourself!\n\r", ch);
      return;
   }

   if (is_safe (ch, victim))
      return;

   if (victim->hit < victim->max_hit)
   {
      send_to_char ("They are hurt and suspicious.\n\r", ch);
      return;
   }

   if (victim->position < POS_FIGHTING)
   {
      send_to_char ("You can only punch someone who is standing.\n\r", ch);
      return;
   }
   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");

   act ("You draw your fist back and aim a punch at $N.", ch, NULL, victim,
	TO_CHAR);
   act ("$n draws $s fist back and aims a punch at you.", ch, NULL, victim,
	TO_VICT);
   act ("$n draws $s fist back and aims a punch at $N.", ch, NULL, victim,
	TO_NOTVICT);
   WAIT_STATE (ch, skill_table[gsn_punch].beats);
   if (IS_NPC (ch) || number_percent () < ch->pcdata->learned[gsn_punch])
      dam = number_range (1, 4);
   else
   {
      dam = 0;
      damage (ch, victim, dam, gsn_punch);
      return;
   }

   dam += char_damroll (ch);
   if (dam == 0)
      dam = 1;
   if (!IS_AWAKE (victim))
      dam *= 2;
   if (!IS_NPC (ch))
      dam = dam + (dam * (ch->wpn[0] / 100));

   if (dam <= 0)
      dam = 1;

   if ((!IS_NPC (victim) && IS_CLASS (victim, CLASS_WEREWOLF)
	&& victim->pcdata->powers[WPOWER_BOAR] > 3) || IS_SUPER_NPC (victim))
   {
      dam = 0;
      damage (ch, victim, dam, gsn_punch);
      if (number_percent () <= 25 && !IS_ARM_L (ch, LOST_ARM)
	  && !IS_ARM_L (ch, LOST_HAND))
      {
	 if (!IS_ARM_L (ch, LOST_FINGER_I) && !IS_ARM_L (ch, BROKEN_FINGER_I))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_I);
	    broke = TRUE;
	 }
	 if (!IS_ARM_L (ch, LOST_FINGER_M) && !IS_ARM_L (ch, BROKEN_FINGER_M))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_M);
	    broke = TRUE;
	 }
	 if (!IS_ARM_L (ch, LOST_FINGER_R) && !IS_ARM_L (ch, BROKEN_FINGER_R))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_R);
	    broke = TRUE;
	 }
	 if (!IS_ARM_L (ch, LOST_FINGER_L) && !IS_ARM_L (ch, BROKEN_FINGER_L))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_L);
	    broke = TRUE;
	 }
	 if (broke)
	 {
	    act ("The fingers on your left hand shatter under the impact of the blow!", ch, NULL, NULL, TO_CHAR);
	    act ("The fingers on $n's left hand shatter under the impact of the blow! ", ch, NULL, NULL, TO_ROOM);
	 }
      }
      else if (number_percent () <= 25 && !IS_ARM_R (ch, LOST_ARM)
	       && !IS_ARM_R (ch, LOST_HAND))
      {
	 if (!IS_ARM_R (ch, LOST_FINGER_I) && !IS_ARM_R (ch, BROKEN_FINGER_I))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_I);
	    broke = TRUE;
	 }
	 if (!IS_ARM_R (ch, LOST_FINGER_M) && !IS_ARM_R (ch, BROKEN_FINGER_M))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_M);
	    broke = TRUE;
	 }
	 if (!IS_ARM_R (ch, LOST_FINGER_R) && !IS_ARM_R (ch, BROKEN_FINGER_R))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_R);
	    broke = TRUE;
	 }
	 if (!IS_ARM_R (ch, LOST_FINGER_L) && !IS_ARM_R (ch, BROKEN_FINGER_L))
	 {
	    SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_L);
	    broke = TRUE;
	 }
	 if (broke)
	 {
	    act ("The fingers on your right hand shatter under the impact of the blow!", ch, NULL, NULL, TO_CHAR);
	    act ("The fingers on $n's right hand shatter under the impact of the blow! ", ch, NULL, NULL, TO_ROOM);
	 }
      }
      stop_fighting (victim, TRUE);
      return;
   }

   damage (ch, victim, dam, gsn_punch);
   if (victim == NULL || victim->position == POS_DEAD || dam < 1)
      return;
   if (victim->position == POS_FIGHTING)
      stop_fighting (victim, TRUE);
   if (number_percent () <= 25 && !IS_HEAD (victim, BROKEN_NOSE)
       && !IS_HEAD (victim, LOST_NOSE))
   {
      act ("Your nose shatters under the impact of the blow!", victim, NULL,
	   NULL, TO_CHAR);
      act ("$n's nose shatters under the impact of the blow!", victim, NULL,
	   NULL, TO_ROOM);
      SET_BIT (victim->loc_hp[LOC_HEAD], BROKEN_NOSE);
   }
   else if (number_percent () <= 25 && !IS_HEAD (victim, BROKEN_JAW))
   {
      act ("Your jaw shatters under the impact of the blow!", victim, NULL,
	   NULL, TO_CHAR);
      act ("$n's jaw shatters under the impact of the blow!", victim, NULL,
	   NULL, TO_ROOM);
      SET_BIT (victim->loc_hp[LOC_HEAD], BROKEN_JAW);
   }
   act ("You fall to the ground stunned!", victim, NULL, NULL, TO_CHAR);
   act ("$n falls to the ground stunned!", victim, NULL, NULL, TO_ROOM);
   victim->position = POS_STUNNED;
   return;
}

void do_berserk (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *vch;
   CHAR_DATA *vch_next;
   CHAR_DATA *mount;
   int number_hit = 0;

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (ch->level < skill_table[gsn_berserk].skill_level)
   {
      send_to_char ("You are not wild enough to go berserk.\n\r", ch);
      return;
   }

   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");

   WAIT_STATE (ch, (skill_table[gsn_berserk].beats / 2));
   if (number_percent () > ch->pcdata->learned[gsn_berserk])
   {
      act ("You rant and rave, but nothing much happens.", ch, NULL, NULL,
	   TO_CHAR);
      act ("$n gets a wild look in $s eyes, but nothing much happens.", ch,
	   NULL, NULL, TO_ROOM);
      return;
   }

   act ("You go BERSERK!", ch, NULL, NULL, TO_CHAR);
   act ("$n goes BERSERK!", ch, NULL, NULL, TO_ROOM);

   if (ch->fighting == NULL)
       autodrop (ch);

   for (vch = char_list; vch != NULL; vch = vch_next)
   {
      vch_next = vch->next;
      if (number_hit > 4)
	 continue;
      if (is_same_group (ch, vch))
	 continue;

      if (vch->in_room == NULL)
	 continue;
      if (!IS_NPC (vch) && vch->pcdata->chobj != NULL)
	 continue;
      if (ch == vch)
	 continue;
      if (ch->in_room != vch->in_room)
         continue;
      if (vch->in_room != ch->in_room)
         continue;
      if (vch->in_room == ch->in_room)
      {
	 if ((mount = ch->mount) != NULL)
	 {
	    if (mount == vch)
	       continue;
	 }
	 if (can_see (ch, vch))
	 {
/* Autostancing - Loki 
	    if (!IS_NPC (vch) && IS_SET (vch->extra, EXTRA_STANCE))
	    {
	       if (vch->stance[11] == STANCE_VIPER)
		  do_stance (vch, "viper");
	       else if (vch->stance[11] == STANCE_CRANE)
		  do_stance (vch, "crane");
	       else if (vch->stance[11] == STANCE_CRAB)
		  do_stance (vch, "crab");
	       else if (vch->stance[11] == STANCE_MONGOOSE)
		  do_stance (vch, "mongoose");
	       else if (vch->stance[11] == STANCE_BULL)
		  do_stance (vch, "bull");
	       else if (vch->stance[11] == STANCE_MANTIS)
		  do_stance (vch, "mantis");
	       else if (vch->stance[11] == STANCE_DRAGON)
		  do_stance (vch, "dragon");
	       else if (vch->stance[11] == STANCE_TIGER)
		  do_stance (vch, "tiger");
	       else if (vch->stance[11] == STANCE_MONKEY)
		  do_stance (vch, "monkey");
	       else if (vch->stance[11] == STANCE_SWALLOW)
		  do_stance (vch, "swallow");
	    }
*/
	    //if (!IS_NPC (vch))
	    if (vch->fighting == NULL)
	       autodrop (vch);
	    multi_hit (ch, vch, TYPE_UNDEFINED);
	    number_hit++;
	 }
      }
   }

}

/* Hurl skill by KaVir */
void do_hurl (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   CHAR_DATA *mount;
   ROOM_INDEX_DATA *to_room;
   EXIT_DATA *pexit;
   EXIT_DATA *pexit_rev;
   char buf[MAX_INPUT_LENGTH];
   char direction[MAX_INPUT_LENGTH];
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   int door;
   int rev_dir;
   int dam;

   argument = one_argument (argument, arg1);
   argument = one_argument (argument, arg2);
   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");

   if (!IS_NPC (ch) && ch->pcdata->learned[gsn_hurl] < 1)
   {
      send_to_char ("Maybe you should learn the skill first?\n\r", ch);
      return;
   }

   if (arg1[0] == '\0')
   {
      send_to_char ("Who do you wish to hurl?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg1)) == NULL)
   {
      send_to_char ("They are not here.\n\r", ch);
      return;
   }

   if (victim == ch)
   {
      send_to_char ("How can you hurl yourself?\n\r", ch);
      return;
   }

   if (is_safe (ch, victim))
      return;

   if ((mount = victim->mount) != NULL && victim->mounted == IS_MOUNT)
   {
      send_to_char ("But they have someone on their back!\n\r", ch);
      return;
   }
   else if ((mount = victim->mount) != NULL && victim->mounted == IS_RIDING)
   {
      send_to_char ("But they are riding!\n\r", ch);
      return;
   }

   if (!is_garou (ch) || (is_garou (ch) && ch->gifts[UKTENA] < 5))
   {
      if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_HURL))
      {
	 send_to_char ("You are unable to get their feet of the ground.\n\r",
		       ch);
	 return;
      }
   }

   if (!is_garou (ch) || (is_garou (ch) && ch->gifts[UKTENA] < 5))
   {
      if (IS_NPC (victim) && victim->level > 900)
      {
	 send_to_char ("You are unable to get their feet of the ground.\n\r",
		       ch);
	 return;
      }
   }

   if ((victim->hit < victim->max_hit)
       || (victim->position == POS_FIGHTING && victim->fighting != ch))
   {
      act ("$N is hurt and suspicious, and you are unable to approach $M.",
	   ch, NULL, victim, TO_CHAR);
      return;
   }

   WAIT_STATE (ch, skill_table[gsn_hurl].beats);
   if (!IS_NPC (ch) && number_percent () > ch->pcdata->learned[gsn_hurl])
   {
      send_to_char ("You are unable to get their feet of the ground.\n\r",
		    ch);
      multi_hit (victim, ch, TYPE_UNDEFINED);
      return;
   }

   rev_dir = 0;

   if (arg2[0] == '\0')
      door = number_range (0, 3);
   else
   {
      if (!str_cmp (arg2, "n") || !str_cmp (arg2, "north"))
	 door = 0;
      else if (!str_cmp (arg2, "e") || !str_cmp (arg2, "east"))
	 door = 1;
      else if (!str_cmp (arg2, "s") || !str_cmp (arg2, "south"))
	 door = 2;
      else if (!str_cmp (arg2, "w") || !str_cmp (arg2, "west"))
	 door = 3;
      else
      {
	 send_to_char
	    ("You can only hurl people north, south, east or west.\n\r", ch);
	 return;
      }
   }

   if (door == 0)
   {
      sprintf (direction, "north");
      rev_dir = 2;
   }
   if (door == 1)
   {
      sprintf (direction, "east");
      rev_dir = 3;
   }
   if (door == 2)
   {
      sprintf (direction, "south");
      rev_dir = 0;
   }
   if (door == 3)
   {
      sprintf (direction, "west");
      rev_dir = 1;
   }

   if ((pexit = ch->in_room->exit[door]) == NULL
       || (to_room = pexit->to_room) == NULL)
   {
      sprintf (buf, "$n hurls $N into the %s wall.", direction);
      act (buf, ch, NULL, victim, TO_NOTVICT);
      sprintf (buf, "You hurl $N into the %s wall.", direction);
      act (buf, ch, NULL, victim, TO_CHAR);
      sprintf (buf, "$n hurls you into the %s wall.", direction);
      act (buf, ch, NULL, victim, TO_VICT);
      dam = number_range (ch->level, (ch->level * 4));
      victim->hit = victim->hit - dam;
      update_pos (victim);
      if (victim->position == POS_DEAD)
      {
	 raw_kill (victim, ch);
	 victim->form = 16;
	 return;
      }

      return;
   }

   pexit = victim->in_room->exit[door];
   if (IS_SET (pexit->exit_info, EX_CLOSED)
       && !IS_AFFECTED (victim, AFF_PASS_DOOR)
       && !IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      if (IS_SET (pexit->exit_info, EX_LOCKED))
	 REMOVE_BIT (pexit->exit_info, EX_LOCKED);
      if (IS_SET (pexit->exit_info, EX_CLOSED))
	 REMOVE_BIT (pexit->exit_info, EX_CLOSED);
      sprintf (buf, "$n hoists $N in the air and hurls $M %s.", direction);
      act (buf, ch, NULL, victim, TO_NOTVICT);
      sprintf (buf, "You hoist $N in the air and hurl $M %s.", direction);
      act (buf, ch, NULL, victim, TO_CHAR);
      sprintf (buf, "$n hurls you %s, smashing you through the %s.",
	       direction, pexit->keyword);
      act (buf, ch, NULL, victim, TO_VICT);
      sprintf (buf, "There is a loud crash as $n smashes through the $d.");
      act (buf, victim, NULL, pexit->keyword, TO_ROOM);

      if ((to_room = pexit->to_room) != NULL
	  && (pexit_rev = to_room->exit[rev_dir]) != NULL
	  && pexit_rev->to_room == ch->in_room && pexit_rev->keyword != NULL)
      {
	 if (IS_SET (pexit_rev->exit_info, EX_LOCKED))
	    REMOVE_BIT (pexit_rev->exit_info, EX_LOCKED);
	 if (IS_SET (pexit_rev->exit_info, EX_CLOSED))
	    REMOVE_BIT (pexit_rev->exit_info, EX_CLOSED);
	 if (door == 0)
	    sprintf (direction, "south");
	 if (door == 1)
	    sprintf (direction, "west");
	 if (door == 2)
	    sprintf (direction, "north");
	 if (door == 3)
	    sprintf (direction, "east");
	 char_from_room (victim);
	 char_to_room (victim, to_room);
	 sprintf (buf, "$n comes smashing in through the %s $d.", direction);
	 act (buf, victim, NULL, pexit->keyword, TO_ROOM);
	 dam = number_range (ch->level, (ch->level * 6));
	 victim->hit = victim->hit - dam;
	 update_pos (victim);
	 if (victim->position == POS_DEAD)
	 {
	    raw_kill (victim, ch);
	    victim->form = 16;
	    return;
	 }
      }
   }
   else
   {
      sprintf (buf, "$n hurls $N %s.", direction);
      act (buf, ch, NULL, victim, TO_NOTVICT);
      sprintf (buf, "You hurl $N %s.", direction);
      act (buf, ch, NULL, victim, TO_CHAR);
      sprintf (buf, "$n hurls you %s.", direction);
      act (buf, ch, NULL, victim, TO_VICT);
      if (door == 0)
	 sprintf (direction, "south");
      if (door == 1)
	 sprintf (direction, "west");
      if (door == 2)
	 sprintf (direction, "north");
      if (door == 3)
	 sprintf (direction, "east");
      char_from_room (victim);
      char_to_room (victim, to_room);
      sprintf (buf, "$n comes flying in from the %s.", direction);
      act (buf, victim, NULL, NULL, TO_ROOM);
      dam = number_range (ch->level, (ch->level * 2));
      victim->hit = victim->hit - dam;
      update_pos (victim);
      if (victim->position == POS_DEAD)
      {
	 raw_kill (victim, ch);
	 victim->form = 16;
	 return;
      }
   }
   return;
}

void do_disarm (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   OBJ_DATA *obj;
   int percent;

   if (!IS_NPC (ch) && ch->level < skill_table[gsn_disarm].skill_level)
   {
      send_to_char ("You don't know how to disarm opponents.\n\r", ch);
      return;
   }

   if ((get_eq_char (ch, WEAR_WIELD) == NULL)
       && (get_eq_char (ch, WEAR_HOLD) == NULL)
       && (get_eq_char (ch, WEAR_DUAL) == NULL))
   {
      send_to_char ("You must wield a weapon to disarm.\n\r", ch);
      return;
   }

   if ((victim = ch->fighting) == NULL)
   {
      send_to_char ("You aren't fighting anyone.\n\r", ch);
      return;
   }

   if (((obj = get_eq_char (victim, WEAR_WIELD)) == NULL)
       && ((obj = get_eq_char (victim, WEAR_HOLD)) == NULL)
       && ((obj = get_eq_char (victim, WEAR_DUAL)) == NULL))
   {
      send_to_char ("Your opponent is not wielding a weapon.\n\r", ch);
      return;
   }

   WAIT_STATE (ch, skill_table[gsn_disarm].beats);
   percent = number_percent () + victim->level - ch->level;
   if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_DISARM))

      send_to_char ("You failed.\n\r", ch);
   else if (IS_NPC (ch) || percent < ch->pcdata->learned[gsn_disarm] * 2 / 3)
      disarm (ch, victim);
   else
      send_to_char ("You failed.\n\r", ch);
   return;
}

void do_sla (CHAR_DATA * ch, char *argument)
{
   send_to_char ("If you want to SLAY, spell it out.\n\r", ch);
   return;
}

void do_slay (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];

   one_argument (argument, arg);
   if (arg[0] == '\0')
   {
      send_to_char ("Slay whom?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }

   if (ch == victim)
   {
      send_to_char ("Suicide is a mortal sin.\n\r", ch);
   }

   if (IS_SET (victim->act, PLR_GODLESS))
   {
      send_to_char ("You failed.\n\r", ch);
      return;
   }

   if (IS_NPC (victim) && IS_SET (victim->act, ACT_NO_KILL))
   {
      stc ("That Mobile is a QUEST MOB!!\n\r", ch);
      return;
   }
   if (!IS_NPC (victim) && victim->level >= ch->level && ch != victim)
   {
      send_to_char ("You failed.\n\r", ch);
      return;
   }

   act ("You slay $M in cold blood!", ch, NULL, victim, TO_CHAR);
   act ("$n slays you in cold blood!", ch, NULL, victim, TO_VICT);
   act ("$n slays $N in cold blood!", ch, NULL, victim, TO_NOTVICT);
   victim->form = 18;
   raw_kill (victim, ch);
   return;

}

/* Had problems with people not dying when POS_DEAD...KaVir */
void do_killperson (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];

   one_argument (argument, arg);
   if (arg[0] == '\0')
      return;
   if ((victim = get_char_room (ch, arg)) == NULL)
      return;
   send_to_char ("You have been KILLED!!\n\r\n\r", victim);
   raw_kill (victim, ch);
   return;
}

void do_diabkill (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];

   one_argument (argument, arg);
   if (arg[0] == '\0')
      return;
   if ((victim = get_char_room (ch, arg)) == NULL)
      return;
   send_to_char ("You have been Diablerised!!\n\r\n\r", victim);
   raw_kill (victim, ch);
   ch->pcdata->condition[COND_THIRST] = COND_FULL;

   return;
}

int souls_needed (CHAR_DATA * ch)
{
   int souls;

   souls = (ch->pcdata->stats[UNI_GEN] + 1) * 5;
   return souls;
}
void do_soulsteal (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   char buf[MAX_STRING_LENGTH];

   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      stc ("Huh?\n\r", ch);
      return;
   }

   if (is_inarena (ch))
   {
      stc ("Not while in the arena!\n\r", ch);
      return;
   }

   if (arg[0] == '\0')
   {
      send_to_char ("Who's soul are you going to steal?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }

   if (IS_CLASS (victim, CLASS_DEMON))
   {
      stc ("Demons don't have a soul!\n\r", ch);
      return;
   }

   if (ch == victim)
   {
      send_to_char ("That might be a bit tricky...\n\r", ch);
      return;
   }

   if (IS_NPC (victim))
   {
      send_to_char ("You can only steal the soul of other players.\n\r", ch);
      return;
   }

   if (!CAN_PK (ch))
   {
      send_to_char ("You must be an avatar to steal someone's soul.\n\r", ch);
      return;
   }

   if (!CAN_PK (victim))
   {
      send_to_char ("You can only steal the soul of other Avatars.\n\r", ch);
      return;
   }

   if (victim->position > 1)
   {
      send_to_char ("You can only do this to mortally wounded players.\n\r",
		    ch);
      return;
   }

   if (is_safe (ch, victim))
      return;
   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      stc ("Leave people in the war alone!\n\r", ch);
      return;
   }
   if (IS_SET (ch->war, WARRING))
   {
      stc ("Not while in a war!\n\r", ch);
      return;
   }

   if ((get_hours (ch) < 10) && ch->race == 0
       && !IS_SET (ch->extra2, PKREADY))
   {
      send_to_char ("You cannot soulsteal  players yet.", ch);
      return;
   }
   if ((get_hours (victim) < 10) && victim->race == 0
       && !IS_SET (victim->extra2, PKREADY))
   {
      send_to_char ("You may not soulsteal a newbie!\n\r", ch);
      sprintf (buf, "%s has felt the wrath of the gods for newbie killing!",
	       ch->name);
      do_restore (victim, victim->name);
      do_paradox (ch, "self");
      SET_BIT (ch->newbits, WANTED);
      do_info (ch, buf);
      return;
   }
   act ("You tear $N's soul out of their body!", ch, NULL, victim, TO_CHAR);
   send_to_char ("Your soul is torn from your body!\n\r", victim);
   act ("$n tears $N's soul out of $S lifeless body!", ch, NULL, victim,
	TO_NOTVICT);
   act ("$n's soul is torn from $s body!", victim, NULL, NULL, TO_ROOM);

   victim->hit = 1;
   victim->fight_timer = 0;
   update_pos (victim);
   WAIT_STATE (ch, 12);
   char_from_room (victim);
   char_to_room (victim, get_room_index (ROOM_VNUM_ALTAR));

   if (IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);

   if ((IS_CLASS (ch, CLASS_DROW)
         || (IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH)))
         && IS_SET (ch->newbits, NEW_DARKNESS))
      REMOVE_BIT (ch->newbits, NEW_DARKNESS);

   ch->fight_timer = 10;

   ch->pcdata->souls++;
   if (ch->pcdata->souls >= souls_needed (ch))
      stc ("You have achieved the required souls for a promotion!\n\r", ch);

   if (IS_CLASS (victim, CLASS_VAMPIRE))
      do_mortalvamp (victim, "");
   else if (IS_SET (victim->special, SPC_WOLFMAN))
      do_unwerewolf (victim, "");
   if (IS_CLASS (victim, CLASS_MAGE) && IS_AFFECTED (victim, AFF_POLYMORPH))
      do_unpolymorph (victim, "");

/*
	free_string(victim->pcdata->decapped);
	victim->pcdata->decapped = str_dup(ch->name);
	free_string(victim->pcdata->decappedby);
	victim->pcdata->decappedby = str_dup(ch->name);
*/
   victim->pcdata->stats[UNI_RAGE] = 0;
   sprintf (buf, "#r%s#w has just had a part of their soul stolen by #r%s!",
	    victim->name, ch->name);
   do_fatality (ch, buf);
   sprintf (log_buf, "%s soulstolen by %s at %d.", victim->name, ch->name,
	    victim->in_room->vnum);
   log_string (log_buf, ch);
   if (!IS_SET (ch->newbits, WANTED))
      SET_BIT (ch->newbits, WANTED);

   return;
}
void do_dgourge (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   char buf[MAX_STRING_LENGTH];

   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DRAGON))
   {
      stc ("Huh?\n\r", ch);
      return;
   }

   if (is_inarena (ch))
   {
      stc ("Not while in the arena!\n\r", ch);
      return;
   }

   if (arg[0] == '\0')
   {
      send_to_char ("Who do you wish to gourge on?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }


   if (ch == victim)
   {
      send_to_char ("That might be a bit tricky...\n\r", ch);
      return;
   }

   if (IS_NPC (victim))
   {
      send_to_char ("You can only steal the soul of other players.\n\r", ch);
      return;
   }

   if (!CAN_PK (ch))
   {
      send_to_char ("You must be an avatar to steal someone's soul.\n\r", ch);
      return;
   }

   if (!CAN_PK (victim))
   {
      send_to_char ("You can only steal the soul of other Avatars.\n\r", ch);
      return;
   }

   if (victim->position > 1)
   {
      send_to_char ("You can only do this to mortally wounded players.\n\r",
		    ch);
      return;
   }

   if (is_safe (ch, victim))
      return;
   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      stc ("Leave people in the war alone!\n\r", ch);
      return;
   }
   if (IS_SET (ch->war, WARRING))
   {
      stc ("Not while in a war!\n\r", ch);
      return;
   }

   if ((get_hours (ch) < 10) && ch->race == 0
       && !IS_SET (ch->extra2, PKREADY))
   {
      send_to_char ("You cannot gourge on players yet.", ch);
      return;
   }
   if ((get_hours (victim) < 10) && victim->race == 0
       && !IS_SET (victim->extra2, PKREADY))
   {
      send_to_char ("You may not gourge on a newbie!\n\r", ch);
      sprintf (buf, "%s has felt the wrath of the gods for newbie killing!",
	       ch->name);
      do_restore (victim, victim->name);
      do_paradox (ch, "self");
      SET_BIT (ch->newbits, WANTED);
      do_info (ch, buf);
      return;
   }
   act ("You feed on $N's life force!", ch, NULL, victim, TO_CHAR);
   send_to_char ("You feel your life force being drained from your body!\n\r",
		 victim);
   act ("$n feeds on $N's life force and drains is out of $S body!", ch, NULL,
	victim, TO_NOTVICT);
   act ("$n's life is drained from $s body!", victim, NULL, NULL, TO_ROOM);

   victim->hit = 1;
   update_pos (victim);
   victim->fight_timer = 0;
   WAIT_STATE (ch, 12);
   char_from_room (victim);
   char_to_room (victim, get_room_index (ROOM_VNUM_ALTAR));
   if (IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))
      REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);

   if ((IS_CLASS (ch, CLASS_DROW)
         || (IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH)))
         && IS_SET (ch->newbits, NEW_DARKNESS))
      REMOVE_BIT (ch->newbits, NEW_DARKNESS);

   ch->fight_timer = 10;

   ch->pcdata->condition[COND_FULL] = 24000;
   //ch->pkill = ch->pkill + 1;
   //victim->pdeath = victim->pdeath + 1;
   if (IS_CLASS (victim, CLASS_VAMPIRE))
      do_mortalvamp (victim, "");
   else if (IS_SET (victim->special, SPC_WOLFMAN))
      do_unwerewolf (victim, "");
   if (IS_CLASS (victim, CLASS_MAGE) && IS_AFFECTED (victim, AFF_POLYMORPH))
      do_unpolymorph (victim, "");

   victim->pcdata->stats[UNI_RAGE] = 0;
   sprintf (buf, "#r%s #whas fed on the lifeforce of #r%s!#n",
	    ch->name, victim->name);
   do_fatality (ch, buf);
   sprintf (log_buf, "%s gourged by %s at %d.", victim->name, ch->name,
	    victim->in_room->vnum);
   log_string (log_buf, ch);

   return;
}

void do_psac (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   char buf[MAX_STRING_LENGTH];
        
   one_argument (argument, arg);
        
   if (IS_NPC (ch))
      return;
      
   if (is_inarena (ch))
   {
      stc ("Not while in the arena!\n\r", ch);
      return;
   }

   if (arg[0] == '\0')
   {
      send_to_char ("Who do you wish to sacrifice to the gods?\n\r", ch);
      return;
   }
   
   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }
    
      
   if (ch == victim)
   {
      send_to_char ("That might be a bit tricky...\n\r", ch);
      return;
   }
      
   if (IS_NPC (victim))
   {
      send_to_char ("You can only sacrifice other players.\n\r", ch);
      return;
   }
      
   if (!CAN_PK (ch))
   {
      send_to_char ("You must be an avatar to sacrifice players to the gods.\n\r", ch);
      return;
   }
      
   if (!CAN_PK (victim))
   {
      send_to_char ("You can only sacrifice other Avatars.\n\r", ch);
      return;
   }
    
   if (victim->position > 1)
   {
      send_to_char ("You can only do this to mortally wounded players.\n\r",
                    ch);
      return;
   }
      
   if (is_safe (ch, victim))
      return;
   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      stc ("Leave people in the war alone!\n\r", ch);
      return;
   }
   if (IS_SET (ch->war, WARRING))
   {  
      stc ("Not while in a war!\n\r", ch);
      return;
   }
      
   if ((get_hours (ch) < 10) && ch->race == 0
       && !IS_SET (ch->extra2, PKREADY))
   {
      send_to_char ("You cannot sacrifice on players yet.", ch);
      return;
   }
   if ((get_hours (victim) < 10) && victim->race == 0
       && !IS_SET (victim->extra2, PKREADY))
   {  
      send_to_char ("You may not gourge on a newbie!\n\r", ch);
      sprintf (buf, "%s has felt the wrath of the gods for newbie killing!",
               ch->name);
      do_restore (victim, victim->name);
      do_paradox (ch, "self");
      SET_BIT (ch->newbits, WANTED);
      do_info (ch, buf);
      return;
   }  
   act ("You sacrifice $N to the gods!", ch, NULL, victim, TO_CHAR);
   send_to_char ("You have been sacrificed to the gods!\n\r",
                 victim);
   act ("$n sacrifices $N to the gods", ch, NULL,
        victim, TO_NOTVICT);
   act ("$n has been sacrified to the gods!", victim, NULL, NULL, TO_ROOM);
    
   victim->hit = victim->max_hit;
   update_pos (victim);
   victim->fight_timer = 0;
   WAIT_STATE (ch, 12);
   char_from_room (victim);
   char_to_room (victim, get_room_index (ROOM_VNUM_ALTAR));
   if (IS_SET (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS))  
      REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);
               
   if ((IS_CLASS (ch, CLASS_DROW)
         || (IS_CLASS(ch, CLASS_FAE) && IS_KITH (ch, KITH_SLUAGH)))
         && IS_SET (ch->newbits, NEW_DARKNESS))
      REMOVE_BIT (ch->newbits, NEW_DARKNESS);
      
   ch->fight_timer = 10;
      
   if (IS_CLASS (victim, CLASS_VAMPIRE))
      do_mortalvamp (victim, "");
   else if (IS_SET (victim->special, SPC_WOLFMAN))
      do_unwerewolf (victim, "");
   if (IS_CLASS (victim, CLASS_MAGE) && IS_AFFECTED (victim, AFF_POLYMORPH))
      do_unpolymorph (victim, "");

   victim->pcdata->pkill_timer += 120;   
   victim->pcdata->login_timer += 180;   
   victim->pcdata->stats[UNI_RAGE] = 0;
   sprintf (buf, "#r%s #whas sacrificed #r%s #wto the gods!#n",
            ch->name, victim->name);
   do_fatality (ch, buf);
   sprintf (log_buf, "%s sacrificed by %s at %d.", victim->name, ch->name,
            victim->in_room->vnum);
   log_string (log_buf, ch);
   
   return;
}     

/* Gen Stealing is in - Matthew */
void do_gensteal (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MIL];
   char buf[MSL];

   if (!IS_NPC(ch) && IS_CLASS(ch, CLASS_VAMPIRE))
   {
      do_diablerise(ch, argument);
      return;
   }

   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;
   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");
   if (arg[0] == '\0')
   {
      send_to_char ("Steal whos generation?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }
   if (IS_NPC (victim))
   {
      send_to_char ("Not on a mobile.\n\r", ch);
      return;
   }

   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      stc ("Leave people in the war alone!\n\r", ch);
      return;
   }
   if (IS_SET (ch->war, WARRING))
   {
      stc ("Not while in a war!\n\r", ch);
      return;
   }

   if (is_inarena (ch))
      return;

   if (ch == victim)
   {
      send_to_char ("That might be a bit tricky...\n\r", ch);
      return;
   }

   if (ch->pcdata->pkill_timer > 0)
   {
      stc ("You are unable to steal their generation with a safe timer\n\r",
	   ch);
      return;
   }
   if (victim->pcdata->pkill_timer > 0)
   {
      stc ("You are unable to steal their generation.\n\r", ch);
      return;
   }

   if (IS_NEWBIE (victim) && !IS_SET (victim->extra2, PKREADY))
   {
      stc ("You are unable to steal newbies generations.\n\r", ch);
      return;
   }
   if (IS_CREATOR (victim))
   {
      stc ("You failed|\n\r", ch);
      return;
   }
   if (!CAN_PK (ch))
   {
      send_to_char ("You must be an avatar to steal someones generation.\n\r",
		    ch);
      return;
   }

   if (!CAN_PK (victim))
   {
      send_to_char ("You can only steal generations from other avatars.\n\r",
		    ch);
      return;
   }

   if (victim->position > 1)
   {
      send_to_char ("You can only do this to mortally wounded players.\n\r",
		    ch);
      return;
   }
   if (ch->pcdata->stats[UNI_GEN] == 2)
   {
      stc ("You have the lowest possible gen!\n\r", ch);
      return;
   }
   if (ch->pcdata->stats[UNI_GEN] < victim->pcdata->stats[UNI_GEN])
   {
      stc ("Your generation is lower than theirs already!\n\r", ch);
      return;
   }
   if (victim->pcdata->stats[UNI_GEN] == 13)
   {
      stc ("Their generation is worthless to you!\n\r", ch);
      return;
   }
   if (ch->class != victim->class)
   {
      stc ("You can only steal generations from your own class.\n\r", ch);
      return;
   }
   if (victim->pcdata->stats[UNI_GEN] == 1)
   {
      stc ("They are too powerful!\n\r", ch);
      return;
   }
   if (is_safe (ch, victim))
      return;

   if ((get_hours (victim) < 10) && victim->race == 0
       && !IS_SET (victim->extra2, PKREADY))
   {
      send_to_char ("You may not gensteal a newbie!\n\r", ch);
      sprintf (buf, "%s has felt the wrath of the gods for newbie killing!",
	       ch->name);
      do_restore (victim, victim->name);
      do_paradox (ch, "self");
      SET_BIT (ch->newbits, WANTED);
      do_info (ch, buf);
      return;
   }
   act ("Lightning arcs from the sky and through your body as you steal the powers of $N.\n\r", ch, NULL, victim, TO_CHAR);
   act ("$n puts his hands on $N's head and lightning shoots through $s body.\n\r", ch, NULL, victim, TO_NOTVICT);
   send_to_char ("Your generation has been stolen.\n\r", victim);

   sprintf (buf, "%s has beaten %s and stolen their generation!", ch->name,
	    victim->name);
   do_fatality (ch, buf);
   sprintf (log_buf, "%s genstolen by %s at %d.", victim->name, ch->name,
	    victim->in_room->vnum);
   log_string (log_buf, ch);
   ch->pcdata->stats[UNI_GEN]--;
   victim->pcdata->stats[UNI_GEN]++;
   victim->hit = 1;
   victim->fight_timer = 0;
   update_pos (victim);
   WAIT_STATE (ch, 12);
   char_from_room (victim);
   char_to_room (victim, get_room_index (ROOM_VNUM_ALTAR));
   if (!IS_SET (ch->newbits, WANTED))
      SET_BIT (ch->newbits, WANTED);
   return;
}
OBJ_DATA *ch_weapon (CHAR_DATA * ch, bool right_hand)
{
   OBJ_DATA *wpn1 = NULL, *wpn2 = NULL;

   wpn1 = get_eq_char (ch, WEAR_WIELD);
   wpn2 = get_eq_char (ch, WEAR_HOLD);

   if (wpn1 == NULL) 
      wpn1 = get_eq_char (ch, WEAR_DUAL);

   if (wpn1 == NULL || wpn1->item_type != ITEM_WEAPON)
      wpn1 = NULL; 

   if (wpn2 == NULL || wpn2->item_type != ITEM_WEAPON)
      wpn2 = NULL;

   if (!wpn2)  
      return wpn1;
   if (!wpn1)
      return wpn2;
   if (right_hand)
      return wpn1;
   else               
      return wpn2;
}
/* For decapitating players - KaVir */
void do_decapitate (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   OBJ_DATA *obj;
   OBJ_DATA *obj_next;
//   OBJ_DATA *obj2;
   char arg[MAX_INPUT_LENGTH];
   char buf[MAX_STRING_LENGTH];
   char wanted[MSL];
   char paradoxlog[MSL];

   one_argument (argument, arg);
      bool ARTI = FALSE;

   if (IS_NPC (ch))
      return;

   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");
   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");
/*
   obj2 = get_eq_char (ch, WEAR_HOLD);

   if ((obj = get_eq_char (ch, WEAR_WIELD)) == NULL)
   {
      if ((obj2 = get_eq_char (ch, WEAR_HOLD)) == NULL)
      {
         if ((obj2 = get_eq_char (ch, WEAR_DUAL)) == NULL)
         {
            send_to_char ("First you better get a weapon out!\n\r", ch);
            return;
         }
      }
   }
*/
 obj = ch_weapon( ch, FALSE );

    if (!obj)
    {
	    send_to_char( "First you better get a weapon out!\n\r", ch );
	    return;
    }


/*
   if ((obj != NULL && obj->item_type != ITEM_WEAPON))
   {
      if ((obj2 != NULL && obj2->item_type != ITEM_WEAPON))
      {
	 send_to_char ("But you are not wielding any weapons!\n\r", ch);
	 return;
      }
   }
 Stupid code this 
    if ( ( obj  != NULL && obj->value[3]  != 1 && obj->value[3]  != 3 )
    &&   ( obj2 != NULL && obj2->value[3] != 1 && obj2->value[3] != 3 ) )
    {
	send_to_char( "You need to wield a slashing or slicing weapon to decapitate.\n\r", ch );
	return;
    }
*/
   if (arg[0] == '\0')
   {
      send_to_char ("Decapitate whom?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }
   if (IS_NPC (victim))
   {
      send_to_char ("You can only decapitate other players.\n\r", ch);
      return;
   }
   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      stc ("Leave people in the war alone!\n\r", ch);
      return;
   }
   if (IS_SET (ch->war, WARRING))
   {
      stc ("Not while in a war!\n\r", ch);
      return;
   }

   if (ch == victim)
   {
      send_to_char ("That might be a bit tricky...\n\r", ch);
      return;
   }

   if (IS_NEWBIE (victim))
   {
      stc ("You are unable to Decapitate Newbies.\n\r", ch);
      return;
   }
   if (IS_SET (victim->in_room->room_flags, ROOM_NODECAP) && !nosafe && victim->fight_timer == 0)
   {
      send_to_char
	 ("The intense magic of the room, stops you from decapitating.\n\r",
	  ch);
      return;
   }
  if (ch->pcdata->pkill_timer > 0)
   {
      stc ("You are unable to decapitate with a safe timer\n\r", 
           ch);
      return;
   }
   if (victim->pcdata->pkill_timer > 0)
   {
      stc ("You are unable to decap people with safe timers.\n\r", ch);
      return;
   }
   if (IS_CREATOR (victim))
   {
      stc ("You failed|\n\r", ch);
      return;
   }

/*
    buf2 = ch->race * (ch->race - victim->race) * 50;

    if (((ch->race - victim->race) > WizConfig->paradoxlimit && victim->race < 50) && ch->max_hit < ch->race * (ch->race - victim->race) * 50 + buf2)
    {
        send_to_char("You don't have enough hitpoints to do this. You might get flicked for this. \n\r" 
	 	     " You need the amount of hps you'll be flicked for.\n\r",ch);
        return;
    }
*/
   if (!CAN_PK (ch))
   {
      send_to_char ("You must be an avatar to decapitate someone.\n\r", ch);
      return;
   }

   if (!CAN_PK (victim))
   {
      send_to_char ("You can only decapitate other avatars.\n\r", ch);
      return;
   }

   if (victim->position > 1)
   {
      send_to_char ("You can only do this to mortally wounded players.\n\r",
		    ch);
      return;
   }

   if (is_safe (ch, victim))
      return;

   if ((get_hours (ch) < 10) && ch->race == 0
       && !IS_SET (ch->extra2, PKREADY))
   {
      send_to_char ("You cannot decapitate players yet.", ch);
      return;
   }
   if ((get_hours (victim) < 10) && victim->race == 0
       && !IS_SET (victim->extra2, PKREADY))
   {
      send_to_char ("You may not 'cap a newbie!\n\r", ch);
      sprintf (buf, "%s has felt the wrath of the gods for newbie killing!",
	       ch->name);
      do_restore (victim, victim->name);
      do_paradox (ch, "self");
      SET_BIT (ch->newbits, WANTED);
      do_info (ch, wanted);
      return;
   }

   if (ch != victim && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF(ch, VAM_MORTAL))
       && IS_SET (ch->special, SPC_INCONNU)
       && (IS_CLASS (victim, CLASS_VAMPIRE)
	   || IS_VAMPAFF (victim, VAM_MORTAL)))
   {
      send_to_char ("You cannot decapitate another vampire.\n\r", ch);
      return;
   }

   if (ch != victim && (IS_CLASS (victim, CLASS_VAMPIRE) || IS_VAMPAFF(victim, VAM_MORTAL))
       && IS_SET (victim->special, SPC_INCONNU)
       && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF (ch, VAM_MORTAL)))
   {
      send_to_char ("You cannot decapitate a member of the Inconnu.\n\r", ch);
      return;
   }
//WANTEDD
   if (victim->in_room->vnum >= 3000 && victim->in_room->vnum <= 3373
       && !nosafe && !IS_SET (victim->newbits, WANTED))
   {
      stc ("You decapitated in Midgarrd, you are now wanted.\n\r", ch);
      SET_BIT (ch->newbits, WANTED);
      sprintf (wanted, "%s is now wanted!!", ch->name);
      do_info (ch, wanted);
   }

   act ("You bring your weapon down upon $N's neck!", ch, NULL, victim,
	TO_CHAR);
   send_to_char ("Your head is sliced from your shoulders!\n\r", victim);
   act ("$n swings $s weapon down towards $N's neck!", ch, NULL, victim,
	TO_NOTVICT);
   act ("$n's head is sliced from $s shoulders!", victim, NULL, NULL,
	TO_ROOM);

   if ((IS_CLASS (ch, CLASS_DEMON) || IS_SET (ch->special, SPC_CHAMPION))
       && !IS_CLASS (victim, CLASS_DEMON)
       && !IS_SET (victim->special, SPC_CHAMPION)
       && !IS_CLASS (ch, CLASS_DROW))
   {
      if (ch->race == 0 && victim->race == 0)
      {
	 ch->pcdata->stats[DEMON_CURRENT] += 1000;
	 ch->pcdata->stats[DEMON_TOTAL] += 1000;
      }
      else
      {
	 ch->pcdata->stats[DEMON_CURRENT] += victim->race * 1000;
	 ch->pcdata->stats[DEMON_TOTAL] += victim->race * 1000;
      }
   }
   if (IS_CLASS (ch, CLASS_DROW) && !IS_CLASS (victim, CLASS_DEMON)
       && !IS_CLASS (victim, CLASS_DROW))
   {
      if (victim->race == 0 && ch->race == 0)
	 ch->pcdata->stats[DROW_POWER] += 1000;
      else
	 ch->pcdata->stats[DROW_POWER] += 1000 * victim->race;
   }

   if ( victim->clannum > 0 && victim->clannum != ch->clannum)
   {
     if( ch->clannum == 0 )
     {
       sprintf(buf, "#r%s#7 has been decapitated by #r%s#7! Avenge your fellow clanmember's death!", victim->name, ch->name);
       do_claninfo(victim, buf);
       nclans_table[victim->clannum].retalclan = str_dup( ch->name );
     }
     else
     {
       sprintf(buf, "#r%s#7 has been decapitated by #r%s#7, from the #r%s#7 clan! Avenge your fellow clanmember's death!", victim->name, ch->name, nclans_table[ch->clannum].name);
       do_claninfo(victim, buf);
       nclans_table[victim->clannum].retalclan = str_dup( nclans_table[ch->clannum].name );
     }
   }

   if( ch->clannum != victim->clannum )
     { nclans_table[ch->clannum].pks++; save_clans(); }
   if( victim->clannum != ch->clannum )
     { nclans_table[victim->clannum].pds++; save_clans(); }

   if (victim->pcdata->bounty > 0)
   {
      ch->pcdata->quest += victim->pcdata->bounty;
      sprintf (buf, "%s has taken the %dQp bounty of %s's head", ch->name,
	       victim->pcdata->bounty, victim->name);
      do_info (ch, buf);
      victim->pcdata->bounty = 0;
      send_to_char ("You receive your reward.\n\r", ch);
   }

   if ((((ch->race - victim->race) > WizConfig->paradoxlimit) && victim->race < 50
	&& (ch->race > 0)) || ((victim->race < 1) && (ch->race > 0)))
   {
      for (obj = victim->carrying; obj != NULL; obj = obj_next)
      {
         obj_next = obj->next_content;
         if (IS_SET (obj->quest, QUEST_ARTIFACT))
            ARTI = TRUE;
      }
      if (!nosafe && !ARTI)
      {
	 ch->paradox[0] += ch->race;
	 ch->paradox[1] += ch->race;
	 ch->paradox[2] += PARADOX_TICK;

	 sprintf (paradoxlog, "%s now has %d paradox.", ch->name,
		  ch->paradox[1]);
	 wiznet (ch, WIZ_DEATHS, 7, paradoxlog);
      }
      {
	 char *temp = 0;

	 do_fatality (ch, mdecapmsg (temp, ch, victim));
      }

      sprintf (buf, "%s received no status.", ch->name);
      do_fatality (ch, buf);
if (ch->hit == ch->max_hit)
     do_fatality(ch, "FLAWLESS VICTORY!!");
      sprintf (log_buf, "%s decapitated by %s at %d for no status.",
	       victim->name, ch->name, ch->in_room->vnum);
      log_string (log_buf, ch);
      wiznet (ch, WIZ_DEATHS, 7, log_buf);
      WizConfig->totaldecaps++;
      save_wizconfig ();
/*

if (!nosafe)
{
      if (number_range(1,3) == 3)
      {
        sprintf( buf, "%s is flicked for %d hps!", ch->name, 
			ch->race * (ch->race - victim->race) * 50 + buf2);
        do_info(ch, buf);
        ch->max_hit -= ch->race * (ch->race - victim->race) * 50 + buf2;
        if (ch->max_hit < 1)
        {
            ch->max_hit = 500;
        }
      }
}
*/

   if (IS_CLASS (ch, CLASS_HIGHLANDER) && victim->class == CLASS_HIGHLANDER)
   {
      int quick_gain = 0;

      ch->quickening[1] += 2;

      quick_gain = victim->quickening[1];

      if (quick_gain > 3)
	 quick_gain = 3;

      ch->quickening[1] += quick_gain;
      victim->quickening[1] -= quick_gain;

      victim->quickening[0] = 0;
      sprintf (buf, "In the end there can be ONLY one!");
      do_info (ch, buf);
      stc ("You drain some of their quickening\n\r", ch);
      stc ("They drain some of your quickening.\n\r", victim);
      if (!nosafe && !ARTI &&
        ((((ch->race - victim->race) > WizConfig->paradoxlimit) && victim->race < 50 &&
        (ch->race > 0)) || ((victim->race < 1) && (ch->race > 0))) &&
        ch->lstatus > victim->lstatus)
      {
         ch->paradox[0] += ch->lstatus - victim->lstatus;
         ch->paradox[1] += ch->lstatus - victim->lstatus;
	 ch->paradox[2] += PARADOX_TICK;

	 sprintf (paradoxlog, "%s now has %d paradox.", ch->name,
		  ch->paradox[1]);
	 wiznet (ch, WIZ_DEATHS, 7, paradoxlog);
      }
   }

   if (victim->disquiet_counter > 0) victim->disquiet_counter = 0;
   if (IS_SET(victim->newbits, NEW_CALM)) REMOVE_BIT (victim->newbits, NEW_CALM); 
      if (IS_CLASS (victim, CLASS_VAMPIRE))
      {
	 if (IS_EXTRA (victim, EXTRA_DRAGON))
	 {	
		REMOVE_BIT(victim->extra,EXTRA_DRAGON);
                free_string(victim->morph);
		victim->morph = str_dup("");
         }
	 if (IS_POLYAFF (victim, POLY_ZULO))
         {
		REMOVE_BIT(victim->polyaff, POLY_ZULO);
                free_string(victim->morph);
		victim->morph = str_dup("");
         }
  if (IS_SET (victim->affected_by, AFF_POLYMORPH))
            REMOVE_BIT (victim->affected_by, AFF_POLYMORPH);

	 if (IS_SET (victim->flag2, VAMP_OBJMASK))
	 {
	    stc ("You return to your normal form.\n\r", victim);
	    sprintf (buf, "%s transforms back into %s.\n\r", victim->morph,
		     victim->name);
	    act (buf, victim, NULL, NULL, TO_ROOM);
	    free_string (victim->morph);
	    victim->morph = str_dup ("");
	    free_string (victim->objdesc);
	    victim->objdesc = str_dup ("");
	    free_string (victim->long_descr);
	    victim->long_descr = str_dup ("");
	    free_string (victim->short_descr);
	    victim->short_descr = str_dup (victim->name);
	    REMOVE_BIT (victim->flag2, VAMP_OBJMASK);
	 }
//Mattpoint
      }
      if (IS_CLASS (victim, CLASS_VAMPIRE))
	 do_mortalvamp (victim, "");
      else if (IS_SET (victim->special, SPC_WOLFMAN))
	 do_unwerewolf (victim, "");
      if (IS_CLASS (victim, CLASS_MAGE)
	  && IS_AFFECTED (victim, AFF_POLYMORPH))
	 do_unpolymorph (victim, "");
      ch->fight_timer += 10;
      behead (victim);
      do_beastlike (ch, "");
      ch->pkill = ch->pkill + 1;
      victim->pdeath = victim->pdeath + 1;
      victim->level = 2;
      if (IS_SET (victim->newbits, WANTED))
	 REMOVE_BIT (victim->newbits, WANTED);
      return;
   }

   if (IS_CLASS (ch, CLASS_HIGHLANDER) && victim->class == CLASS_HIGHLANDER)
   {
      int quick_gain = 0;

      ch->quickening[1] += 2;

      quick_gain = victim->quickening[1];

      if (quick_gain > 3)
	 quick_gain = 3;

      ch->quickening[1] += quick_gain;
      victim->quickening[1] -= quick_gain;

      victim->quickening[0] = 0;
      sprintf (buf, "In the end there can be ONLY one!");
      do_info (ch, buf);
      stc ("You drain some of their quickening\n\r", ch);
      stc ("They drain some of your quickening.\n\r", victim);
      if (!nosafe && !ARTI &&
        ((((ch->race - victim->race) > WizConfig->paradoxlimit) && victim->race < 50 &&
        (ch->race > 0)) || ((victim->race < 1) && (ch->race > 0))) &&
        ch->lstatus > victim->lstatus)
      {
         ch->paradox[0] += ch->lstatus - victim->lstatus;
         ch->paradox[1] += ch->lstatus - victim->lstatus;
	 ch->paradox[2] += PARADOX_TICK;

	 sprintf (paradoxlog, "%s now has %d paradox.", ch->name,
		  ch->paradox[1]);
	 wiznet (ch, WIZ_DEATHS, 7, paradoxlog);
      }
   }

   ch->exp = ch->exp + 1000;
   if (ch->race < 100)
      ch->race = ch->race + 1;
   if (victim->race > 0)
      victim->race = victim->race - 1;

   if (IS_CLASS (ch, CLASS_HIGHLANDER)
       && !IS_CLASS (victim, CLASS_HIGHLANDER))
   {
      ch->quickening[1] += 3;
      stc ("You gain 3 quickening\n\r", ch);
      if (!nosafe && !ARTI &&
        ((((ch->race - victim->race) > WizConfig->paradoxlimit) && victim->race < 50 &&
        (ch->race > 0)) || ((victim->race < 1) && (ch->race > 0))) &&
        ch->lstatus > victim->lstatus)
      {
         ch->paradox[0] += ch->lstatus - victim->lstatus;
         ch->paradox[1] += ch->lstatus - victim->lstatus;
	 ch->paradox[2] += PARADOX_TICK;

	 sprintf (paradoxlog, "%s now has %d paradox.", ch->name,
		  ch->paradox[1]);
	 wiznet (ch, WIZ_DEATHS, 7, paradoxlog);
      }
   }

   act ("A misty white vapour pours from $N's corpse into your body.", ch,
	NULL, victim, TO_CHAR);
   act ("A misty white vapour pours from $N's corpse into $n's body.", ch,
	NULL, victim, TO_NOTVICT);
   act ("You double over in agony as raw energy pulses through your veins.",
	ch, NULL, NULL, TO_CHAR);
   act ("$n doubles over in agony as sparks of energy crackle around $m.", ch,
	NULL, NULL, TO_NOTVICT);
   if (IS_CLASS (victim, CLASS_VAMPIRE))
      do_mortalvamp (victim, "");
   else if (IS_SET (victim->special, SPC_WOLFMAN))
      do_unwerewolf (victim, "");
   if (IS_CLASS (victim, CLASS_MAGE) && IS_AFFECTED (victim, AFF_POLYMORPH))
      do_unpolymorph (victim, "");
   ch->fight_timer += 10;
   behead (victim);
   do_beastlike (ch, "");

   ch->pkill = ch->pkill + 1;
   victim->pdeath = victim->pdeath + 1;
   victim->pcdata->stats[UNI_RAGE] = 0;
   victim->level = 2;

   long long recexp = 0;
   recexp = victim->exp/2;
   
   if (!nosafe)
   {
      stcprintf (ch, "#w[You receive #r%lld #wexperience points]#n\n\r",
                recexp);          
      ch->exp += recexp;         
      victim->exp -= recexp;         
      stcprintf (victim, "#w[You lose #r%lld #wexperience points]#n\n\r",
                 recexp);         
   }

   {
      char *temp = 0;

      do_fatality (ch, mdecapmsg (temp, ch, victim));
   }
if (ch->hit == ch->max_hit)
     do_fatality(ch, "FLAWLESS VICTORY!!");
   if (IS_SET (ch->act, PLR_AUTOSAC))
      do_sacrifice (ch, "head");

   free_string (ch->pcdata->decapped);
   ch->pcdata->decapped = str_dup (victim->name);

   free_string (victim->pcdata->decappedby);
   victim->pcdata->decappedby = str_dup (ch->name);

   sprintf (log_buf, "%s decapitated by %s at %d.", victim->name, ch->name,
	    ch->in_room->vnum);
   log_string (log_buf, ch);
   wiznet (ch, WIZ_DEATHS, 7, log_buf);
   victim->pcdata->pkill_timer = 30;

   WizConfig->totaldecaps++;
  save_wizconfig ();
   if (IS_CLASS (victim, CLASS_VAMPIRE))
   {
 if (IS_EXTRA (victim, EXTRA_DRAGON))
         {                             
                REMOVE_BIT(victim->extra,EXTRA_DRAGON);
                free_string(victim->morph);
                victim->morph = str_dup("");
         }  
         if (IS_POLYAFF (victim, POLY_ZULO))  
         {      
                REMOVE_BIT(victim->polyaff, POLY_ZULO); 
                free_string(victim->morph);  
                victim->morph = str_dup("");
         }
        if (IS_SET (victim->flag2, VAMP_OBJMASK))
         {
            stc ("You return to your normal form.\n\r", victim);
            sprintf (buf, "%s transforms back into %s.\n\r", victim->morph,
                     victim->name);
            act (buf, victim, NULL, NULL, TO_ROOM);
            free_string (victim->morph);
            victim->morph = str_dup ("");
            free_string (victim->objdesc);
            victim->objdesc = str_dup ("");
            free_string (victim->long_descr);
            victim->long_descr = str_dup ("");
            free_string (victim->short_descr);
            victim->short_descr = str_dup (victim->name);
            REMOVE_BIT (victim->flag2, VAMP_OBJMASK);
         }  

   }
   if (ch->pkill + ch->pdeath != 0)
   {
      adjust_hiscore ("pkill", ch, ch->pkill);
   }
   if (victim->pkill + victim->pdeath != 0)
   {
      adjust_hiscore ("pkill", victim, victim->pkill);
      adjust_hiscore ("pdeath", victim, victim->pdeath);
   }

   return;
}

void do_tear (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj; 
   OBJ_DATA *obj_next;
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   char buf[MAX_STRING_LENGTH];
   char paradoxlog[MSL];
   char wanted[MSL];

   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_WEREWOLF) && !IS_CLASS (ch, CLASS_MONK)
       && !IS_CLASS (ch, CLASS_DRAGON) && !IS_SET(ch->more, MORE_LIONSMANE)
       && !IS_VAMPAFF (ch, VAM_CLAWS))
   {
      send_to_char ("Huh?\n\r", ch);
      return;
   }
/*
   if (IS_SET (ch->in_room->room_flags, ROOM_NODECAP) && !nosafe )
   {
      send_to_char
	 ("The intense magic of the room, stops you from decapitating.\n\r",
	  ch);
      return;
   }
*/
   if (IS_SET (ch->extra2, AURA_NO_MAGIC))
      do_auranomagic (ch, "");

   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_VAMPIRE))
      do_majesty (ch, "");
   if (IS_AFFECTED (ch, AFF_STEELSHIELD) && IS_CLASS (ch, CLASS_FAE))
      do_grandeur (ch, "");

   if (!IS_SET (ch->special, SPC_WOLFMAN) && IS_CLASS (ch, CLASS_WEREWOLF))
   {
      send_to_char ("You can only tear heads off while in Crinos form.\n\r",
		    ch);
      return;
   }

   if (!IS_VAMPAFF (ch, VAM_CLAWS) && IS_CLASS (ch, CLASS_WEREWOLF))
   {
      send_to_char ("You better get your claws out first.\n\r", ch);
      return;
   }

   if (arg[0] == '\0')
   {
      send_to_char ("Who's head do you wish to tear off?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("They aren't here.\n\r", ch);
      return;
   }
   if (IS_NPC (victim))
   {
      send_to_char ("You can only tear the heads off other players.\n\r", ch);
      return;
   }

   if (ch == victim)
   {
      send_to_char ("That might be a bit tricky...\n\r", ch);
      return;
   }

   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      stc ("Leave people in the war alone!\n\r", ch);
      return;
   }
   if (IS_SET (ch->war, WARRING))
   {
      stc ("Not while in a war!\n\r", ch);
      return;
   }

   if (IS_NEWBIE (victim))
   {
      stc ("You are unable to Decapitate Newbies.\n\r", ch);
      return;
   }

   if (IS_CREATOR (victim))
   {
      stc ("You failed!\n\r", ch);
      return;
   }
   if (IS_SET (victim->in_room->room_flags, ROOM_NODECAP) && !nosafe && victim->fight_timer == 0)
   {
      send_to_char
	 ("The intense magic of the room, stops you from decapitating.\n\r",
	  ch);
      return;
   }
  if (ch->pcdata->pkill_timer > 0)
   {
      stc ("You are unable to decapitate with a safe timer\n\r", 
           ch);
      return;
   }
   if (victim->pcdata->pkill_timer > 0)
   {
      stc ("You are unable to decap people with safe timers.\n\r", ch);
      return;
   }

 /*
      
    buf2 = ch->race * (ch->race - victim->race) * 50;
 
    if (((ch->race - victim->race) > WizConfig->paradoxlimit && victim->race < 50) && ch->max_hit < ch->race * (ch->race - victim->race) * 50 + 
buf2)
    {
        send_to_char("You don't have enough hitpoints to do this. You might get flicked for this. \n\r"
                     " You need the amount of hps you'll be flicked for.\n\r",ch);
        return;
    }
*/
   if (!CAN_PK (ch))
   {
      send_to_char ("You must be an avatar to tear someone's head off.\n\r",
		    ch);
      return;
   }

   if (!CAN_PK (victim))
   {
      send_to_char ("You can only tear the head off another avatar.\n\r", ch);
      return;
   }

   if (victim->position > 1)
   {
      send_to_char ("You can only do this to mortally wounded players.\n\r",
		    ch);
      return;
   }
   if (is_safe (ch, victim))
      return;

   if (get_hours (ch) < 10 && ch->race == 0 && !IS_SET (ch->extra2, PKREADY))
   {
      send_to_char ("You cannot decapitate players yet.", ch);
      return;
   }
   if (get_hours (victim) < 10 && victim->race == 0
       && !IS_SET (victim->extra2, PKREADY))
   {
      send_to_char ("You may not 'cap a newbie!\n\r", ch);
      sprintf (buf, "%s has felt the wrath of the gods for newbie killing!",
	       ch->name);
      do_restore (victim, victim->name);
      do_paradox (ch, "self");
      SET_BIT (ch->newbits, WANTED);
      do_info (ch, buf);
      return;
   }
   if (victim->in_room->vnum >= 3000 && victim->in_room->vnum <= 3373
       && !IS_SET (victim->newbits, WANTED) && !nosafe)
   {
      stc ("You decapitated in Midgarrd, you are now wanted.\n\r", ch);
      SET_BIT (ch->newbits, WANTED);
      sprintf (wanted, "%s is now wanted!!", ch->name);
      do_info (ch, wanted);
   }

   act ("You tear $N's head from $S shoulders!", ch, NULL, victim, TO_CHAR);
   send_to_char ("Your head is torn from your shoulders!\n\r", victim);
   act ("$n tears $N's head from $S shoulders!", ch, NULL, victim,
	TO_NOTVICT);

   if (IS_CLASS (ch, CLASS_DEMON) || IS_SET (ch->special, SPC_CHAMPION))
   {
      if (ch->race == 0 && victim->race == 0)
      {
	 ch->pcdata->stats[DEMON_CURRENT] += 1000;
	 ch->pcdata->stats[DEMON_TOTAL] += 1000;
      }
      else
      {
	 ch->pcdata->stats[DEMON_CURRENT] += victim->race * 1000;
	 ch->pcdata->stats[DEMON_TOTAL] += victim->race * 1000;

      }
   }

   if ( victim->clannum > 0 && victim->clannum != ch->clannum )
   {
     if( ch->clannum == 0 )
     {
       sprintf(buf, "#r%s#7 has been decapitated by #r%s#7! Avenge your fellow clanmember's death!", victim->name, ch->name);
       do_claninfo(victim, buf);
       nclans_table[victim->clannum].retalclan = str_dup( ch->name );
     }
     else
     {
       sprintf(buf, "#r%s#7 has been decapitated by #r%s#7, from the #r%s#7 clan! Avenge your fellow clanmember's death!", victim->name, ch->name, nclans_table[ch->clannum].name);
       do_claninfo(victim, buf);
       nclans_table[victim->clannum].retalclan = str_dup( nclans_table[ch->clannum].name );
     }
   }

   if( ch->clannum != victim->clannum )
     { nclans_table[ch->clannum].pks++; save_clans(); }
   if( victim->clannum != ch->clannum )
     { nclans_table[victim->clannum].pds++; save_clans(); }

   if (victim->pcdata->bounty > 0)
   {
      ch->pcdata->quest += victim->pcdata->bounty;
      sprintf (buf, "%s has taken the %dQp bounty of %s's head", ch->name,
	       victim->pcdata->bounty, victim->name);
      do_info (ch, buf);
      victim->pcdata->bounty = 0;
      send_to_char ("You receive your reward.\n\r", ch);
   }

   if ((((ch->race - victim->race) > WizConfig->paradoxlimit && victim->race < 50)
	&& (ch->race > 0)) || ((victim->race < 1) && (ch->race > 0)))

// if ( (ch->race - victim->race >= WizConfig->paradoxlimit && victim->race < 50 && ch->race > 0) || (victim->race < 1 && ch->race > 0 ) )
   {
      bool ARTI = FALSE;
      for (obj = victim->carrying; obj != NULL; obj = obj_next)
      {
      obj_next = obj->next_content;
      if (IS_SET (obj->quest, QUEST_ARTIFACT))
         ARTI = TRUE;
      }

      if (!nosafe && !ARTI)
      {
	 ch->paradox[0] += ch->race;
	 ch->paradox[1] += ch->race;
	 ch->paradox[2] += PARADOX_TICK;
	 sprintf (paradoxlog, "%s has %d paradox.", ch->name, ch->paradox[1]);
	 wiznet (ch, WIZ_DEATHS, 7, paradoxlog);
      }

      {
	 char *temp = 0;

	 do_fatality (ch, mdecapmsg (temp, ch, victim));
      }
      sprintf (buf, "%s received no status.", ch->name);
      do_fatality (ch, buf);
if (ch->hit == ch->max_hit)
     do_fatality(ch, "FLAWLESS VICTORY!!");
      WizConfig->totaldecaps++;
      save_wizconfig ();


      sprintf (log_buf, "%s decapitated by %s at %d for no status.",
	       victim->name, ch->name, ch->in_room->vnum);
      log_string (log_buf, ch);
/*
if (!nosafe)
{     
      if (number_range(1,3) == 3)
      {
        sprintf( buf, "%s is flicked for %d hps!", ch->name,
                        ch->race * (ch->race - victim->race) * 50 + buf2);
        do_info(ch, buf);
        ch->max_hit -= ch->race * (ch->race - victim->race) * 50 + buf2;
        if (ch->max_hit < 1)
        {
            ch->max_hit = 500;
        }
      }
} 
*/  
      wiznet (ch, WIZ_DEATHS, 7, log_buf);
      if (IS_CLASS (victim, CLASS_VAMPIRE))
      {
 if (IS_EXTRA (victim, EXTRA_DRAGON))
         {                             
                REMOVE_BIT(victim->extra,EXTRA_DRAGON);
                free_string(victim->morph);
                victim->morph = str_dup("");
         }  
         if (IS_POLYAFF (victim, POLY_ZULO))  
         {      
                REMOVE_BIT(victim->polyaff, POLY_ZULO); 
                free_string(victim->morph);  
                victim->morph = str_dup("");
         }
        if (IS_SET (victim->flag2, VAMP_OBJMASK))
         {
            stc ("You return to your normal form.\n\r", victim);
            sprintf (buf, "%s transforms back into %s.\n\r", victim->morph,
                     victim->name);
            act (buf, victim, NULL, NULL, TO_ROOM);
            free_string (victim->morph);
            victim->morph = str_dup ("");
            free_string (victim->objdesc);
            victim->objdesc = str_dup ("");
            free_string (victim->long_descr);
            victim->long_descr = str_dup ("");
            free_string (victim->short_descr);
            victim->short_descr = str_dup (victim->name);
            REMOVE_BIT (victim->flag2, VAMP_OBJMASK);
         }  
	 if (IS_SET (victim->affected_by, AFF_POLYMORPH))
	    REMOVE_BIT (victim->affected_by, AFF_POLYMORPH);

//MattPoint2
      }

      if (IS_CLASS (victim, CLASS_VAMPIRE))
	 do_mortalvamp (victim, "");
      else if (IS_SET (victim->special, SPC_WOLFMAN))
	 do_unwerewolf (victim, "");
      if (IS_CLASS (victim, CLASS_MAGE)
	  && IS_AFFECTED (victim, AFF_POLYMORPH))
	 do_unpolymorph (victim, "");
      ch->fight_timer += 10;
      behead (victim);
      do_beastlike (ch, "");

      ch->pkill = ch->pkill + 1;
      victim->pdeath = victim->pdeath + 1;
      if (IS_SET (victim->newbits, WANTED))
      {
	 REMOVE_BIT (victim->newbits, WANTED);
      }
      return;
   }

   ch->exp = ch->exp + 1000;
   if (ch->race < 100)
      ch->race++;
   if (victim->race > 0)
      victim->race--;

   act ("A misty white vapour pours from $N's corpse into your body.", ch,
	NULL, victim, TO_CHAR);
   act ("A misty white vapour pours from $N's corpse into $n's body.", ch,
	NULL, victim, TO_NOTVICT);
   act ("You double over in agony as raw energy pulses through your veins.",
	ch, NULL, NULL, TO_CHAR);
   act ("$n doubles over in agony as sparks of energy crackle around $m.", ch,
	NULL, NULL, TO_NOTVICT);
   if (IS_CLASS (victim, CLASS_VAMPIRE))
      do_mortalvamp (victim, "");
   else if (IS_SET (victim->special, SPC_WOLFMAN))
      do_unwerewolf (victim, "");
   if (IS_CLASS (victim, CLASS_MAGE) && IS_AFFECTED (victim, AFF_POLYMORPH))
      do_unpolymorph (victim, "");
   ch->fight_timer += 10;
   behead (victim);
   do_beastlike (ch, "");
   ch->pkill = ch->pkill + 1;
   victim->pdeath = victim->pdeath + 1;
   victim->pcdata->stats[UNI_RAGE] = 0;
   victim->level = 2;

   long long recexp= 0;
   recexp = victim->exp/2;

   if (!nosafe)
   {
      stcprintf (ch, "#w[You receive #r%lld #wexperience points]#n\n\r",
		recexp);
      ch->exp += recexp;
      victim->exp -= recexp;
      stcprintf (victim, "#w[You lose #r%lld experience points]#n\n\r",
		 recexp);
   }

   {
      char *temp = 0;

      do_fatality (ch, mdecapmsg (temp, ch, victim));
   }
if (ch->hit == ch->max_hit)
     do_fatality(ch, "FLAWLESS VICTORY!!");

   if (IS_SET (ch->act, PLR_AUTOSAC))
      do_sacrifice (ch, "head");
   free_string (ch->pcdata->decapped);
   ch->pcdata->decapped = str_dup (victim->name);


   free_string (victim->pcdata->decappedby);
   victim->pcdata->decappedby = str_dup (ch->name);

   sprintf (log_buf, "%s decapitated by %s at %d.", victim->name, ch->name,
	    ch->in_room->vnum);
   log_string (log_buf, ch);
   wiznet (ch, WIZ_DEATHS, 7, log_buf);
   WizConfig->totaldecaps++;
  victim->pcdata->pkill_timer = 30;
   save_wizconfig ();

   if (IS_CLASS (victim, CLASS_VAMPIRE))
   {
 
         if (IS_EXTRA (victim, EXTRA_DRAGON))
         {
                REMOVE_BIT(victim->extra,EXTRA_DRAGON);
                free_string(victim->morph);
                victim->morph = str_dup("");
         }
         if (IS_POLYAFF (victim, POLY_ZULO))
         {
                REMOVE_BIT(victim->polyaff, POLY_ZULO);
                free_string(victim->morph);
                victim->morph = str_dup("");
         }
      if (IS_SET (victim->affected_by, AFF_POLYMORPH))
	 REMOVE_BIT (victim->affected_by, AFF_POLYMORPH);

   }
   if (ch->pkill + ch->pdeath != 0)
   {
      adjust_hiscore ("pkill", ch, ch->pkill);
      adjust_hiscore ("status", ch, ch->race);
   }
   if (victim->pkill + victim->pdeath != 0)
   {
      adjust_hiscore ("pkill", victim, victim->pkill);
      adjust_hiscore ("pdeath", victim, victim->pdeath);
      adjust_hiscore ("status", ch, ch->race);
   }

   return;
}

void do_crack (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj;
   OBJ_DATA *right;
   OBJ_DATA *left;

   right = get_eq_char (ch, WEAR_WIELD);
   left = get_eq_char (ch, WEAR_HOLD);
   if (right != NULL && right->pIndexData->vnum == 12)
      obj = right;
   else if (left != NULL && left->pIndexData->vnum == 12)
      obj = left;
   else
   {
      send_to_char ("You are not holding any heads.\n\r", ch);
      return;
   }
   act ("You hurl $p at the floor.", ch, obj, NULL, TO_CHAR);
   act ("$n hurls $p at the floor.", ch, obj, NULL, TO_ROOM);
   act ("$p cracks open, leaking brains out across the floor.", ch, obj, NULL,
	TO_CHAR);
   if (obj->chobj != NULL)
   {
      act ("$p cracks open, leaking brains out across the floor.", ch, obj,
	   obj->chobj, TO_NOTVICT);
      act ("$p crack open, leaking brains out across the floor.", ch, obj,
	   obj->chobj, TO_VICT);
   }
   else
   {
      act ("$p cracks open, leaking brains out across the floor.", ch, obj,
	   NULL, TO_ROOM);
   }
   crack_head (ch, obj, obj->name);
   obj_from_char (obj);
   extract_obj (obj);
}

void crack_head (CHAR_DATA * ch, OBJ_DATA * obj, char *argument)
{
   CHAR_DATA *victim;
   MOB_INDEX_DATA *pMobIndex;

   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   char buf[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg1);
   argument = one_argument (argument, arg2);
   if (str_cmp (arg2, "mob") && obj->chobj != NULL && !IS_NPC (obj->chobj)
       && IS_AFFECTED (obj->chobj, AFF_POLYMORPH))
   {
      victim = obj->chobj;
      make_part (victim, "cracked_head");
      make_part (victim, "brain");
      sprintf (buf, "the quivering brain of %s", victim->name);
      free_string (victim->morph);
      victim->morph = str_dup (buf);
      return;
   }
   else if (!str_cmp (arg2, "mob"))
   {
      if ((pMobIndex = get_mob_index (obj->value[1])) == NULL)
	 return;
      victim = create_mobile (pMobIndex);
      char_to_room (victim, ch->in_room);
      make_part (victim, "cracked_head");
      make_part (victim, "brain");
      extract_char (victim, TRUE, FALSE);
      return;
   }
   else
   {
      if ((pMobIndex = get_mob_index (30002)) == NULL)
	 return;
      victim = create_mobile (pMobIndex);

      sprintf (buf, capitalize (arg2));
      free_string (victim->short_descr);
      victim->short_descr = str_dup (buf);

      char_to_room (victim, ch->in_room);
      make_part (victim, "cracked_head");
      make_part (victim, "brain");
      extract_char (victim, TRUE, FALSE);
      return;
   }
   return;
}

void do_garotte (CHAR_DATA * ch, char *argument)
{
   char buf[MAX_STRING_LENGTH];
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   OBJ_DATA *obj;
   int chance;

   one_argument (argument, arg);
   chance = number_percent ();

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DROW)
       || !IS_SET (ch->pcdata->powers[1], DPOWER_GAROTTE))
   {
      send_to_char ("Huh?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("Garotte whom?\n\r", ch);
      return;
   }

   if (victim == ch)
   {
      send_to_char ("That would be a bad idea.\n\r", ch);
      return;
   }

   if (is_safe (ch, victim))
      return;

   if (((obj = get_eq_char (ch, WEAR_WIELD)) == NULL || obj->value[3] != 4)
       && ((obj = get_eq_char (ch, WEAR_HOLD)) == NULL || obj->value[3] != 4)
       && ((obj = get_eq_char (ch, WEAR_DUAL)) == NULL || obj->value[3] != 4))
   {
      send_to_char ("You need to wield a whip.\n\r", ch);
      return;
   }

   if (victim->fighting != NULL)
   {
      send_to_char ("You can't garotte a fighting person.\n\r", ch);
      return;
   }

   if ((victim->hit < victim->max_hit)
       && !IS_SET (ch->pcdata->powers[1], DPOWER_SHADOWBODY))
   {
      act ("$N is too hurt for you to sneak up.", ch, NULL, victim, TO_CHAR);
      return;
   }

   check_killer (ch, victim);
   WAIT_STATE (ch, skill_table[gsn_garotte].beats);

   if (chance <= 5)
   {
      if (!is_inarena (ch) || !IS_SET (victim->war, WARRING))
	 ch->fight_timer += 5;
      damage (ch, victim, 0, gsn_garotte);
      return;
   }

   if (chance == 13 || chance == 31)
   {				/* bad luck :) */
      act ("$n wraps a whip around $N's neck! $N is choking to death!", ch,
	   NULL, victim, TO_NOTVICT);
      act ("You wrap your whip around $N's neck and refuse to let go!", ch,
	   NULL, victim, TO_CHAR);
      act ("$n wraps his whip around your neck, and you can't break free!",
	   ch, NULL, victim, TO_VICT);

      if (!IS_NPC (victim))
      {
	 if (!is_inarena (ch) && !IS_SET (ch->war, WARRING))
	    ch->fight_timer += 5;
	 if (!is_inarena (victim) && !IS_SET (victim->war, WARRING))
	 {
	    if (victim->in_room->vnum != ROOM_VNUM_ALTAR)
	    {
	       victim->hit = 1;
	       victim->fight_timer = 0;
	       update_pos (victim);
	       char_from_room (victim);
	       char_to_room (victim, get_room_index (ROOM_VNUM_ALTAR));
	       sprintf (buf, "%s has been assassinated by %s!", victim->name,
			ch->name);
	       do_info (ch, buf);
	    }
	 }
      }
      else
      {
	 victim->hit = 1;
	 damage (ch, victim, 1000, gsn_garotte);
      }

      return;
   }
   else
   {
      multi_hit (ch, victim, gsn_garotte);
      return;
   }
   return;
}

void do_dark_garotte (CHAR_DATA * ch, char *argument)
{
   char buf[MAX_STRING_LENGTH];
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   OBJ_DATA *obj;
   int chance,chancez;
   int i;

   one_argument (argument, arg);
   chance = number_percent ();

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DROW)
       || !IS_SET (ch->pcdata->powers[1], DPOWER_GAROTTE)
       || !IS_SET (ch->pcdata->powers[1], DPOWER_DGAROTTE))
   {
      send_to_char ("Huh?\n\r", ch);
      return;
   }

/*
        if (weather_info.sunlight == SUN_LIGHT || weather_info.sunlight == SUN_RISE)
        {
            send_to_char("It must be night for you to use this power.\n\r", ch);
            return;
        }
*/
   if (!IS_SET (ch->newbits, NEW_DARKNESS))
   {
      send_to_char ("You have to be surrounded in darkness.\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, arg)) == NULL)
   {
      send_to_char ("Dark Garotte whom?\n\r", ch);
      return;
   }

   if (victim == ch)
   {
      send_to_char ("That would be a bad idea.\n\r", ch);
      return;
   }

   if (!IS_NPC (victim))
   {
      if ((IS_SET (ch->war, WARRING) || (IS_SET (victim->war, WARRING))))
      {
	 stc ("You can't do this in a war.\n\r", ch);
	 return;
      }

      if (is_inarena (ch) || is_inarena (victim))
      {
	 stc ("You can't do this in a war.\n\r", ch);
	 return;
      }
   }

   if (is_safe (ch, victim))
      return;

   if (((obj = get_eq_char (ch, WEAR_WIELD)) == NULL || obj->value[3] != 4)
       && ((obj = get_eq_char (ch, WEAR_HOLD)) == NULL || obj->value[3] != 4)
       && ((obj = get_eq_char (ch, WEAR_DUAL)) == NULL || obj->value[3] != 4))
   {
      send_to_char ("You need to wield a whip.\n\r", ch);
      return;
   }

   if (victim->fighting != NULL)
   {
      send_to_char ("You can't garotte a fighting person.\n\r", ch);
      return;
   }

   if ((victim->hit < victim->max_hit)
       && !IS_SET (ch->pcdata->powers[1], DPOWER_SHADOWBODY))
   {
      act ("$N is too hurt for you to sneak up.", ch, NULL, victim, TO_CHAR);
      return;
   }

   check_killer (ch, victim);
   WAIT_STATE (ch, skill_table[gsn_garotte].beats);
   REMOVE_BIT (ch->newbits, NEW_DARKNESS);
   REMOVE_BIT (ch->in_room->room_flags, ROOM_TOTAL_DARKNESS);

   if (IS_SET (victim->special, SPC_DROW_ASN)) chancez = 80;
   else chancez = 95;

   if (chance > chancez)
   {				/* bad luck :) */
      act ("$n wraps a whip around $N's neck! $N is choking to death!", ch,
	   NULL, victim, TO_NOTVICT);
      act ("You wrap your whip around $N's neck and refuse to let go!", ch,
	   NULL, victim, TO_CHAR);
      act ("$n wraps his whip around your neck, and you can't break free!",
	   ch, NULL, victim, TO_VICT);

      if (!IS_NPC (victim))
      {
	 ch->fight_timer += 5;
	 if (!is_inarena (victim) && !IS_SET (victim->war, WARRING))
	 {
	    if (victim->in_room->vnum != ROOM_VNUM_ALTAR)
	    {
	       victim->hit = 1;
	       victim->fight_timer = 0;
               victim->pdeath += 1;
               ch->pkill += 1;
	       update_pos (victim);
	       char_from_room (victim);
	       char_to_room (victim, get_room_index (ROOM_VNUM_ALTAR));
	       sprintf (buf, "%s has been assassinated by %s!", victim->name,
			ch->name);
	       do_info (ch, buf);
	    }
	 }
      }
      else
      {
	 victim->hit = 1;
	 damage (ch, victim, 1000, gsn_garotte);
      }

      return;
   }
   else if (chance <= 5)
   {
      ch->fight_timer += 5;
      damage (ch, victim, 0, gsn_garotte);
      return;
   }
   else
   {
      for (i = 1; i < 3; i++)
	 multi_hit (ch, victim, gsn_garotte);
      return;
   }
   return;
}

bool has_timer (CHAR_DATA * ch)
{
   if (ch->fight_timer > 0 && !IS_NPC (ch) && !IS_IMMORTAL (ch))
   {
      stcprintf (ch,
		 "You still have '#r%d#n' ticks left on your fight timer before you can do that\n\r",
		 ch->fight_timer);
      return TRUE;
   }

   return FALSE;
}

/* Voodoo skill by KaVir */

void do_voodoo (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   OBJ_DATA *obj;
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   char buf[MAX_INPUT_LENGTH];
   char part1[MAX_INPUT_LENGTH];
   char part2[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg1);
   argument = one_argument (argument, arg2);

   if (arg1[0] == '\0')
   {
      send_to_char ("Who do you wish to use voodoo magic on?\n\r", ch);
      return;
   }

   if ((obj = get_eq_char (ch, WEAR_HOLD)) == NULL)
   {
      send_to_char ("You are not holding a voodoo doll.\n\r", ch);
      return;
   }

   if ((victim = get_char_world (ch, arg1)) == NULL)
   {
      send_to_char ("They are not here.\n\r", ch);
      return;
   }

   if (IS_NPC (victim))
   {
      send_to_char ("Not on NPC's.\n\r", ch);
      return;
   }

   sprintf (part2, obj->name);
   sprintf (part1, "%s voodoo doll", victim->name);

   if (str_cmp (part1, part2))
   {
      sprintf (buf, "But you are holding %s, not %s!\n\r", obj->short_descr,
	       victim->name);
      send_to_char (buf, ch);
      return;
   }

   if (arg2[0] == '\0')
   {
      send_to_char ("You can 'stab', 'burn' or 'throw' the doll.\n\r", ch);
   }
   else if (!str_cmp (arg2, "stab"))
   {
      WAIT_STATE (ch, 12);
      act ("You stab a pin through $p.", ch, obj, NULL, TO_CHAR);
      act ("$n stabs a pin through $p.", ch, obj, NULL, TO_ROOM);
      if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_VOODOO))
	 return;
      act ("You feel an agonising pain in your chest!", victim, NULL, NULL,
	   TO_CHAR);
      act ("$n clutches $s chest in agony!", victim, NULL, NULL, TO_ROOM);
   }
   else if (!str_cmp (arg2, "burn"))
   {
      WAIT_STATE (ch, 12);
      act ("You set fire to $p.", ch, obj, NULL, TO_CHAR);
      act ("$n sets fire to $p.", ch, obj, NULL, TO_ROOM);
      act ("$p burns to ashes.", ch, obj, NULL, TO_CHAR);
      act ("$p burns to ashes.", ch, obj, NULL, TO_ROOM);
      obj_from_char (obj);
      extract_obj (obj);
      if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_VOODOO))
	 return;
      if (IS_AFFECTED (victim, AFF_FLAMING))
	 return;
      if (WORN_ARTIFACT (victim, ARTI_DEMONS_HEART))
         return;
      SET_BIT (victim->affected_by, AFF_FLAMING);
      act ("You suddenly burst into flames!", victim, NULL, NULL, TO_CHAR);
      act ("$n suddenly bursts into flames!", victim, NULL, NULL, TO_ROOM);
   }
   else if (!str_cmp (arg2, "throw"))
   {
      WAIT_STATE (ch, 12);
      act ("You throw $p to the ground.", ch, obj, NULL, TO_CHAR);
      act ("$n throws $p to the ground.", ch, obj, NULL, TO_ROOM);
      obj_from_char (obj);
      obj_to_room (obj, ch->in_room);
      if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_VOODOO))
	 return;
      if (victim->position < POS_STANDING)
	 return;
      if (victim->position == POS_FIGHTING)
	 stop_fighting (victim, TRUE);
      act ("A strange force picks you up and hurls you to the ground!",
	   victim, NULL, NULL, TO_CHAR);
      act ("$n is hurled to the ground by a strange force.", victim, NULL,
	   NULL, TO_ROOM);
      victim->position = POS_RESTING;
      victim->hit = victim->hit - number_range (ch->level, (5 * ch->level));
      update_pos (victim);
      if (victim->position == POS_DEAD && !IS_NPC (victim))
      {
	 victim->form = 7;
	 do_killperson (ch, victim->name);

	 return;
      }
   }
   else
   {
      send_to_char ("You can 'stab', 'burn' or 'throw' the doll.\n\r", ch);
   }
   return;
}

void do_autostance (CHAR_DATA * ch, char *argument)
{

   char arg[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (arg[0] == '\0')
   {
      stc ("Syntax: autostance <stance>\n\r", ch);
      stc ("Stance being one of:\n\r", ch);
      stc (" none crab mongoose viper bull crane\n\r", ch);
      stc ("And if you have them:\n\r", ch);
      stc (" mantis tiger dragon swallow monkey\n\r", ch);
      return;
   }

   if (!str_cmp (arg, "none"))
   {
      send_to_char ("You no longer autostance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_NONE;
   }
   else if (!str_cmp (arg, "crane"))
   {
      send_to_char ("You now autostance into the crane stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_CRANE;
   }
   else if (!str_cmp (arg, "crab"))
   {
      send_to_char ("You now autostance into the crab stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_CRAB;
   }
   else if (!str_cmp (arg, "bull"))
   {
      send_to_char ("You now autostance into the bull stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_BULL;
   }
   else if (!str_cmp (arg, "viper"))
   {
      send_to_char ("You now autostance into the viper stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_VIPER;
   }
   else if (!str_cmp (arg, "mongoose"))
   {
      send_to_char ("You now autostance into the mongoose stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_MONGOOSE;
   }
   else if (!str_cmp (arg, "mantis") && ch->stance[STANCE_CRANE] >= 200
	    && ch->stance[STANCE_VIPER] >= 200)
   {
      send_to_char ("You now autostance into the mantis stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_MANTIS;
   }
   else if (!str_cmp (arg, "monkey") && ch->stance[STANCE_CRANE] >= 200
	    && ch->stance[STANCE_MONGOOSE] >= 200)
   {
      send_to_char ("You now autostance into the monkey stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_MONKEY;
   }
   else if (!str_cmp (arg, "swallow") && ch->stance[STANCE_CRAB] >= 200
	    && ch->stance[STANCE_MONGOOSE] >= 200)
   {
      send_to_char ("You now autostance into the swallow stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_SWALLOW;
   }
   else if (!str_cmp (arg, "tiger") && ch->stance[STANCE_BULL] >= 200
	    && ch->stance[STANCE_VIPER] >= 200)
   {
      send_to_char ("You now autostance into the tiger stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_TIGER;
   }
   else if (!str_cmp (arg, "dragon") && ch->stance[STANCE_CRAB] >= 200
	    && ch->stance[STANCE_BULL] >= 200)
   {
      send_to_char ("You now autostance into the dragon stance.\n\r", ch);
      ch->stance[MONK_AUTODROP] = STANCE_DRAGON;
   }
   else
      do_autostance (ch, "");
}

void autodrop (CHAR_DATA * ch)
{

   int st;
   char buf[MAX_INPUT_LENGTH];
   char buf2[MAX_INPUT_LENGTH];
   char stancename[10];

   if (IS_NPC (ch))
      return;

   st = ch->stance[11];
   if (st == STANCE_VIPER)
      sprintf (stancename, "viper");
   else if (st == STANCE_CRANE)
      sprintf (stancename, "crane");
   else if (st == STANCE_CRAB)
      sprintf (stancename, "crab");
   else if (st == STANCE_MONGOOSE)
      sprintf (stancename, "mongoose");
   else if (st == STANCE_BULL)
      sprintf (stancename, "bull");
   else if (st == STANCE_MANTIS)
      sprintf (stancename, "mantis");
   else if (st == STANCE_DRAGON)
      sprintf (stancename, "dragon");
   else if (st == STANCE_TIGER)
      sprintf (stancename, "tiger");
   else if (st == STANCE_MONKEY)
      sprintf (stancename, "monkey");
   else if (st == STANCE_SWALLOW)
      sprintf (stancename, "swallow");
   else
      return;

   if (ch->stance[0] < 1)
   {
      ch->stance[0] = st;

      sprintf (buf, "You autodrop into the %s stance.", stancename);
      act (buf, ch, NULL, NULL, TO_CHAR);
      sprintf (buf2, "$n autodrops into the %s stance.", stancename);
      act (buf2, ch, NULL, NULL, TO_ROOM);
   }
}

void death_message (CHAR_DATA * ch, CHAR_DATA * victim)
{
   char buf[MAX_STRING_LENGTH];
   char *chname;
   char *chsex;

   if (ch == NULL || victim == NULL || victim->form < 1)
      return;
   if (ch->in_room == NULL || victim->in_room == NULL)
      return;
   chname = !IS_NPC (ch) ? ch->name : ch->short_descr;
   chsex = ch->sex == SEX_FEMALE ? "her" : "his";
   switch (victim->form)
   {
   default:
      sprintf (buf, "%s has just died!", chname);
      break;
   case 1:
      sprintf (buf, "%s has just been dissolved by %s's acid blood!",
	       victim->name, chname);
      break;
   case 2:
      sprintf (buf, "%s just committed suicide by tearing %s own heart out!",
	       chname, chsex);
      break;
   case 3:
      sprintf (buf, "%s has just sucked out all of %s's blood!", chname,
	       victim->name);
      break;
   case 4:
      sprintf (buf, "%s has just boiled all of %s's blood!", chname,
	       victim->name);
      break;
   case 5:
      sprintf (buf, "%s has just turned %s's blood into water!", chname,
	       victim->name);
      break;
   case 6:
      sprintf (buf, "%s has just evaporated all of %s's blood!", chname,
	       victim->name);
      break;
   case 7:
      sprintf (buf, "%s has just smashed %s to death!", chname, victim->name);
      break;
   case 8:
      sprintf (buf, "%s has just blown apart %s's mind!", chname,
	       victim->name);
      break;
   case 9:
      sprintf (buf, "%s has just torn out %s's soul!", chname, victim->name);
      break;
   case 10:
      sprintf (buf, "%s has just sucked out %s's life essence!", chname,
	       victim->name);
      break;
   case 11:
      sprintf (buf, "%s has just blown apart %s's eardrums!", chname,
	       victim->name);
      break;
   case 12:
      sprintf (buf, "%s's entrails just poured from %s torn open stomach!",
	       chname, chsex);
      break;
   case 13:
      sprintf (buf, "%s just died from %s wounds!", chname, chsex);
      break;
   case 14:
      sprintf (buf, "%s just burned to death!", chname);
      break;
   case 16:
      sprintf (buf, "%s just died a long, slow, painful death!", chname);
      break;
   case 17:
      sprintf (buf, "%s has just torn apart %s's body!", chname,
	       victim->name);
      break;
   case 18:
      sprintf (buf, "%s has slain %s in cold blood!", chname, victim->name);
      break;
   case 19:
      sprintf (buf, "%s has just shot down %s!", chname, victim->name);
      break;
   case 20:
      sprintf (buf, "%s has struck %s a mortal wound!", chname, victim->name);
      break;
   case 21:
      sprintf (buf, "%s has torn off %s's face!", chname, victim->name);
      break;
   case 22:
      sprintf (buf, "%s has ripped out %s's windpipe!", chname, victim->name);
      break;
   case 23:
      sprintf (buf, "%s has ripped out %s's entrails!", chname, victim->name);
      break;
   case 24:
      sprintf (buf, "%s has broken %s's back!", chname, victim->name);
      break;
   case 25:
      sprintf (buf, "%s has broken %s's neck!", chname, victim->name);
      break;
   case 26:
      sprintf (buf, "%s has disembowelled %s!", chname, victim->name);
      break;
   case 27:
      sprintf (buf, "%s has thrust %s weapon through %s's head!", chname,
	       chsex, victim->name);
      break;
   case 28:
      sprintf (buf, "%s has sliced open %s's carotid artery!", chname,
	       victim->name);
      break;
   case 29:
      sprintf (buf, "%s has sliced open %s's throat!", chname, victim->name);
      break;
   case 30:
      sprintf (buf, "%s has split open %s's head!", chname, victim->name);
      break;
   case 31:
      sprintf (buf, "%s has thrust %s weapon through %s's chest!", chname,
	       chsex, victim->name);
      break;
   case 32:
      sprintf (buf, "%s has swung %s weapon between %s's legs!", chname,
	       chsex, victim->name);
      break;
   case 33:
      sprintf (buf, "%s has sliced off %s's arm!", chname, victim->name);
      break;
   case 34:
      sprintf (buf, "%s has sliced off %s's leg!", chname, victim->name);
      break;
   case 35:
      sprintf (buf, "%s has thrust %s weapon through %s's mouth!", chname,
	       chsex, victim->name);
      break;
   case 36:
      sprintf (buf, "%s has thrust %s weapon through %s's eye!", chname,
	       chsex, victim->name);
      break;
   case 37:
      sprintf (buf, "%s has smashed in %s's chest!", chname, victim->name);
      break;
   case 38:
      sprintf (buf, "%s has shattered %s's spine!", chname, victim->name);
      break;
   case 39:
      sprintf (buf, "%s has torn out %s's throat with %s teeth!", chname,
	       victim->name, chsex);
      break;
   case 40:
      sprintf (buf, "%s has torn out %s's throat with %s claws!", chname,
	       victim->name, chsex);
      break;
   case 41:
      sprintf (buf, "%s has clawed out %s's eyeball!", chname, victim->name);
      break;
   case 42:
      sprintf (buf, "%s has torn open %s's chest with %s claws!", chname,
	       victim->name, chsex);
      break;
   case 43:
      sprintf (buf, "%s has sucked out %s's brains!", chname, victim->name);
      break;
   case 44:
      sprintf (buf, "%s has just eaten %s whole!", chname, victim->name);
      break;
   }
   buf[0] = UPPER (buf[0]);
   do_fatality (ch, buf);

   if (ch->hit == ch->max_hit)
     do_fatality(ch, "FLAWLESS VICTORY!!");
   if (IS_EXTRA (victim, EXTRA_PREGNANT))
   {
      sprintf (buf, "%s's unborn child has been slain!", victim->name);
      buf[0] = UPPER (buf[0]);
      do_fatality (ch, buf);
   }
   return;
}

void death_message_obj (CHAR_DATA * ch, OBJ_DATA * obj)
{
   char buf[MAX_STRING_LENGTH];
   char *chname;
   char *chsex;

   if (ch == NULL || obj == NULL || ch->form < 1)
      return;
   if (ch->in_room == NULL)
      return;
   chname = !IS_NPC (ch) ? ch->name : ch->short_descr;
   chsex = ch->sex == SEX_FEMALE ? "her" : "his";
   switch (ch->form)
   {
   default:
      sprintf (buf, "%s has just died!", chname);
      break;
   case 1:
      sprintf (buf, "%s has just been dissolved by %s's acid blood!",
               chname, obj->short_descr);
      break;
   case 2:
      sprintf (buf, "%s just committed suicide by tearing %s own heart out!",
	       chname, chsex);
      break;
   case 3:
      sprintf (buf, "%s has just sucked out all of %s's blood!", capitalize(obj->short_descr),
               chname);
      break;
   case 4:
      sprintf (buf, "%s has just boiled all of %s's blood!", capitalize(obj->short_descr),
               chname);
      break;
   case 5:
      sprintf (buf, "%s has just turned %s's blood into water!", capitalize(obj->short_descr),
               chname);
      break;
   case 6:
      sprintf (buf, "%s has just evaporated all of %s's blood!", capitalize(obj->short_descr),
               chname);
      break;
   case 7:
      sprintf (buf, "%s has just smashed %s to death!", capitalize(obj->short_descr), chname);
      break;
   case 8:
      sprintf (buf, "%s has just blown apart %s's mind!", capitalize(obj->short_descr),
               chname);
      break;
   case 9:
      sprintf (buf, "%s has just torn out %s's soul!", capitalize(obj->short_descr), chname);
      break;
   case 10:
      sprintf (buf, "%s has just sucked out %s's life essence!", capitalize(obj->short_descr),
               chname);
      break;
   case 11:
      sprintf (buf, "%s has just blown apart %s's eardrums!", capitalize(obj->short_descr),
               chname);
      break;
   case 12:
      sprintf (buf, "%s's entrails just poured from %s torn open stomach!",
	       chname, chsex);
      break;
   case 13:
      sprintf (buf, "%s just died from %s wounds!", chname, chsex);
      break;
   case 14:
      sprintf (buf, "%s just burned to death!", chname);
      break;
   case 16:
      sprintf (buf, "%s just died a long, slow, painful death!", chname);
      break;
   case 17:
      sprintf (buf, "%s has just torn apart %s's body!", capitalize(obj->short_descr),
               chname);
      break;
   case 18:
      sprintf (buf, "%s has slain %s in cold blood!", capitalize(obj->short_descr), chname);
      break;
   case 19:
      sprintf (buf, "%s has just shot down %s!", capitalize(obj->short_descr), chname);
      break;
   case 20:
      sprintf (buf, "%s has struck %s a mortal wound!", capitalize(obj->short_descr), chname);
      break;
   case 21:
      sprintf (buf, "%s has torn off %s's face!", capitalize(obj->short_descr), chname);
      break;
   case 22:
      sprintf (buf, "%s has ripped out %s's windpipe!", capitalize(obj->short_descr), chname);
      break;
   case 23:
      sprintf (buf, "%s has ripped out %s's entrails!", capitalize(obj->short_descr), chname);
      break;
   case 24:
      sprintf (buf, "%s has broken %s's back!", capitalize(obj->short_descr), chname);
      break;
   case 25:
      sprintf (buf, "%s has broken %s's neck!", capitalize(obj->short_descr), chname);
      break;
   case 26:
      sprintf (buf, "%s has disembowelled %s!", capitalize(obj->short_descr), chname);
      break;
   case 27:
      sprintf (buf, "%s has thrust itself through %s's head!", capitalize(obj->short_descr),
               chname);
      break;
   case 28:
      sprintf (buf, "%s has sliced open %s's carotid artery!", capitalize(obj->short_descr),
               chname);
      break;
   case 29:
      sprintf (buf, "%s has sliced open %s's throat!", capitalize(obj->short_descr), chname);
      break;
   case 30:
      sprintf (buf, "%s has split open %s's head!", capitalize(obj->short_descr), chname);
      break;
   case 31:
      sprintf (buf, "%s has thrust itself through %s's chest!", capitalize(obj->short_descr),
               chname);
      break;
   case 32:
      sprintf (buf, "%s has swung itself between %s's legs!", capitalize(obj->short_descr),
               chname);
      break;
   case 33:
      sprintf (buf, "%s has sliced off %s's arm!", capitalize(obj->short_descr), chname);
      break;
   case 34:
      sprintf (buf, "%s has sliced off %s's leg!", capitalize(obj->short_descr), chname);
      break;
   case 35:
      sprintf (buf, "%s has thrust itself through %s's mouth!", capitalize(obj->short_descr),
               chname);
      break;
   case 36:
      sprintf (buf, "%s has thrust itself through %s's eye!", capitalize(obj->short_descr),
               chname);
      break;
   case 37:
      sprintf (buf, "%s has smashed in %s's chest!", capitalize(obj->short_descr), chname);
      break;
   case 38:
      sprintf (buf, "%s has shattered %s's spine!", capitalize(obj->short_descr), chname);
      break;
   case 39:
      sprintf (buf, "%s has torn out %s's throat with its teeth!", capitalize(obj->short_descr),
               chname);
      break;
   case 40:
      sprintf (buf, "%s has torn out %s's throat with its claws!", capitalize(obj->short_descr),
               chname);
      break;
   case 41:
      sprintf (buf, "%s has clawed out %s's eyeball!", capitalize(obj->short_descr), chname);
      break;
   case 42:
      sprintf (buf, "%s has torn open %s's chest with its claws!", capitalize(obj->short_descr),
               chname);
      break;
   case 43:
      sprintf (buf, "%s has sucked out %s's brains!", capitalize(obj->short_descr), chname);
      break;
   case 44:
      sprintf (buf, "%s has just eaten %s whole!", capitalize(obj->short_descr), chname);
      break;
   }
   buf[0] = UPPER (buf[0]);
   do_fatality (ch, buf);

   if (IS_EXTRA (ch, EXTRA_PREGNANT))
   {
      sprintf (buf, "%s's unborn child has been slain!", chname);
      buf[0] = UPPER (buf[0]);
      do_fatality (ch, buf);
   }
   return;
}

void demon_gain (CHAR_DATA * ch, CHAR_DATA * victim)
{
   int vnum;

   if (IS_NPC (victim) && !IS_NPC (ch))
   {
      if (IS_CLASS (ch, CLASS_DEMON) || IS_CLASS (ch, CLASS_DROW)
	  || IS_CLASS (ch, CLASS_DRAGON) )
      {
	 if ((vnum = victim->pIndexData->vnum) > 29000)
	 {
	    switch (vnum)
	    {
	    default:
	       if (IS_CLASS (ch, CLASS_DEMON))
	       {
		  ch->pcdata->stats[DEMON_CURRENT] += victim->level;
		  ch->pcdata->stats[DEMON_TOTAL] += victim->level;
	       }
	       else if (IS_CLASS (ch, CLASS_DRAGON))
		  ch->pcdata->stats[DEMON_CURRENT] += victim->level * 3;
	       else
		  ch->pcdata->stats[DROW_POWER] += victim->level * 4 / 3;
	       break;
	       /* List of mob vnums which don't give dp's */
	    case 29600:
	    case 30000:
	    case 30001:
	    case 30006:
	    case 30007:
	    case 30008:
	    case 30009:
	    case 30010:
	    case 30013:
	    case 30014:
	    case 30015:
	    case 30016:
	       break;
	    }
	 }
	 else if ((IS_NPC (victim)) && (!IS_SET (victim->act, ACT_NOEXP))
		  && (!IS_SET (ch->more, PLR_COMB_EXP)))
	 {
	    if (IS_CLASS (ch, CLASS_DEMON))
	    {
	       ch->pcdata->stats[DEMON_CURRENT] += victim->level;
	       ch->pcdata->stats[DEMON_TOTAL] += victim->level;
	    }
	    else if (IS_CLASS (ch, CLASS_DRAGON))
	       ch->pcdata->stats[DEMON_CURRENT] += victim->level * 3;
	    else
	       ch->pcdata->stats[DROW_POWER] += victim->level * 4 / 3;
	 }
      }
      if (ch->level == 1 && ch->mkill >= 4)
      {
	 ch->level = 2;
	 do_save (ch, "");
      }
   }
   return;
}

bool is_safe_silent (CHAR_DATA * ch, CHAR_DATA * victim)
{
   OBJ_DATA *obj;
   OBJ_DATA *obj_next;
/*
if (victim->fighting == ch) return FALSE;
if (ch->fighting == victim) return FALSE;
*/
   if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && !IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      return TRUE;
   }

   if (IS_NPC (victim) && IS_SET (ch->act, ACT_NO_KILL))
   {
      return TRUE;
   }
   if (IS_NPC (victim) && (victim->pIndexData->vnum == 3145))
   {
      return TRUE;
   }
   if (IS_SET (victim->more, MORE_JAIL))
   {
      return TRUE;
   }

   if (IS_SET (ch->tag_flags, TAG_PLAYING)
       || IS_SET (victim->tag_flags, TAG_PLAYING))
   {
      return TRUE;
   }
   if (IS_SET (victim->war, WARRING) && !IS_SET (ch->war, WARRING))
   {
      return TRUE;
   }
   if ((IS_SET (ch->flag2, AFF2_INARENA)
	&& !IS_SET (victim->flag2, AFF2_INARENA))
       || (IS_SET (victim->flag2, AFF2_INARENA)
	   && !IS_SET (ch->flag2, AFF2_INARENA)))
   {
      return TRUE;
   }
/* Will look into this later
if (!IS_NPC(victim) && ch->registerred != 1 && ch->email_set != 2)
   return TRUE;
if (!IS_NPC(ch) && victim->registerred != 1 && victim->email_set != 2)
   return TRUE;
*/
   if (!IS_NPC (victim) && IS_SET (ch->extra2, NHELPER)  && (victim != ch))
   {
      if (IS_SET (ch->flag2, AFF2_INARENA)
	  && (IS_SET (victim->flag2, AFF2_INARENA)))
      {
	 // do nothing
      }
      else if (IS_SET (victim->war, WARRING) && IS_SET (ch->war, WARRING))
      {
	 // do nothing
      }
      else
      {
	 return TRUE;
      }
   }
   if (!IS_NPC (ch) && IS_SET (victim->extra2, NHELPER) && (victim != ch))
   {
      if (IS_SET (ch->flag2, AFF2_INARENA)
	  && (IS_SET (victim->flag2, AFF2_INARENA)))
      {
	 // do nothing
      }
      else if (IS_SET (victim->war, WARRING) && IS_SET (ch->war, WARRING))
      {
	 // do nothing
      }
      else
      {
	 return TRUE;
      }
   }



   if (!IS_NPC (ch) && ch->level < 3 && !IS_NPC (victim) && (ch != victim))
   {
      return TRUE;
   }

   /* Make it so newbies cant be killed by players. */
   if (!IS_NPC (victim) && (get_hours (ch) < 10) && !IS_NPC (ch)
       && (ch != victim) && !IS_SET (ch->extra2, PKREADY))
   {
      return TRUE;
   }

   if (!IS_NPC (ch) && (get_hours (victim) < 10) && !IS_NPC (victim)
       && (ch != victim) && !IS_SET (victim->extra2, PKREADY))
   {
      return TRUE;
   }

   if (!IS_NPC (victim) && !IS_NPC (ch) && (victim->level < 3)
       && (ch != victim))
   {
      return TRUE;
   }
   if (!IS_NPC (victim) && nosafe)
   {
      return FALSE;
   }

   if (!IS_NPC (victim) && IS_SET (victim->newbits, NEW_NOTEWRITE))
   {
      return TRUE;
   }

   // People with artifacts aren't safe. - Krynn
   for (obj = victim->carrying; obj != NULL; obj = obj_next)
   {
      obj_next = obj->next_content;
      if (IS_SET (obj->quest, QUEST_ARTIFACT))
	 return FALSE;
   }
   /* Ethereal people can only attack other ethereal people */

   if (IS_AFFECTED (ch, AFF_ETHEREAL) && !IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_ETHEREAL) && IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      return TRUE;
   }

   /* You cannot attack across planes */
   if (IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && !IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      return TRUE;
   }
   if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
       && IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      return TRUE;
   }
/*
    if ( IS_SET(ch->in_room->room_flags,ROOM_SAFE) )
    {
	return TRUE;
    }
*/
   /* Deal with safe rooms (either you or they are in one) */
   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_STEELSHIELD))
   {
      return TRUE;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_STEELSHIELD))
   {
      return TRUE;
   }

   if (!ch || !victim)
      return TRUE;
   if (!ch->in_room || !victim->in_room)
      return TRUE;
   if (ch->in_room == NULL || victim->in_room == NULL
       || IS_SET (ch->in_room->room_flags, ROOM_SAFE)
       || IS_SET (victim->in_room->room_flags, ROOM_SAFE))
   {
      if (IS_NPC (victim))
      {
	 return TRUE;
      }

      else if ( /*!IS_NPC(victim) && */ victim->fight_timer <= 0
	       && !IS_ITEMAFF (victim, ITEMA_ARTIFACT))
      {
	 return TRUE;
      }

   }
   if (!IS_NPC (victim))
   {
      CHAR_DATA *rch;

      for (rch = ch->in_room->people; rch; rch = rch->next_in_room)
      {
	 if (IS_CLASS (rch, CLASS_FAE) && !IS_NPC (rch)
	     && IS_SET (rch->extra2, EXTRA2_NEUTRAL))
	 {
	    return TRUE;
	 }
      }
   }

   if (IS_HEAD (ch, LOST_HEAD) || IS_EXTRA (ch, EXTRA_OSWITCH))
   {
      return TRUE;
   }
   else if (IS_HEAD (victim, LOST_HEAD) || IS_EXTRA (victim, EXTRA_OSWITCH))
   {
      return TRUE;
   }

   if (IS_NPC (ch) || IS_NPC (victim))
      return FALSE;

   /* Thx Josh! */
   if (victim->fighting == ch)
      return FALSE;

   if (ch->fighting == victim)
      return FALSE;

   if (IS_ITEMAFF (ch, ITEMA_PEACE))
   {
      return TRUE;
   }

   if (IS_ITEMAFF (victim, ITEMA_PEACE))
   {
      return TRUE;
   }

   if (!IS_NPC (ch) && IS_EXTRA (ch, EXTRA_EARTHMELD))
      return TRUE;

   if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_EARTHMELD))
      return TRUE;

   if (!IS_NPC (ch) && IS_AFFECTED (ch, AFF_SAFE))
   {
      return TRUE;
   }

   if (!IS_NPC (victim) && IS_AFFECTED (victim, AFF_SAFE))
   {
      return TRUE;
   }


   if (ch->trust > LEVEL_BUILDER)
   {
      return TRUE;
   }

   if (victim->trust > LEVEL_BUILDER)
   {
      return TRUE;
   }

   if (!CAN_PK (ch) || !CAN_PK (victim))
   {
      return TRUE;
   }

   if (ch != victim && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF(ch, VAM_MORTAL))
       && IS_SET (ch->special, SPC_INCONNU)
       && (IS_CLASS (victim, CLASS_VAMPIRE)
	   || IS_VAMPAFF (victim, VAM_MORTAL)))
      return TRUE;
   else if (ch != victim && (IS_CLASS (victim, CLASS_VAMPIRE) || IS_VAMPAFF(victim, VAM_MORTAL))
       && IS_SET (victim->special, SPC_INCONNU)
       && (IS_CLASS (ch, CLASS_VAMPIRE) || IS_VAMPAFF (ch, VAM_MORTAL)))
      return TRUE;

   return FALSE;
}


/*
 * returns the amount of damage done in a single mock hit.
 * used in consider! -- Serenity
 */
int mock_one_hit (CHAR_DATA * ch, CHAR_DATA * victim, int dt, int handtype)
{
   int return_result = 0;
   OBJ_DATA *wield;
   OBJ_DATA *gloves;
   int victim_ac;
   int thac0;
   int thac0_00;
   int thac0_32;
   int dam;
   int diceroll;
   int level;
   bool right_hand;
   int max_dam = victim->damcap[DAM_CAP];

   if (victim->position == POS_DEAD || ch->in_room != victim->in_room)
      return 0;

   if (handtype == 8)
   {
      wield = get_eq_char (ch, WEAR_FOURTH);
      right_hand = FALSE;
   }
   else if (handtype == 4)
   {
      wield = get_eq_char (ch, WEAR_THIRD);
      right_hand = FALSE;
   }
   else if (handtype == 2)
   {
      wield = get_eq_char (ch, WEAR_HOLD);
      right_hand = FALSE;
   }
   else
   {
      if (!IS_NPC (ch) && (wield = get_eq_char (ch, WEAR_DUAL)) != NULL);
      else if (!IS_NPC (ch) && IS_SET (ch->extra2, PLR_RIGHTHAND))
	 wield = get_eq_char (ch, WEAR_WIELD);
      else if (!IS_NPC (ch) && IS_SET (ch->act, PLR_LEFTHAND))
	 wield = get_eq_char (ch, WEAR_HOLD);
      else
      {
	 if (number_range (1, 10) > 4 && !IS_NPC (ch))
	    wield = get_eq_char (ch, WEAR_HOLD);
	 else
	    wield = get_eq_char (ch, WEAR_WIELD);
      }
      right_hand = 1;		// improve the right hand anyway...
   }

   if (dt == TYPE_UNDEFINED)
   {
      dt = TYPE_HIT;
      if (wield != NULL && wield->item_type == ITEM_WEAPON)
	 dt += wield->value[3];
   }

   if (ch->wpn[dt - 1000] > 5)
      level = (ch->wpn[dt - 1000] / 5);
   else
      level = 1;
   if (level > 40)
      level = 40;

   /*
    * Calculate to-hit-armor-class-0 versus armor.
    */
   if (IS_NPC (ch))
   {
      thac0_00 = 20;
      thac0_32 = 0;
   }
   else
   {
      thac0_00 = SKILL_THAC0_00;
      thac0_32 = SKILL_THAC0_32;
   }
   thac0 = 0 - interpolate (level, thac0_00, thac0_32) - (char_hitroll (ch) / 30);
   victim_ac = UMIN (10, char_ac (victim) / 100);
   if (!can_see (ch, victim))
      victim_ac -= 100;

   if (IS_CLASS (ch, CLASS_DRAGON)
       && IS_SET (ch->pcdata->dragonaff, DRA_TERROR) && IS_NPC (victim))
   {
      victim_ac += 200;
   }

   while ((diceroll = number_bits (5)) >= 20)
      ;

   if (diceroll == 0 || (diceroll != 19 && diceroll < thac0 - victim_ac))
   {
      /* Miss. */
      return_result += 0;
      tail_chain ();
      return 0;
   }

   /*
    * Hit.
    * Calc damage.
    */

   if (IS_NPC (ch))
   {
      dam = number_range (ch->level, ch->level * 3 / 2);
      if (wield != NULL)
	 dam += dam * 0.5;
   }

   else
   {

      if (IS_VAMPAFF (ch, VAM_CLAWS) && wield == NULL)
	 dam = number_range (10, 20);
      else if (IS_CLASS (ch, CLASS_DRAGON))
	 dam = number_range (500, 750);
      else if (IS_CLASS (ch, CLASS_WEREWOLF))
	 dam = dice (10, 35);
      else if (IS_SET (ch->newbits, NEW_MONKADAM))
	 dam = dice (10, 25);
      else if (wield != NULL && wield->item_type == ITEM_WEAPON)
	 dam = number_range (wield->value[1], wield->value[2]);
      else
	 dam = number_range (1, 4);
   }

   /* Fun with weapons */

   dam += char_damroll (ch);
   dam = add_bonuses (ch, victim, dam, dt);

   /* Werewolf Silver Stuff.. */
   if (!IS_NPC (victim) && IS_CLASS (victim, CLASS_WEREWOLF))
   {
      if (number_percent () > victim->pcdata->powers[WPOWER_SILVER])
      {
	 if (is_garou (ch))
	 {
	    if (IS_GAR1 (ch, GAROU_AVENGER))
	       dam *= 3;
	    else if (ch->gifts[AHROUN] >= 4 || ch->gifts[SILVERFANGS] >= 2)
	       dam *= 2.2;
	    else if (wield != NULL && IS_SET (wield->spectype, SITEM_SILVER))
	       dam *= 2;
	    else if ((gloves = get_eq_char (ch, WEAR_HANDS)) != NULL
		     && IS_SET (gloves->spectype, SITEM_SILVER))
	       dam *= 2;
	 }
	 else if (!is_garou (ch))
	 {
	    if (wield != NULL && IS_SET (wield->spectype, SITEM_SILVER))
	       dam *= 2;
	    else if ((gloves = get_eq_char (ch, WEAR_HANDS)) != NULL
		     && IS_SET (gloves->spectype, SITEM_SILVER))
	       dam *= 2;
	 }
      }
   }

   if (dt == gsn_backstab)
   {
      if (IS_CLASS (ch, CLASS_DROW))
	 dam *= number_range (4, 5);
      else
	 dam *= number_range (2, 3);

      if (IS_CLASS (ch, CLASS_NINJA) && !IS_NPC (ch)
	  && ch->pcdata->powers[NPOWER_NINGENNO] >= 2)
	 dam *= number_range (4, 8);
      else
	 dam *= number_range (2, 4);
   }
   if (dt == gsn_garotte)
      dam *= (number_range (3, 5));

   if (dt == gsn_circle)
      dam *= number_range (2, 4);


   if (IS_CREATOR (ch))
      max_dam = 10000000;

   if (get_hours (ch) < 6 && !IS_NPC (ch) && !IS_SET (ch->extra2, PKREADY))
      dam *= 2;
   if (get_hours (victim) < 6 && !IS_NPC (victim)
       && !IS_SET (victim->extra2, PKREADY))
      dam /= 2;

   if (victim == NULL || victim->position == POS_DEAD)
      return 0;

   if (!IS_NPC (ch) && IS_CLASS (ch, CLASS_FAE)
       && IS_EXTRA2 (ch, EXTRA2_FAEMIGHT))
      dam *= 1.7;


   /*
    * Stop up any residual loopholes.
    */

   if (victim->damcap[DAM_CHANGE] == 1)
   {
      update_damcap (victim, ch);
      max_dam = victim->damcap[DAM_CAP];	// after we update the damcap, let's assign it eh? -- serenity
   }

   if (dam > max_dam)
      dam = max_dam;

   if (victim != ch)
   {
      if (is_safe_silent (ch, victim))
	 return 0;

      if (IS_AFFECTED (ch, AFF_HIDE))
      {
	 if (!can_see (victim, ch))
	 {
	    dam *= 1.5;
	 }
      }

      if (IS_CLASS (ch, CLASS_NINJA) && IS_SET (ch->act, PLR_WIZINVIS))
      {
	 if (!can_see (victim, ch))
	 {
	    dam *= 3;
	 }
      }
      else if (IS_CLASS (ch, CLASS_MONK) && IS_SET (ch->act, PLR_WIZINVIS))
      {
	 if (!can_see (victim, ch))
	 {
	    dam *= 1.2;
	 }
      }


      if ( (IS_AFFECTED (victim, AFF_SANCTUARY) && dam > 1 ) || ( WORN_ARTIFACT( victim, ARTI_CLOAK_OF_THE_ARCHMAGI ) && dam > 1 ) )
	 dam *= 0.5;
      if (victim->specxtype == 1)
         dam *= 0.3;
      if (IS_SET (victim->mflags, MAGE_BETTERBODY))
	 dam *= .85;
      if (IS_AFFECTED (victim, AFF_PROTECT) && IS_EVIL (ch) && dam > 1)
	 dam -= (dam * 0.25);
      if (IS_GAR1 (victim, WOLF_COCOON) && IS_CLASS (victim, CLASS_WEREWOLF))
	 dam -= dam * 0.25;
      if (IS_CLASS (victim, CLASS_NINJA)
	  && victim->pcdata->powers[NPOWER_CHIKYU] > 6)
	 dam -= dam * 0.45;

      if (IS_GAR1 (victim, WW_GRANITE) && IS_CLASS (victim, CLASS_FAE))
	 dam *= 0.40;
      if (dam < 0)
	 dam = 0;

      /*
       * Check for disarm, trip, parry, and dodge.
       */
      if (dt >= TYPE_HIT)
      {

         if (check_parry (ch, victim, dt))
	    return 0;
         if (!IS_NPC (victim) && IS_STANCE (victim, STANCE_CRANE)
	     && victim->stance[STANCE_CRANE] > 100 && !can_counter (ch)
	     && !can_bypass (ch, victim) && check_parry (ch, victim, dt))
	    return 0;
	 else if (!IS_NPC (victim) && IS_STANCE (victim, STANCE_MANTIS)
		  && victim->stance[STANCE_MANTIS] > 100 && !can_counter (ch)
		  && !can_bypass (ch, victim) && check_parry (ch, victim, dt))
	    return 0;
	 if (check_dodge (ch, victim, dt))
	    return 0;
         if (!IS_NPC (victim) && IS_STANCE (victim, STANCE_MONGOOSE)
	     && victim->stance[STANCE_MONGOOSE] > 100 && !can_counter (ch)
	     && !can_bypass (ch, victim) && check_dodge (ch, victim, dt))
	    return 0;
	 else if (!IS_NPC (victim) && IS_STANCE (victim, STANCE_SWALLOW)
		  && victim->stance[STANCE_SWALLOW] > 100 && !can_counter (ch)
		  && !can_bypass (ch, victim) && check_dodge (ch, victim, dt))
	    return 0;
      }

   }
   return_result += dam;
   tail_chain ();
   return (return_result);
}

// Kills a target remotely and drops the corpse in the right spot. -- Serenity
void raw_kill_remote (CHAR_DATA * victim, CHAR_DATA * ch)
{
   CHAR_DATA *mount;
   char buf[MSL];
   stop_fighting (victim, TRUE);

    if (IS_NPC(victim) && !IS_NPC(ch)) ch->mkill++;
    if (!IS_NPC(victim) && IS_NPC(ch)) victim->mdeath++;

   mmake_corpse_remote (victim, ch);

   if (victim == quest_target)
      quest_target = NULL;
   if (victim == quest_mob)
   {
      sprintf (buf,
	       "Oh well, I guess the quest is over, since I am about to DIE!!!!!");
      do_qtalk (victim, buf);
      quest_mob = NULL;
   }
   if ((mount = victim->mount) != NULL)
   {
      if (victim->mounted == IS_MOUNT)
      {
	 act ("$n rolls off the corpse of $N.", mount, NULL, victim, TO_ROOM);
	 act ("You roll off the corpse of $N.", mount, NULL, victim, TO_CHAR);
      }
      else if (victim->mounted == IS_RIDING)
      {
	 act ("$n falls off $N.", victim, NULL, mount, TO_ROOM);
	 act ("You fall off $N.", victim, NULL, mount, TO_CHAR);
      }
      mount->mount = NULL;
      victim->mount = NULL;
      mount->mounted = IS_ON_FOOT;
      victim->mounted = IS_ON_FOOT;
   }

   victim->pIndexData->killed++;
   kill_table[URANGE (0, victim->level, MAX_LEVEL - 1)].killed++;
   extract_char (victim, TRUE, FALSE);
   return;
}