demon.c

legend/src/demon.c · 111.3 KB

From the archive LoCRelease.tgz

Download the archive   « Back to the archive contents

/***************************************************************************
 *  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"
#include "player.h"

/*
 * Local functions.
 */
NCLANS_DATA *nclans_table;
bool    check_social    args( ( CHAR_DATA *ch, char *command,
                            char *argument ) );
void do_demondrain (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   int damage;

   if (IS_NPC (ch))
      return;

   argument = one_argument (argument, arg);


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

   if (!IS_NDEMPOWER (ch, DEM_DRAIN))
   {
      stc ("You havent been granted the gift of Demon drain\n\r", ch);
      return;
   }


   if (arg[0] == '\0' && ch->fighting == NULL)
   {
      send_to_char ("Who's lifeforce do you wish to Drain?\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 (is_safe (ch, victim))
      return;

   if (ch->hit >= ch->max_hit)
   {
      send_to_char ("But you are already at full lifeforce!\n\r", ch);
      return;
   }

   damage = number_range (100, 600) * 5;

   act ("A look of concentration crosses $n's face.", ch, NULL, NULL,
	TO_ROOM);

   if (ch->move < damage)
   {
      stc ("You dont have enough energy to drain their life.\n\r", ch);
      return;
   }


   send_to_char ("You drain some of their lifeforce.\n\r", ch);
   send_to_char ("You feel your lifeforce being drained away!\n\r", victim);


   ch->move -= damage;

   if (victim->hit <= damage)
      damage = victim->hit - 1;
   if (ch->hit + damage > ch->max_hit)
      damage -= (ch->max_hit - ch->hit);
   ch->hit += damage;
   victim->hit -= damage;


//    if (IS_NPC(victim)) do_kill(victim,ch->name);
   if (IS_NPC (victim) && victim->position == POS_STANDING)
      multi_hit (victim, ch, TYPE_UNDEFINED);
   WAIT_STATE (ch, 12);
   if (ch->position == POS_FIGHTING)
      WAIT_STATE (ch, 24);
   return;
}

void do_servant (CHAR_DATA * ch, char *argument)
{
   char buf[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   AFFECT_DATA af;
   int sn;

   if (IS_NPC (ch))
      return;


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

   if (IS_SET (ch->flag2, AFF2_CHALLENGED)
       || IS_SET (ch->flag2, AFF2_CHALLENGER))
   {
      send_to_char ("Not while in the arena!\n\r", ch);
      return;
   }

   if (!IS_NDEMPOWER (ch, DEM_SERVANT))
   {
      send_to_char ("You have not been granted the power of servant.\n\r",
		    ch);
      return;
   }

   if (ch->pcdata->followers > 4)
   {
      send_to_char ("Nothing happens.\n\r", ch);
      return;
   }

   ch->pcdata->followers++;
   victim = create_mobile (get_mob_index (MOB_VNUM_GUARDIAN));
   char_to_room (victim, get_room_index (ROOM_VNUM_DISCONNECTION));
   free_string (victim->lord);
   victim->lord = str_dup (ch->name);
   free_string (victim->name);
   victim->name = str_dup ("demon servant");
   free_string (victim->short_descr);
   victim->short_descr = str_dup ("a demonic servant");
   free_string (victim->long_descr);
   victim->long_descr =
      str_dup ("A demonic servant stands here, awaiting orders.\n\r");
   victim->sex = 1;
   victim->alignment = -1000;
   free_string (victim->description);
   victim->description = str_dup ("He looks extremely powerful.\n\r");

   victim->level = number_range (100, 250);
   victim->hit = victim->level * 250;
   victim->max_hit = victim->hit;
   victim->mana = 1000;
   victim->max_mana = 1000;
   victim->move = 1000;
   victim->max_move = 1000;
   victim->hitroll =
      char_hitroll (ch) <=
      0 ? 1 : (char_hitroll (ch) / 2) * (victim->level / 100);
   victim->damroll =
      char_damroll (ch) <=
      0 ? 1 : (char_damroll (ch) / 2) * (victim->level / 100);
   victim->armor = char_ac (ch) + 100;
   char_from_room (victim);
   char_to_room (victim, ch->in_room);

   strcpy (buf, "Come forth, creature of darkness, and do my bidding!");
   do_say (ch, buf);

   send_to_char ("A demon bursts from the ground and bows before you.\n\r",
		 ch);
   act ("$N bursts from the ground and bows before $n.", ch, NULL, victim,
	TO_ROOM);

   if ((sn = skill_lookup ("guardian")) < 0)
   {
      send_to_char ("Bug - please inform an IMP.\n\r", ch);
      return;
   }

   add_follower (victim, ch);
   af.type = sn;
   af.duration = 6666;
   af.location = APPLY_NONE;
   af.modifier = 0;
   af.bitvector = AFF_CHARM;
   affect_to_char (victim, &af);
   return;
}

ROOM_INDEX_DATA *locate_obj (OBJ_DATA * obj)
{
   if (obj->in_obj != NULL)
      return locate_obj (obj->in_obj);

   if (obj->carried_by != NULL)
      return obj->carried_by->in_room;

   return obj->in_room;
}
void do_demonseed (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj;

   if (IS_NPC (ch))
      return;

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

   if (!IS_NDEMPOWER (ch, DEM_SEED))
   {
      send_to_char ("You haven't been granted the gift of seed.\n\r", ch);
      return;
   }
   if (IS_SET (ch->in_room->room_flags, ROOM_SAFE))
   {
      stc ("You cannot desecrate this Holy Place!\n\r", ch);
      return;
   }

   if (argument[0] == '\0')
   {
      send_to_char ("Which item do you wish to plant with Daemonseed?\n\r",
		    ch);
      return;
   }



   if ((obj = get_obj_carry (ch, argument)) == NULL)
   {
      send_to_char ("You do not have that item in your inventory.\n\r", ch);
      return;
   }
   if (str_cmp (ch->name, obj->questowner))
   { stc("You cannot daemonseed something that is not yours.\n\r",ch); return; }
   if (IS_SET (obj->quest, QUEST_DAEMONSEED))
   {
      send_to_char ("That item is already set to explode.\n\r", ch);
      return;
   }


   if (IS_OBJ_STAT (obj, ITEM_BLESS) || IS_OBJ_STAT (obj, ITEM_ANTI_EVIL))
   {
      send_to_char ("You cannot affect such a holy item.\n\r", ch);
      return;
   }

   if (IS_SET (obj->quest, QUEST_ARTIFACT)
       || IS_SET (obj->quest, QUEST_RELIC)
       || IS_SET (obj->quest, QUEST_SPELLPROOF)
       || obj->item_type == ITEM_PIECE)
   {
      send_to_char ("You cannot affect such a powerful item.\n\r", ch);
      return;
   }

   act ("$p starts to shudder and vibrate in your hands.", ch, obj, NULL,
	TO_CHAR);
   act ("$n lays $s hands on $p.", ch, obj, NULL, TO_ROOM);

   WAIT_STATE (ch, 12);
   SET_BIT (obj->quest, QUEST_DAEMONSEED);

   obj->timer = ch->spl[RED_MAGIC] / 4;
}

void do_dempowers (CHAR_DATA * ch, char *argument)
{

   int count = 0;

   if (IS_NPC (ch))
      return;


   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   stc ("#r================================================================================#n\n\r", ch);
   cent_to_char ("#w-[ Demonic Powers ]-#n", ch);
   stc ("#r================================================================================#n\n\r", ch);
   stc ("#w      Innate Powers: #nEntrails\n\r", ch);

   stc ("#w  Changeling Powers: #n", ch);
   if (ch->pcdata->powers[DPOWER_OBJ_VNUM] > 0)
   {
      stc ("Weaponform ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_FORM))
   {
      stc ("Demonform ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#w  Demon body Powers: #n", ch);
   if (IS_DEMPOWER (ch, DEM_FANGS))
   {
      stc ("Fangs ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_CLAWS))
   {
      stc ("Claws ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_HORNS))
   {
      stc ("Horns ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_TAIL))
   {
      stc ("Tail ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_HOOVES))
   {
      stc ("Hooves ", ch);
      count += 1;
   }
   if (IS_NDEMPOWER (ch, DEM_FLAMEHOOVES))
   {
      stc ("Fhooves ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_WINGS))
   {
      stc ("Wings ", ch);
      count += 1;
   }
   if (IS_NDEMPOWER (ch, DEM_BODYSPIKES))
   {
      stc ("Bspikes ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#w    Movement Powers: #n", ch);
   if (IS_DEMPOWER (ch, DEM_TRAVEL))
   {
      stc ("Travel ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_MOVE))
   {
      stc ("Roll ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_LEAP))
   {
      stc ("Leap ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_GATE))
   {
      stc ("Demongate ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#wManipulation Powers: #n", ch);
   if (IS_DEMPOWER (ch, DEM_FREEZEWEAPON))
   {
      stc ("Freezeweapon ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_IMMOLATE))
   {
      stc ("Immolate ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_CAUST))
   {
      stc ("Caust ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#w      Vision Powers: #n", ch);
   if (IS_DEMPOWER (ch, DEM_EYES))
   {
      stc ("Nightsight ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_SCRY))
   {
      stc ("Scry ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_SHADOWSIGHT))
   {
      stc ("Shadowsight ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_TRUESIGHT))
   {
      stc ("Truesight ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#w    Fighting Powers: #n", ch);
   if (IS_DEMPOWER (ch, DEM_TOUGH))
   {
      stc ("Toughness ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_SPEED))
   {
      stc ("Speed ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_MIGHT))
   {
      stc ("Might ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_INFERNO))
   {
      stc ("Inferno ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_UNNERVE))
   {
      stc ("Unnerve ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_BLINK))
   {
      stc ("Blink ", ch);
      count += 1;
   }
   if (IS_NDEMPOWER (ch, DEM_DRAIN))
   {
      stc ("Demondrain ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_LEECH))
   {
      stc ("Leech ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#w      Object Powers: #n", ch);
   if (IS_NDEMPOWER (ch, DEM_SEED))
   {
      stc ("Daemonseed ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_MAGIC))
   {
      stc ("Magic ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_LIFESPAN))
   {
      stc ("Lifespan ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#w       Other Powers: #n", ch);
   if (IS_DEMPOWER (ch, DEM_GRAB))
   {
      stc ("Grab ", ch);
      count += 1;
   }
   if (IS_NDEMPOWER (ch, DEM_SERVANT))
   {
      stc ("Servant ", ch);
      count += 1;
   }
   if (IS_DEMPOWER (ch, DEM_SHIELD))
   {
      stc ("Shield ", ch);
      count += 1;
   }
   if (count == 0)
      stc ("None", ch);
   count = 0;
   stc ("\n\r#r================================================================================#n\n\r", ch);
   return;
}

DO_COM (do_entrails)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   int sn;
   int level;
   int spelltype;

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

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

   if (arg[0] == '\0' && ch->fighting == NULL)
   {
      send_to_char ("Who do you wish to use your entrails on?\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)
   {
      if (is_affected (ch, gsn_entrails))
      {
	 act ("The entrails entrapping $n decompose.", ch, NULL, NULL,
	      TO_ROOM);
	 send_to_char ("The entrails entrapping you decompose.\n\r", ch);
	 affect_strip (ch, gsn_entrails);
      }
      else if (IS_SET (ch->affected_by, AFF_ENTRAILS))
      {
	 act ("The entrails entrapping $n decompose.", ch, NULL, NULL,
	      TO_ROOM);
	 send_to_char ("The entrails entrapping you decompose.\n\r", ch);
	 REMOVE_BIT (ch->affected_by, AFF_ENTRAILS);
      }
      else
	 send_to_char ("Nothing happens.\n\r", ch);
      return;
   }

   if (IS_AFFECTED (victim, AFF_ETHEREAL))
   {
      send_to_char ("You cannot use your Entrails on an ethereal person.\n\r",
		    ch);
      return;
   }

    if ( dice( 1, 100 ) < 40 )
   {
	send_to_char( "They dodge your entrails.\n\r", ch );
	send_to_char( "You dodged their entrail attack.\n\r", victim );
	WAIT_STATE( ch, 18);
	return;
   }
    
   if (is_safe (ch, victim))
      return;

   if ((sn = skill_lookup ("entrails")) < 0)
      return;
   spelltype = skill_table[sn].target;
   level = number_range (10, 50);
   (*skill_table[sn].spell_fun) (sn, level, ch, victim);
   WAIT_STATE (ch, 18);
   return;
}

void fire_effect (void *vo, int level, int dam, int target)
{
   if (target == TARGET_ROOM)	/* nail objects on the floor */
   {
      ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
      OBJ_DATA *obj, *obj_next;

      for (obj = room->contents; obj != NULL; obj = obj_next)
      {
	 obj_next = obj->next_content;
	 fire_effect (obj, level, dam, TARGET_OBJ);
      }
      return;
   }

   if (target == TARGET_CHAR)	/* do the effect on a victim */
   {
      CHAR_DATA *victim = (CHAR_DATA *) vo;
      OBJ_DATA *obj, *obj_next;

      /* chance of blindness */
      if (!IS_AFFECTED (victim, AFF_BLIND))
      {
	 AFFECT_DATA af;
	 act ("$n is blinded by smoke!", victim, NULL, NULL, TO_ROOM);
	 act ("Your eyes tear up from smoke...you can't see a thing!",
	      victim, NULL, NULL, TO_CHAR);

	 af.type = skill_lookup ("fire breath");
	 af.duration = number_range (0, level / 10);
	 af.location = APPLY_HITROLL;
	 af.modifier = -20;
	 af.bitvector = AFF_BLIND;

	 affect_to_char (victim, &af);
      }

      /* let's toast some gear! */
      for (obj = victim->carrying; obj != NULL; obj = obj_next)
      {
	 obj_next = obj->next_content;
	 fire_effect (obj, level, dam, TARGET_OBJ);
      }
      return;
   }

   if (target == TARGET_OBJ)	/* toast an object */
   {
      OBJ_DATA *obj = (OBJ_DATA *) vo;
      OBJ_DATA *t_obj, *n_obj;
      int chance;
      char *msg;

      chance = level / 4 + dam / 10;

      if (chance > 25)
	 chance = (chance - 25) / 2 + 25;
      if (chance > 50)
	 chance = (chance - 50) / 2 + 50;

      if (IS_OBJ_STAT (obj, ITEM_BLESS))
	 chance -= 5;
      chance -= obj->level * 2;

      switch (obj->item_type)
      {
      default:
	 return;
      case ITEM_CONTAINER:
	 msg = "$p ignites and burns!";
	 break;
      case ITEM_POTION:
	 chance += 25;
	 msg = "$p bubbles and boils!";
	 break;
      case ITEM_SCROLL:
	 chance += 50;
	 msg = "$p crackles and burns!";
	 break;
      case ITEM_STAFF:
	 chance += 10;
	 msg = "$p smokes and chars!";
	 break;
      case ITEM_WAND:
	 msg = "$p sparks and sputters!";
	 break;
      case ITEM_FOOD:
	 msg = "$p blackens and crisps!";
	 break;
      case ITEM_PILL:
	 msg = "$p melts and drips!";
	 break;
      }

      chance = URANGE (5, chance, 95);

      if (number_percent () > chance)
	 return;

      if (IS_SET (obj->quest, QUEST_SPELLPROOF))
	 return;
      if (IS_SET (obj->quest2, QUEST2_INDEST))
	 return;

      if (obj->carried_by != NULL)
	 act (msg, obj->carried_by, obj, NULL, TO_ROOM);
      else if (obj->in_room != NULL && obj->in_room->people != NULL)
	 act (msg, obj->in_room->people, obj, NULL, TO_ROOM);

      if (obj->contains)
      {
	 /* dump the contents */

	 for (t_obj = obj->contains; t_obj != NULL; t_obj = n_obj)
	 {
	    n_obj = t_obj->next_content;
	    obj_from_obj (t_obj);
	    if (obj->in_room != NULL)
	       obj_to_room (t_obj, obj->in_room);
	    else if (obj->carried_by != NULL)
	       obj_to_room (t_obj, obj->carried_by->in_room);
	    else
	    {
	       extract_obj (t_obj);
	       continue;
	    }
	    fire_effect (t_obj, level / 2, dam / 2, TARGET_OBJ);
	 }
      }

      extract_obj (obj);
      return;
   }
}

void do_inferno (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *vch, *vch_next;

   if (IS_NPC (ch))
      return;

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

   if (!IS_DEMPOWER (ch, DEM_INFERNO))
   {
      send_to_char ("You have not been granted that power.\n\r", ch);
      return;
   }

   if (ch->hit > 0)
   {
      send_to_char ("This is only used as a last resort.\n\r", ch);
      return;
   }

   if (IS_EXTRA (ch, TIED_UP))
   {
      stc ("Not while tied up!\n\r", ch);
      return;
   }

   act ("$n explodes, sending forth a massive fireballs in all directions.",
	ch, NULL, NULL, TO_ROOM);
   send_to_char ("You explode in a huge blast of abyssal flame.\n\r", ch);
   for (vch = ch->in_room->people; vch != NULL; vch = vch_next)
   {
      vch_next = vch->next_in_room;
      if IS_NPC
	 (vch) continue;
      if (is_safe (vch, ch))
	 continue;
      if (vch != ch)
      {
	 damage (vch, vch, number_range (1500, 2000), gsn_inferno);
	 damage (vch, vch, number_range (1500, 2000), gsn_inferno);
	 fire_effect (vch, ch->level, 2000, TARGET_CHAR);
      }
   }
   WAIT_STATE (ch, 56);
   ch->hit = 10;
   update_pos (ch);
   return;
}


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

   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (IS_IMMUNE (ch, IMM_TRAVEL))
   {
      REMOVE_BIT (ch->immune, IMM_TRAVEL);
      send_to_char ("You can now be the target of travel or burrow.\n\r", ch);
      return;
   }
   else if (!IS_IMMUNE (ch, IMM_TRAVEL))
   {
      SET_BIT (ch->immune, IMM_TRAVEL);
      send_to_char
	 ("You can no longer be the target of travel or burrow.\n\r", ch);
      return;
   }
   else
      send_to_char ("Excuse you?\n\r", ch);
   return;
}



void do_warps (CHAR_DATA * ch, char *argument)
{
   char lin[MAX_STRING_LENGTH];


   if (IS_NPC (ch))
      return;
   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }
   sprintf (lin,
	    "-=(**)=-=(**)=-=(**)=-=(**)=-=(**)=-=(**)=-=(**)=-=(**)=-=(**)=-=(**)=-=(**)=-\n\r");
   send_to_char (lin, ch);
   send_to_char ("                      -=(**)=- Attained Warps -=(**)=-\n\r",
		 ch);
   send_to_char (lin, ch);
   if (IS_SET (ch->warp, WARP_CBODY))
      send_to_char
	 ("Your body is protected by a indestructable crystal shell.\n\r",
	  ch);
   if (IS_SET (ch->warp, WARP_SBODY))
      send_to_char ("Your skin is as hard as steel.\n\r", ch);
   if (IS_SET (ch->warp, WARP_STRONGARMS))
      send_to_char ("Your arms are incredibly strong.\n\r", ch);
   if (IS_SET (ch->warp, WARP_STRONGLEGS))
      send_to_char ("Your legs are incredibly strong.\n\r", ch);
   if (IS_SET (ch->warp, WARP_VENOMTONG))
      send_to_char ("Your tongue is long and venomous.\n\r", ch);
   if (IS_SET (ch->warp, WARP_SPIKETAIL))
      send_to_char ("Your tail fires deadly spikes during combat.\n\r", ch);
   if (IS_SET (ch->warp, WARP_BADBREATH))
      send_to_char ("Your breath is putrid and deadly.\n\r", ch);
   if (IS_SET (ch->warp, WARP_QUICKNESS))
      send_to_char ("You have incredible speed.\n\r", ch);
   if (IS_SET (ch->warp, WARP_STAMINA))
      send_to_char
	 ("You have increased stamina, reducing the damage you take.\n\r",
	  ch);
   if (IS_SET (ch->warp, WARP_HUNT))
      send_to_char ("Your heightened senses enable you to hunt people.\n\r",
		    ch);
   if (IS_SET (ch->warp, WARP_DAMCAP))
      send_to_char
	 ("You are incredibly powerful, making you hit much harder!.\n\r",
	  ch);
   if (IS_SET (ch->warp, WARP_TERROR))
      send_to_char
	 ("Your features are so horrid that they may stun those who look at you.\n\r",
	  ch);
   if (IS_SET (ch->warp, WARP_REGEN))
      send_to_char
	 ("Your body has the ability to regenerate incredibly fast.\n\r", ch);
   if (IS_SET (ch->warp, WARP_STEED))
      send_to_char ("Your mounts transform into hideous Demons.\n\r", ch);
   if (IS_SET (ch->warp, WARP_WEAPON))
      send_to_char
	 ("You have the power to transform into a deadly battle axe.\n\r",
	  ch);
   if (IS_SET (ch->warp, WARP_INFIRMITY))
      send_to_char
	 ("Your body has been afflicted by a terrible infirmity.\n\r", ch);
   if (IS_SET (ch->warp, WARP_GBODY))
      send_to_char ("Your skin is made of a fragile glass.\n\r", ch);
   if (IS_SET (ch->warp, WARP_SCARED))
      send_to_char ("You are incredibly scared of combat.\n\r", ch);
   if (IS_SET (ch->warp, WARP_MAGMA))
      send_to_char ("Your body is composed of deadly magma.\n\r", ch);
   if (IS_SET (ch->warp, WARP_WEAK))
      send_to_char ("Your muscles are severely weakened.\n\r", ch);
   if (IS_SET (ch->warp, WARP_SLOW))
      send_to_char ("Your body moves very slowly.\n\r", ch);
   if (IS_SET (ch->warp, WARP_VULNER))
      send_to_char ("Your skin is very vulnerable to magic.\n\r", ch);
   if (IS_SET (ch->warp, WARP_SHARDS))
      send_to_char ("Your skin is covered with shards of ice.\n\r", ch);
   if (IS_SET (ch->warp, WARP_WINGS))
      send_to_char ("A pair of leathery wings protrude from your back.\n\r",
		    ch);
   if (IS_SET (ch->warp, WARP_CLUMSY))
      send_to_char
	 ("You are incredibly clumsy, enabling you to be disarmed.\n\r", ch);
   if (IS_SET (ch->warp, WARP_STUPID))
      send_to_char
	 ("Your intelligence is extremely low, preventing you from casting spells.\n\r",
	  ch);
   if (IS_SET (ch->warp, WARP_SPOON))
      send_to_char ("There is a spoon stuck on your ear.\n\r", ch);
   if (IS_SET (ch->warp, WARP_FORK))
      send_to_char ("You have a fork stuck in your nose.\n\r", ch);
   if (IS_SET (ch->warp, WARP_KNIFE))
      send_to_char ("You have a knife hanging out of your ear.\n\r", ch);
   if (IS_SET (ch->warp, WARP_SALADBOWL))
      send_to_char ("Your head is made out of a salad bowl.\n\r", ch);
   if (ch->warp < 1)
      send_to_char ("You haven't obtained any warp powers.\n\r", ch);
   send_to_char (lin, ch);
   return;
}


void do_redeem (CHAR_DATA * ch, char *argument)
{

   int warpnum = number_range (1, 18);
   int newwarp = 0;
   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (ch->pcdata->stats[DEMON_TOTAL] < 10000 ||
       ch->pcdata->stats[DEMON_CURRENT] < 10000)
   {
      send_to_char ("You need 10000 demon points to redeem warps!\n\r", ch);
      return;
   }
   {
      if (warpnum == 1)
	 newwarp = WARP_CBODY;
      else if (warpnum == 2)
	 newwarp = WARP_SBODY;
      else if (warpnum == 3)
	 newwarp = WARP_STRONGARMS;
      else if (warpnum == 4)
	 newwarp = WARP_STRONGLEGS;
      else if (warpnum == 5)
	 newwarp = WARP_VENOMTONG;
      else if (warpnum == 6)
	 newwarp = WARP_SPIKETAIL;
      else if (warpnum == 7)
	 newwarp = WARP_BADBREATH;
      else if (warpnum == 8)
	 newwarp = WARP_QUICKNESS;
      else if (warpnum == 9)
	 newwarp = WARP_STAMINA;
      else if (warpnum == 10)
	 newwarp = WARP_HUNT;
      else if (warpnum == 11)
	 newwarp = WARP_DAMCAP;
      else if (warpnum == 12)
	 newwarp = WARP_TERROR;
      else if (warpnum == 13)
	 newwarp = WARP_REGEN;
      else if (warpnum == 14)
	 newwarp = WARP_STEED;
      else if (warpnum == 15)
	 newwarp = WARP_WEAPON;
      else if (warpnum == 16)
	 newwarp = WARP_SHARDS;
      else if (warpnum == 17)
	 newwarp = WARP_WINGS;
      else if (warpnum == 18)
	 newwarp = WARP_MAGMA;
   }

   if (ch->warp == 12877823)
      newwarp = 0;

   if (IS_SET (ch->warp, newwarp) && ch->warp != 12877823)
   {
      do_redeem (ch, "");
      return;
   }

   {
      if (IS_SET (ch->warp, WARP_INFIRMITY))
      {
	 REMOVE_BIT (ch->warp, WARP_INFIRMITY);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_GBODY))
      {
	 REMOVE_BIT (ch->warp, WARP_GBODY);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_SCARED))
      {
	 REMOVE_BIT (ch->warp, WARP_SCARED);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_WEAK))
      {
	 REMOVE_BIT (ch->warp, WARP_WEAK);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_SLOW))
      {
	 REMOVE_BIT (ch->warp, WARP_SLOW);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_VULNER))
      {
	 REMOVE_BIT (ch->warp, WARP_VULNER);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_CLUMSY))
      {
	 REMOVE_BIT (ch->warp, WARP_CLUMSY);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_STUPID))
      {
	 REMOVE_BIT (ch->warp, WARP_STUPID);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_SPOON))
      {
	 REMOVE_BIT (ch->warp, WARP_SPOON);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_FORK))
      {
	 REMOVE_BIT (ch->warp, WARP_FORK);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else if (IS_SET (ch->warp, WARP_KNIFE))
      {
	 REMOVE_BIT (ch->warp, WARP_KNIFE);
	 SET_BIT (ch->warp, newwarp);
	 ch->pcdata->stats[DEMON_CURRENT] -= 10000;
	 send_to_char ("You pray to Satan and a warp is cleansed.\n\r", ch);
	 save_char_obj (ch);
	 return;
      }
      else
	 send_to_char ("You have no evil warps to redeem!\n\r", ch);
   }
   return;
}


void do_obtain (CHAR_DATA * ch, char *argument)
{
   int newwarp = 0;
   int warpnum = number_range (1, 29);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (ch->pcdata->stats[DEMON_TOTAL] < 15000 ||
       ch->pcdata->stats[DEMON_CURRENT] < 15000)
   {
      send_to_char ("You need 15000 demon points to obtain a new warp!\n\r",
		    ch);
      return;
   }

   if (ch->warpcount >= 7)
   {
      send_to_char
	 ("You have already obtained as many warps as possible.\n\r", ch);
      return;
   }

   if (warpnum == 1)
      newwarp = WARP_CBODY;
   else if (warpnum == 2)
      newwarp = WARP_SBODY;
   else if (warpnum == 3)
      newwarp = WARP_STRONGARMS;
   else if (warpnum == 4)
      newwarp = WARP_STRONGLEGS;
   else if (warpnum == 5)
      newwarp = WARP_VENOMTONG;
   else if (warpnum == 6)
      newwarp = WARP_SPIKETAIL;
   else if (warpnum == 7)
      newwarp = WARP_BADBREATH;
   else if (warpnum == 8)
      newwarp = WARP_QUICKNESS;
   else if (warpnum == 9)
      newwarp = WARP_STAMINA;
   else if (warpnum == 10)
      newwarp = WARP_HUNT;
   else if (warpnum == 11)
      newwarp = WARP_DAMCAP;
   else if (warpnum == 12)
      newwarp = WARP_TERROR;
   else if (warpnum == 13)
      newwarp = WARP_REGEN;
   else if (warpnum == 14)
      newwarp = WARP_STEED;
   else if (warpnum == 15)
      newwarp = WARP_WEAPON;
   else if (warpnum == 16)
      newwarp = WARP_INFIRMITY;
   else if (warpnum == 17)
      newwarp = WARP_GBODY;
   else if (warpnum == 18)
      newwarp = WARP_SCARED;
   else if (warpnum == 19)
      newwarp = WARP_MAGMA;
   else if (warpnum == 20)
      newwarp = WARP_WEAK;
   else if (warpnum == 21)
      newwarp = WARP_SLOW;
   else if (warpnum == 22)
      newwarp = WARP_VULNER;
   else if (warpnum == 23)
      newwarp = WARP_SHARDS;
   else if (warpnum == 24)
      newwarp = WARP_WINGS;
   else if (warpnum == 25)
      newwarp = WARP_CLUMSY;
   else if (warpnum == 26)
      newwarp = WARP_STUPID;
   else if (warpnum == 27)
      newwarp = WARP_SPOON;
   else if (warpnum == 28)
      newwarp = WARP_FORK;
   else if (warpnum == 29)
      newwarp = WARP_KNIFE;

   if (IS_SET (ch->warp, newwarp))
   {
      do_obtain (ch, "");
      return;
   }

   SET_BIT (ch->warp, newwarp);
   ch->pcdata->stats[DEMON_CURRENT] -= 15000;
   ch->warpcount += 1;
   send_to_char ("You have obtained a new warp!\n\r", ch);
   save_char_obj (ch);
   return;
}

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


   if (IS_NPC (ch))
      return;
   argument = one_argument (argument, arg);

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (arg[0] == '\0')
   {
      stc ("Which Warp do you wish to clear?\n\r", ch);
      stc ("  crystal steel arms legs tongue tail breath speed stamina hunt\n\r", ch);
      stc ("  damcap horrid regen steed magma wings shards\n\r", ch);

      return;
   }


   if (ch->pcdata->stats[DEMON_TOTAL] < 30000 ||
       ch->pcdata->stats[DEMON_CURRENT] < 30000)
   {
      send_to_char ("You need 30000 demon points to clear a warp!\n\r", ch);
      return;
   }

   if (!str_cmp (arg, "crystal") && IS_SET (ch->warp, WARP_CBODY))
   {
      REMOVE_BIT (ch->warp, WARP_CBODY);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "steel") && IS_SET (ch->warp, WARP_SBODY))
   {
      REMOVE_BIT (ch->warp, WARP_SBODY);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "arms") && IS_SET (ch->warp, WARP_STRONGARMS))
   {
      REMOVE_BIT (ch->warp, WARP_STRONGARMS);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "legs") && IS_SET (ch->warp, WARP_STRONGLEGS))
   {
      REMOVE_BIT (ch->warp, WARP_STRONGLEGS);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "tongue") && IS_SET (ch->warp, WARP_VENOMTONG))
   {
      REMOVE_BIT (ch->warp, WARP_VENOMTONG);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "tail") && IS_SET (ch->warp, WARP_SPIKETAIL))
   {
      REMOVE_BIT (ch->warp, WARP_SPIKETAIL);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "breath") && IS_SET (ch->warp, WARP_BADBREATH))
   {
      REMOVE_BIT (ch->warp, WARP_BADBREATH);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "speed") && IS_SET (ch->warp, WARP_QUICKNESS))
   {
      REMOVE_BIT (ch->warp, WARP_QUICKNESS);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "stamina") && IS_SET (ch->warp, WARP_STAMINA))
   {
      REMOVE_BIT (ch->warp, WARP_STAMINA);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "hunt") && IS_SET (ch->warp, WARP_HUNT))
   {
      REMOVE_BIT (ch->warp, WARP_HUNT);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "damcap") && IS_SET (ch->warp, WARP_DAMCAP))
   {
      REMOVE_BIT (ch->warp, WARP_DAMCAP);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "horrid") && IS_SET (ch->warp, WARP_TERROR))
   {
      REMOVE_BIT (ch->warp, WARP_TERROR);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "shards") && IS_SET (ch->warp, WARP_SHARDS))
   {
      REMOVE_BIT (ch->warp, WARP_SHARDS);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "regen") && IS_SET (ch->warp, WARP_REGEN))
   {
      REMOVE_BIT (ch->warp, WARP_REGEN);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "steed") && IS_SET (ch->warp, WARP_STEED))
   {
      REMOVE_BIT (ch->warp, WARP_STEED);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "axe") && IS_SET (ch->warp, WARP_WEAPON))
   {
      REMOVE_BIT (ch->warp, WARP_WEAPON);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   if (!str_cmp (arg, "magma") && IS_SET (ch->warp, WARP_MAGMA))
   {
      REMOVE_BIT (ch->warp, WARP_MAGMA);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else if (!str_cmp (arg, "wings") && IS_SET (ch->warp, WARP_WINGS))
   {
      REMOVE_BIT (ch->warp, WARP_WINGS);
      ch->warpcount--;
      stc ("Warp Removed\n\r", ch);
      ch->pcdata->stats[DEMON_CURRENT] -= 30000;
      return;
   }
   else
   {
      do_warpclear (ch, "");
   }
   return;
}

void do_inpart (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   char buf[MAX_STRING_LENGTH];
   int inpart = 0;
   int inpart2 = 0;
   int cost = 0;

   smash_tilde (argument);
   argument = one_argument (argument, arg1);
   argument = one_argument (argument, arg2);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }
   if ((victim = get_char_world (ch, arg1)) == NULL)
   {
      send_to_char ("Nobody by that name.\n\r", ch);
      return;
   }

   if (arg1[0] == '\0')
   {
      victim = ch;
      send_to_char ("Syntax: Inpart <person> <power>\n\r", ch);
      sprintf( buf,
         "%sFangs        #n[ #R2500#n] %sClaws        #n[ #R2500#n] %sTail        #n[ #R5000#n]\n\r",
         IS_DEMPOWER (victim, DEM_FANGS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_CLAWS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_TAIL) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sHorns        #n[ #R2500#n] %sHooves       #n[#R 1500#n] %sShadowsight #n[ #R7500#n]\n\r",
         IS_DEMPOWER (victim, DEM_HORNS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_HOOVES) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_SHADOWSIGHT) ? "#0" : "#w");
      send_to_char( buf, ch );
//Graft removed, cost 20000 dps
    
      sprintf( buf,
         "%sNightSight   #n[#R 3000#n] %sWings        #n[ #R1000#n] %sMight       #n[#R 7500#n]\n\r",
         IS_DEMPOWER (victim, DEM_EYES) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_WINGS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_MIGHT) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sToughness    #n[#R 7500#n] %sSpeed        #n[#R 7500#n] %sTravel      #n[#R 1500#n]\n\r",
         IS_DEMPOWER (victim, DEM_TOUGH) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_SPEED) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_TRAVEL) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sScry         #n[#R 7500#n] %sTruesight    #n[#R 7500#n] %sMove        #n[#R  500#n]\n\r",
         IS_DEMPOWER (victim, DEM_SCRY) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_TRUESIGHT) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_MOVE) ? "#0" : "#w"); 
      send_to_char( buf, ch );
      sprintf( buf,
         "%sLeap         #n[#R  500#n] %sMagic        #n[#R 1000#n] %sLifespan    #n[#R  100#n]\n\r",
         IS_DEMPOWER (victim, DEM_LEAP) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_MAGIC) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_LIFESPAN) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sShield       #n[#R20000#n] %sLongsword    #n[#R    0#n] %sShortsword  #n[#R    0#n]\n\r",
         IS_DEMPOWER (victim, DEM_SHIELD) ? "#0" : "#w",
         (victim->pcdata->powers[DPOWER_OBJ_VNUM] == 29662) ? "#0" : "#w",
         (victim->pcdata->powers[DPOWER_OBJ_VNUM] == 29663) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sImmolate     #n[#R 2500#n] %sInferno      #n[#R20000#n] %sCaust       #n[#R 3000#n]\n\r",
         IS_DEMPOWER (victim, DEM_IMMOLATE) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_INFERNO) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_CAUST) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sUnnerve      #n[#R 5000#n] %sFreezeweapon #n[#R 3000#n] %sDemonform   #n[#R25000#n]\n\r",
         IS_DEMPOWER (victim, DEM_UNNERVE) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_FREEZEWEAPON) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_FORM) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sLeech        #n[#R15000#n] %sBlink        #n[#R25000#n] %sDemongate   #n[#R15000#n]\n\r",
         IS_DEMPOWER (victim, DEM_LEECH) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_BLINK) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_GATE) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sGrab         #n[ #R7000#n] %sPrince       #n[#R    0#n] %sPact        #n[#R    0#n] \n\r",
         IS_DEMPOWER (victim, DEM_GRAB) ? "#0" : "#w",
         IS_SET (victim->special, SPC_PRINCE) ? "#0" : "#w",
         IS_SET (victim->special, SPC_SIRE) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sFlamehooves  #n[#R 1000#n] %sDaemonseed   #n[#R15000#n] %sServant     #n[#R10000#n]\n\r",
         IS_NDEMPOWER (victim, DEM_FLAMEHOOVES) ? "#0" : "#w",
         IS_NDEMPOWER (victim, DEM_SEED) ? "#0" : "#w",
         IS_NDEMPOWER (victim, DEM_SERVANT) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sDemondrain   #n[#R 7500#n] %sBodySpikes   #n[#R 7500#n]\n\r",
         IS_NDEMPOWER (victim, DEM_DRAIN) ? "#0" : "#w",
         IS_NDEMPOWER (victim, DEM_BODYSPIKES) ? "#0" : "#w");
      send_to_char( buf, ch );
	      return;
   }



   if (IS_NPC (victim))
   {
      send_to_char ("Not on NPC's.\n\r", ch);
      return;
   }


   if (victim->level < LEVEL_AVATAR ||
       (victim != ch && !IS_SET (victim->special, SPC_CHAMPION)))
   {
      send_to_char ("Only on a champion.\n\r", ch);
      return;
   }

   if (victim != ch && str_cmp (victim->lord, ch->name) &&
       str_cmp (victim->lord, ch->lord) && strlen (victim->lord) > 1)
   {
      send_to_char ("They are not your champion.\n\r", ch);
      return;
   }

   if (!str_cmp (arg2, "pact"))
   {
      if (victim == ch)
      {
	 send_to_char ("Not on yourself!\n\r", ch);
	 return;
      }
      if (IS_SET (victim->special, SPC_SIRE))
      {
	 send_to_char ("You have lost the power to make pacts!\n\r", victim);
	 send_to_char ("You remove their power to make pacts.\n\r", ch);
	 REMOVE_BIT (victim->special, SPC_SIRE);
      }
      else
      {
	 send_to_char ("You have been granted the power to make pacts!\n\r",
		       victim);
	 send_to_char ("You grant them the power to make pacts.\n\r", ch);
	 SET_BIT (victim->special, SPC_SIRE);
      }
      do_autosave (victim, "");
      return;
   }
   if (!str_cmp (arg2, "prince"))
   {
      if (victim == ch)
      {
	 send_to_char ("Not on yourself!\n\r", ch);
	 return;
      }
      if (!IS_SET (ch->special, SPC_DEMON_LORD))
      {
	 send_to_char
	    ("Only the Demon Lord has the power to make princes.\n\r", ch);
	 return;
      }
      if (IS_SET (victim->special, SPC_PRINCE))
      {
	 send_to_char ("You have lost your princehood!\n\r", victim);
	 send_to_char ("You remove their princehood.\n\r", ch);
	 REMOVE_BIT (victim->special, SPC_PRINCE);
      }
      else
      {
	 send_to_char ("You have been made a prince!\n\r", victim);
	 send_to_char ("You make them a prince.\n\r", ch);
	 SET_BIT (victim->special, SPC_PRINCE);
      }
      do_autosave (victim, "");
      return;
   }

   if (!str_cmp (arg2, "longsword"))
   {
      send_to_char
	 ("You have been granted the power to transform into a demonic longsword!\n\r",
	  victim);
      send_to_char
	 ("You grant them the power to transform into a demonic longsword.\n\r",
	  ch);
      victim->pcdata->powers[DPOWER_OBJ_VNUM] = 29662;
      save_char_obj (victim);
      return;
   }

   if (!str_cmp (arg2, "shortsword"))
   {
      send_to_char
	 ("You have been granted the power to transform into a demonic shortsword!\n\r",
	  victim);
      send_to_char
	 ("You grant them the power to transform into a demonic shortsword.\n\r",
	  ch);
      victim->pcdata->powers[DPOWER_OBJ_VNUM] = 29663;
      save_char_obj (victim);
      return;
   }


   if (!str_cmp (arg2, "fangs"))
   {
      inpart = DEM_FANGS;
      inpart2 = DPOWER_FLAGS;
      cost = 2500;
   }
   else if (!str_cmp (arg2, "demongate"))
   {
      inpart = DEM_GATE;
      inpart2 = DPOWER_FLAGS;
      cost = 15000;
   }
   else if (!str_cmp (arg2, "immolate"))
   {
      inpart = DEM_IMMOLATE;
      inpart2 = DPOWER_FLAGS;
      cost = 2500;
   }
   else if (!str_cmp (arg2, "inferno"))
   {
      inpart = DEM_INFERNO;
      inpart2 = DPOWER_FLAGS;
      cost = 20000;
   }
   else if (!str_cmp (arg2, "caust"))
   {
      inpart = DEM_CAUST;
      inpart2 = DPOWER_FLAGS;
      cost = 3000;
   }
   else if (!str_cmp (arg2, "freezeweapon"))
   {
      inpart = DEM_FREEZEWEAPON;
      inpart2 = DPOWER_FLAGS;
      cost = 3000;
   }
   else if (!str_cmp (arg2, "unnerve"))
   {
      inpart = DEM_UNNERVE;
      inpart2 = DPOWER_FLAGS;
      cost = 5000;
   }
   else if (!str_cmp (arg2, "claws"))
   {
      inpart = DEM_CLAWS;
      inpart2 = DPOWER_FLAGS;
      cost = 2500;
   }
   else if (!str_cmp (arg2, "horns"))
   {
      inpart = DEM_HORNS;
      inpart2 = DPOWER_FLAGS;
      cost = 2500;
   }
   else if (!str_cmp (arg2, "demonform"))
   {
      inpart = DEM_FORM;
      inpart2 = DPOWER_FLAGS;
      cost = 25000;
   }
   else if (!str_cmp (arg2, "tail"))
   {
      inpart = DEM_TAIL;
      cost = 5000;
   }
   else if (!str_cmp (arg2, "hooves"))
   {
      inpart = DEM_HOOVES;
      inpart2 = DPOWER_FLAGS;
      cost = 1500;
   }
   else if (!str_cmp (arg2, "shield"))
   {
      inpart = DEM_SHIELD;
      inpart2 = DPOWER_FLAGS;
      cost = 20000;
   }
   else if (!str_cmp (arg2, "nightsight"))
   {
      inpart = DEM_EYES;
      inpart2 = DPOWER_FLAGS;
      cost = 3000;
   }
   else if (!str_cmp (arg2, "wings"))
   {
      inpart = DEM_WINGS;
      inpart2 = DPOWER_FLAGS;
      cost = 1000;
   }
   else if (!str_cmp (arg2, "might"))
   {
      inpart = DEM_MIGHT;
      inpart2 = DPOWER_FLAGS;
      cost = 7500;
   }
   else if (!str_cmp (arg2, "toughness"))
   {
      inpart = DEM_TOUGH;
      inpart2 = DPOWER_FLAGS;
      cost = 7500;
   }
   else if (!str_cmp (arg2, "speed"))
   {
      inpart = DEM_SPEED;
      inpart2 = DPOWER_FLAGS;
      cost = 7500;
   }
   else if (!str_cmp (arg2, "travel"))
   {
      inpart = DEM_TRAVEL;
      inpart2 = DPOWER_FLAGS;
      cost = 1500;
   }
   else if (!str_cmp (arg2, "scry"))
   {
      inpart = DEM_SCRY;
      inpart2 = DPOWER_FLAGS;
      cost = 7500;
   }
   else if (!str_cmp (arg2, "move"))
   {
      inpart = DEM_MOVE;
      inpart2 = DPOWER_FLAGS;
      cost = 500;
   }
   else if (!str_cmp (arg2, "leap"))
   {
      inpart = DEM_LEAP;
      inpart2 = DPOWER_FLAGS;
      cost = 500;
   }
   else if (!str_cmp (arg2, "magic"))
   {
      inpart = DEM_MAGIC;
      inpart2 = DPOWER_FLAGS;
      cost = 1000;
   }
   else if (!str_cmp (arg2, "truesight"))
   {
      inpart = DEM_TRUESIGHT;
      inpart2 = DPOWER_FLAGS;
      cost = 7500;
   }
/*
    else if (!str_cmp(arg2,"graft"))
	{inpart = DEM_GRAFT; cost = 20000;}
*/
   else if (!str_cmp (arg2, "shadowsight"))
   {
      inpart = DEM_SHADOWSIGHT;
      inpart2 = DPOWER_FLAGS;
      cost = 7500;
   }
   else if (!str_cmp (arg2, "leech"))
   {
      inpart = DEM_LEECH;
      inpart2 = DPOWER_FLAGS;
      cost = 15000;
   }
   else if (!str_cmp (arg2, "blink"))
   {
      inpart = DEM_BLINK;
      inpart2 = DPOWER_FLAGS;
      cost = 15000;
   }
   else if (!str_cmp (arg2, "lifespan"))
   {
      inpart = DEM_LIFESPAN;
      inpart2 = DPOWER_FLAGS;
      cost = 100;
   }
   else if (!str_cmp (arg2, "grab"))
   {
      inpart = DEM_GRAB;
      inpart2 = DPOWER_FLAGS;
      cost = 7000;
   }
   else if (!str_cmp (arg2, "flamehooves"))
   {
      inpart = DEM_FLAMEHOOVES;
      inpart2 = DPOWER_FLAGS2;
      cost = 1000;
   }
   else if (!str_cmp (arg2, "daemonseed"))
   {
      inpart = DEM_SEED;
      inpart2 = DPOWER_FLAGS2;
      cost = 15000;
   }
   else if (!str_cmp (arg2, "servant"))
   {
      inpart = DEM_SERVANT;
      inpart2 = DPOWER_FLAGS2;
      cost = 10000;
   }
   else if (!str_cmp (arg2, "demondrain"))
   {
      inpart = DEM_DRAIN;
      inpart2 = DPOWER_FLAGS2;
      cost = 7500;
   }
   else if (!str_cmp (arg2, "bodyspikes"))
   {
      inpart = DEM_BODYSPIKES;
      inpart2 = DPOWER_FLAGS2;
      cost = 7500;
   }
   else
   {
      send_to_char ("Syntax: Inpart <person> <power>\n\r", ch);
      sprintf( buf,
         "%sFangs        #n[ #R2500#n] %sClaws        #n[ #R2500#n] %sTail        #n[ #R5000#n]\n\r",
         IS_DEMPOWER (victim, DEM_FANGS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_CLAWS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_TAIL) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sHorns        #n[ #R2500#n] %sHooves       #n[#R 1500#n] %sShadowsight #n[ #R7500#n]\n\r",
         IS_DEMPOWER (victim, DEM_HORNS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_HOOVES) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_SHADOWSIGHT) ? "#0" : "#w");
      send_to_char( buf, ch );
//Graft removed, cost 20000 dps
    
      sprintf( buf,
         "%sNightSight   #n[#R 3000#n] %sWings        #n[ #R1000#n] %sMight       #n[#R 7500#n]\n\r",
         IS_DEMPOWER (victim, DEM_EYES) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_WINGS) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_MIGHT) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sToughness    #n[#R 7500#n] %sSpeed        #n[#R 7500#n] %sTravel      #n[#R 1500#n]\n\r",
         IS_DEMPOWER (victim, DEM_TOUGH) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_SPEED) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_TRAVEL) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sScry         #n[#R 7500#n] %sTruesight    #n[#R 7500#n] %sMove        #n[#R  500#n]\n\r",
         IS_DEMPOWER (victim, DEM_SCRY) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_TRUESIGHT) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_MOVE) ? "#0" : "#w"); 
      send_to_char( buf, ch );
      sprintf( buf,
         "%sLeap         #n[#R  500#n] %sMagic        #n[#R 1000#n] %sLifespan    #n[#R  100#n]\n\r",
         IS_DEMPOWER (victim, DEM_LEAP) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_MAGIC) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_LIFESPAN) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sShield       #n[#R20000#n] %sLongsword    #n[#R    0#n] %sShortsword  #n[#R    0#n]\n\r",
         IS_DEMPOWER (victim, DEM_SHIELD) ? "#0" : "#w",
         (victim->pcdata->powers[DPOWER_OBJ_VNUM] == 29662) ? "#0" : "#w",
         (victim->pcdata->powers[DPOWER_OBJ_VNUM] == 29663) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sImmolate     #n[#R 2500#n] %sInferno      #n[#R20000#n] %sCaust       #n[#R 3000#n]\n\r",
         IS_DEMPOWER (victim, DEM_IMMOLATE) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_INFERNO) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_CAUST) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sUnnerve      #n[#R 5000#n] %sFreezeweapon #n[#R 3000#n] %sDemonform   #n[#R25000#n]\n\r",
         IS_DEMPOWER (victim, DEM_UNNERVE) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_FREEZEWEAPON) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_FORM) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sLeech        #n[#R15000#n] %sBlink        #n[#R25000#n] %sDemongate   #n[#R15000#n]\n\r",
         IS_DEMPOWER (victim, DEM_LEECH) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_BLINK) ? "#0" : "#w",
         IS_DEMPOWER (victim, DEM_GATE) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sGrab         #n[ #R7000#n] %sPrince       #n[#R    0#n] %sPact        #n[#R    0#n] \n\r",
         IS_DEMPOWER (victim, DEM_GRAB) ? "#0" : "#w",
         IS_SET (victim->special, SPC_PRINCE) ? "#0" : "#w",
         IS_SET (victim->special, SPC_SIRE) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sFlamehooves  #n[#R 1000#n] %sDaemonseed   #n[#R15000#n] %sServant     #n[#R10000#n]\n\r",
         IS_NDEMPOWER (victim, DEM_FLAMEHOOVES) ? "#0" : "#w",
         IS_NDEMPOWER (victim, DEM_SEED) ? "#0" : "#w",
         IS_NDEMPOWER (victim, DEM_SERVANT) ? "#0" : "#w");
      send_to_char( buf, ch );
      sprintf( buf,
         "%sDemondrain   #n[#R 7500#n] %sBodySpikes   #n[#R 7500#n]\n\r",
         IS_NDEMPOWER (victim, DEM_DRAIN) ? "#0" : "#w",
         IS_NDEMPOWER (victim, DEM_BODYSPIKES) ? "#0" : "#w");
      send_to_char( buf, ch );
      return;
   }
//    if (IS_DEMPOWER(victim, inpart))
   if (IS_SET (victim->pcdata->powers[inpart2], inpart))
   {
      send_to_char ("They have already got that power.\n\r", ch);
      return;
   }
   if (ch->pcdata->stats[DEMON_TOTAL] < cost ||
       ch->pcdata->stats[DEMON_CURRENT] < cost)
   {
      send_to_char ("You have insufficient power to inpart that gift.\n\r",
		    ch);
      return;
   }
   SET_BIT (victim->pcdata->powers[inpart2], inpart);
   ch->pcdata->stats[DEMON_CURRENT] -= cost;
   if (victim != ch)
      send_to_char
	 ("You have been granted a demonic gift from your patron!\n\r",
	  victim);
   send_to_char ("Ok.\n\r", ch);
   if (victim != ch)
      save_char_obj (ch);
   save_char_obj (victim);
   return;
}

/*
void do_demonarmour( CHAR_DATA *ch, char *argument )
{
    OBJ_INDEX_DATA *pObjIndex;
    OBJ_DATA *obj;
    char arg[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    int vnum = 0;

    argument = one_argument( argument, arg );
    argument = one_argument( argument, arg2 );

    if (IS_NPC(ch)) return;

    if (!IS_CLASS(ch, CLASS_DEMON))
    {
        do_rand_typo(ch);
	return;
    }
    
    if (arg[0] == '\0')
    {
    send_to_char("Command: demonarmor <black/red> <piece>.\n\r", ch);
    return;
    }

    if (arg2[0] == '\0')
    {
	send_to_char("Please specify which piece of demon armor you wish to make: Ring Collar\n\rPlate Helmet Leggings Boots Gauntlets Sleeves Cape Belt Bracer Visor.\n\r",ch);
	return;
    }

    if      (!str_cmp(arg2,"ring"     ) && !str_cmp(arg,"black")) vnum = 29650;
    else if (!str_cmp(arg2,"collar"   ) && !str_cmp(arg,"black")) vnum = 29651;
    else if (!str_cmp(arg2,"plate"    ) && !str_cmp(arg,"black")) vnum = 29652;
    else if (!str_cmp(arg2,"helmet"   ) && !str_cmp(arg,"black")) vnum = 29653;
    else if (!str_cmp(arg2,"leggings" ) && !str_cmp(arg,"black")) vnum = 29654;
    else if (!str_cmp(arg2,"boots"    ) && !str_cmp(arg,"black")) vnum = 29655;
    else if (!str_cmp(arg2,"gauntlets") && !str_cmp(arg,"black")) vnum = 29656;
    else if (!str_cmp(arg2,"sleeves"  ) && !str_cmp(arg,"black")) vnum = 29657;
    else if (!str_cmp(arg2,"cape"     ) && !str_cmp(arg,"black")) vnum = 29658;
    else if (!str_cmp(arg2,"belt"     ) && !str_cmp(arg,"black")) vnum = 29659;
    else if (!str_cmp(arg2,"bracer"   ) && !str_cmp(arg,"black")) vnum = 29660;
    else if (!str_cmp(arg2,"visor"    ) && !str_cmp(arg,"black")) vnum = 29661;
    else if (!str_cmp(arg2,"ring"     ) && !str_cmp(arg,"red")) vnum = 27650;
    else if (!str_cmp(arg2,"collar"   ) && !str_cmp(arg,"red")) vnum = 27651;
    else if (!str_cmp(arg2,"plate"    ) && !str_cmp(arg,"red")) vnum = 27652;
    else if (!str_cmp(arg2,"helmet"   ) && !str_cmp(arg,"red")) vnum = 27653;
    else if (!str_cmp(arg2,"leggings" ) && !str_cmp(arg,"red")) vnum = 27654;
    else if (!str_cmp(arg2,"boots"    ) && !str_cmp(arg,"red")) vnum = 27655;
    else if (!str_cmp(arg2,"gauntlets") && !str_cmp(arg,"red")) vnum = 27656;
    else if (!str_cmp(arg2,"sleeves"  ) && !str_cmp(arg,"red")) vnum = 27657;
    else if (!str_cmp(arg2,"cape"     ) && !str_cmp(arg,"red")) vnum = 27658;
    else if (!str_cmp(arg2,"belt"     ) && !str_cmp(arg,"red")) vnum = 27659;
    else if (!str_cmp(arg2,"bracer"   ) && !str_cmp(arg,"red")) vnum = 27660;
    else if (!str_cmp(arg2,"visor"    ) && !str_cmp(arg,"red")) vnum = 27661;
//    else if (!str_cmp(arg2,"longsword") && !str_cmp(arg,"red")) vnum = 29662;
//    else if (!str_cmp(arg2,"shortsword") && !str_cmp(arg,"red")) vnum = 29663;
    else
    {
	send_to_char("Please specify which piece of demon armor you wish to make: Ring Collar\n\rPlate Helmet Leggings Boots Gauntlets Sleeves Cape Belt Bracer Visor.\n\r",ch);
	return;
    }
    if ( (ch->pcdata->stats[DEMON_TOTAL] < 5000 || ch->pcdata->stats[DEMON_CURRENT] < 5000)
         && !str_cmp(arg,"black"))
    {
	send_to_char("It costs 5000 power to create a piece of black demon armour.\n\r",ch);
	return;
    }

    else if ( (ch->pcdata->stats[DEMON_TOTAL] < 15000 || ch->pcdata->stats[DEMON_CURRENT] < 15000 || 
         ch->pcdata->quest < 3000)
         && !str_cmp(arg,"red"))
    {
     send_to_char("It costs 15000 power and 3000 qps to create a piece of red demon armour.\n\r",ch);
     return;
    }

    if ( vnum == 0 || (pObjIndex = get_obj_index( vnum )) == NULL)
    {
	send_to_char("Missing object, please inform KaVir.\n\r",ch);
	return;
    }
    if ( !str_cmp(arg,"black") )
    {
    ch->pcdata->stats[DEMON_TOTAL]   -= 5000;
    ch->pcdata->stats[DEMON_CURRENT] -= 5000;
    }
    else if ( !str_cmp(arg,"red") )
    {
    ch->pcdata->stats[DEMON_TOTAL]   -= 15000;
    ch->pcdata->stats[DEMON_CURRENT] -= 15000;
    }
    obj = create_object(pObjIndex, 50);
    obj_to_char(obj, ch);
    act("$p appears in your hands in a blast of flames.",ch,obj,NULL,TO_CHAR);
    act("$p appears in $n's hands in a blast of flames.",ch,obj,NULL,TO_ROOM);
    return;
}
*/
void do_demonarmour (CHAR_DATA * ch, char *argument)
{
   OBJ_INDEX_DATA *pObjIndex;
   OBJ_DATA *obj;
   char buf[MAX_STRING_LENGTH];
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   int vnum = 0;

   argument = one_argument (argument, arg1);
   argument = one_argument (argument, arg2);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }
   if (arg1[0] == '\0' || arg2[0] == '\0')
   {
      send_to_char ("Syntax: demonarmour <colour> <armour>\n\r", ch);
      send_to_char ("Colour can be one of: Black Grey Purple Red Brass.\n\r",
		    ch);
      send_to_char
	 ("Armour can be one of: Ring Collar Plate Helmet Leggings Boots Gauntlets\n\r              Sleeves Cape Belt Bracer Visor.\n\r",
	  ch);
      return;
   }
   if (str_cmp (arg1, "black") && str_cmp (arg1, "red")
       && str_cmp (arg1, "grey") && str_cmp (arg1, "purple")
       && str_cmp (arg1, "brass"))
   {
      send_to_char ("Syntax: demonarmour <colour> <armour>\n\r", ch);
      send_to_char ("Colour can be one of: Black Grey Purple Red Brass.\n\r",
		    ch);
      send_to_char
	 ("Armour can be one of: Ring Collar Plate Helmet Leggings Boots Gauntlets\n\r              Sleeves Cape Belt Bracer Visor.\n\r",
	  ch);
      return;
   }
   if (!str_cmp (arg2, "ring"))
      vnum = 29650;
   else if (!str_cmp (arg2, "collar"))
      vnum = 29651;
   else if (!str_cmp (arg2, "plate"))
      vnum = 29652;
   else if (!str_cmp (arg2, "helmet"))
      vnum = 29653;
   else if (!str_cmp (arg2, "leggings"))
      vnum = 29654;
   else if (!str_cmp (arg2, "boots"))
      vnum = 29655;
   else if (!str_cmp (arg2, "gauntlets"))
      vnum = 29656;
   else if (!str_cmp (arg2, "sleeves"))
      vnum = 29657;
   else if (!str_cmp (arg2, "cape"))
      vnum = 29658;
   else if (!str_cmp (arg2, "belt"))
      vnum = 29659;
   else if (!str_cmp (arg2, "bracer"))
      vnum = 29660;
   else if (!str_cmp (arg2, "visor"))
      vnum = 29661;
   else
   {
      send_to_char ("Syntax: demonarmour <colour> <armour>\n\r", ch);
      send_to_char ("Colour can be one of: Black Grey Purple Red Brass.\n\r",
		    ch);
      send_to_char
	 ("Armour can be one of: Ring Collar Plate Helmet Leggings Boots Gauntlets\n\r               Sleeves Cape Belt Bracer Visor.\n\r",
	  ch);
      return;
   }
   if (!str_cmp (arg1, "black") && (ch->pcdata->stats[DEMON_TOTAL] < 5000 ||
				    ch->pcdata->stats[DEMON_CURRENT] < 5000))
   {
      send_to_char
	 ("It costs 5000 points of power to create a piece of black demon armour.\n\r",
	  ch);
      return;
   }
   if (!str_cmp (arg1, "grey") && (ch->pcdata->stats[DEMON_TOTAL] < 5000 ||
				   ch->pcdata->stats[DEMON_CURRENT] < 5000
				   || ch->pcdata->quest < 100))
   {
      send_to_char
	 ("It costs 5000 power and 100 qp to create a piece of grey demon armour.\n\r",
	  ch);
      return;
   }
   if (!str_cmp (arg1, "purple") && (ch->pcdata->stats[DEMON_TOTAL] < 5000 ||
				     ch->pcdata->stats[DEMON_CURRENT] < 5000
				     || ch->pcdata->quest < 250))
   {
      send_to_char
	 ("It costs 5000 power and 250 qp to create a piece of purple demon armour.\n\r",
	  ch);
      return;
   }
   if (!str_cmp (arg1, "red") && (ch->pcdata->stats[DEMON_CURRENT] < 5000 ||
				  ch->pcdata->stats[DEMON_TOTAL] < 5000
				  || ch->pcdata->quest < 750))
   {
      send_to_char
	 ("It costs 5000 power and 750 qp to create a piece of red demon armour.\n\r",
	  ch);
      return;
   }
   if (!str_cmp (arg1, "brass") && (ch->pcdata->stats[DEMON_TOTAL] < 5000 ||
				    ch->pcdata->stats[DEMON_CURRENT] < 5000
				    || ch->pcdata->quest < 1500))
   {
      send_to_char
	 ("It costs 5000 power and 1500 qp to create a piece of brass demon armour.\n\r",
	  ch);
      return;
   }
   if (vnum == 0 || (pObjIndex = get_obj_index (vnum)) == NULL)
   {
      send_to_char ("Missing object, please inform an IMP.\n\r", ch);
      return;
   }
   obj = create_object (pObjIndex, 50);
   obj_to_char (obj, ch);
   ch->pcdata->stats[DEMON_CURRENT] -= 5000;
   ch->pcdata->stats[DEMON_TOTAL] -= 5000;
   if (!str_cmp (arg1, "grey"))
   {
      obj->specpower = ARM_GREY;
      ch->pcdata->quest -= 100;
      obj->points += 100;
   }
   if (!str_cmp (arg1, "purple"))
   {
      obj->specpower = ARM_PURPLE;
      ch->pcdata->quest -= 250;
      obj->points += 250;
   }
   if (!str_cmp (arg1, "red"))
   {
      obj->specpower = ARM_RED;
      ch->pcdata->quest -= 750;
      obj->points += 750;
   }
   if (!str_cmp (arg1, "brass"))
   {
      obj->specpower = ARM_BRASS;
      ch->pcdata->quest -= 1500;
      obj->points += 1500;
   }

   sprintf (buf, obj->name, arg1, "demon");
   free_string (obj->name);
   obj->name = str_dup (buf);

   sprintf (buf, obj->short_descr, arg1, "demon");
   free_string (obj->short_descr);
   obj->short_descr = str_dup (buf);

   sprintf (buf, obj->description, arg1, "demon");
   free_string (obj->description);
   obj->description = str_dup (buf);

   free_string (obj->questmaker);
   obj->questmaker = str_dup (ch->name);

   free_string (obj->questowner);
   obj->questowner = str_dup (ch->name);

   SET_BIT (obj->spectype, SITEM_DEMONIC);
   SET_BIT (obj->extra_flags, ITEM_ANTI_GOOD);

   act ("$p appears in your hands in a blast of flames.", ch, obj, NULL,
	TO_CHAR);
   act ("$p appears in $n's hands in a blast of flames.", ch, obj, NULL,
	TO_ROOM);
   return;
}



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

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (IS_CLASS (ch, CLASS_DEMON) || IS_SET (ch->special, SPC_CHAMPION))
   {
      if (!IS_DEMPOWER (ch, DEM_TRAVEL))
      {
	 send_to_char ("You haven't been granted the gift of travel.\n\r",
		       ch);
	 return;
      }
   }
   else
   {
      do_rand_typo (ch);
      return;
   }

   if (ch->fight_timer > 0)
   {
      stc ("Not with a fight timer!\n\r", ch);
      return;
   }
   if (ch->in_room != NULL && IS_SET (ch->in_room->room_flags, ROOM_GOD))
   {
      send_to_char ("Nothing happens.\n\r", ch);
      return;
   }

   if (is_inarena (ch))
      return;
   if (!str_cmp (arg, "hell"))
   {
      send_to_char ("You sink into the ground.\n\r", ch);
      act ("$n sinks into the ground.", ch, NULL, NULL, TO_ROOM);
      char_from_room (ch);
      char_to_room (ch, get_room_index (ROOM_VNUM_HELL));
      do_look (ch, "");
      send_to_char ("You rise up out of the ground.\n\r", ch);
      act ("$n rises up out of the ground.", ch, NULL, NULL, TO_ROOM);
      return;
   }

   if ((victim = get_char_world (ch, arg)) == NULL)
   {
      send_to_char ("Nobody by that name.\n\r", ch);
      return;
   }

   if (IS_NPC (victim))
   {
      send_to_char ("Not on NPC's.\n\r", ch);
      return;
   }

   if (!IS_NPC (ch) && IS_IMMUNE (victim, IMM_TRAVEL))
   {
      send_to_char ("You are unable to travel to them right now.\n\r", ch);
      return;
   }
   if (IS_SET (victim->flag2, AFF2_INARENA))
   {
      stc ("They're in the arena. You are unable to portal to them.\n\r", ch);
      return;
   }

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

   if (victim->level != LEVEL_AVATAR ||
       (!IS_SET (victim->special, SPC_CHAMPION)
	&& !IS_CLASS (victim, CLASS_DEMON)))
   {
      send_to_char ("Nothing happens.\n\r", ch);
      return;
   }

   if (victim->in_room != NULL
       && IS_SET (victim->in_room->room_flags, ROOM_GOD))
   {
      send_to_char ("Nothing happens.\n\r", ch);
      return;
   }

   if (victim->in_room == NULL || victim->in_room == ch->in_room)
   {
      send_to_char ("Nothing happens.\n\r", ch);
      return;
   }

   if (strlen (ch->clan) > 1)
      cdemon = ch->clan;
   else
      cdemon = ch->name;
   if (strlen (victim->clan) > 1)
      vdemon = victim->clan;
   else
      vdemon = victim->name;

   /* Demons cannot travel to oppositing Demons Unless they have summon on */
   if (str_cmp (cdemon, vdemon) && !IS_IMMUNE (victim, IMM_SUMMON))
   {
      send_to_char ("Nothing happens.\n\r", ch);
      return;
   }
   send_to_char ("You sink into the ground.\n\r", ch);
   act ("$n sinks into the ground.", ch, NULL, NULL, TO_ROOM);
   char_from_room (ch);
   char_to_room (ch, victim->in_room);
   do_look (ch, "");
   send_to_char ("You rise up out of the ground.\n\r", ch);
   act ("$n rises up out of the ground.", ch, NULL, NULL, TO_ROOM);
   return;
}

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

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_VAMPIRE) && !IS_CLASS (ch, CLASS_DEMON)
       && !IS_CLASS (ch, CLASS_DRAGON) && !IS_SET (ch->special, SPC_CHAMPION))
   {
      do_rand_typo (ch);
      return;
   }
   if (!IS_DEMPOWER (ch, DEM_HORNS) && IS_CLASS (ch, CLASS_DEMON))
   {
      send_to_char ("You haven't been granted the gift of horns.\n\r", ch);
      return;
   }
   else if (IS_CLASS (ch, CLASS_VAMPIRE) && !IS_VAMPAFF (ch, VAM_VICISSITUDE))
   {
      send_to_char ("You have not mastered the Vicissitude discipline.\n\r",
		    ch);
      return;
   }

   if (IS_DEMAFF (ch, DEM_HORNS))
   {
      send_to_char ("Your horns slide back into your head.\n\r", ch);
      act ("$n's horns slide back into $s head.", ch, NULL, NULL, TO_ROOM);
      REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_HORNS);
      return;
   }
   send_to_char ("Your horns extend out of your head.\n\r", ch);
   act ("A pair of pointed horns extend from $n's head.", ch, NULL, NULL,
	TO_ROOM);
   SET_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_HORNS);
   return;
}
void do_tail (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }
   if (!IS_DEMPOWER (ch, DEM_TAIL))
   {
      send_to_char ("You haven't been granted the gift of a tail.\n\r", ch);
      return;
   }

   if (IS_DEMAFF (ch, DEM_TAIL))
   {
      send_to_char ("Your tail slides back into your back.\n\r", ch);
      act ("$n's tail slides back into $s back.", ch, NULL, NULL, TO_ROOM);
      REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_TAIL);
      return;
   }

   send_to_char ("Your tail slides out of your back side.\n\r", ch);
   act ("A huge tail extends from $n's back.", ch, NULL, NULL, TO_ROOM);
   SET_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_TAIL);
   return;
}

/*
void do_axe( CHAR_DATA *ch, char *argument )
{
    OBJ_DATA *obj;
    
     if ( IS_NPC(ch) )
	return;
 
	if (ch->fight_timer >0) {
        send_to_char("Not until your fight timer expires.\n\r", ch );
        return;}

    if (!IS_CLASS(ch, CLASS_DEMON)) 
    {
        do_rand_typo(ch);
	return;
    }
if (!IS_SET(ch->warp, WARP_WEAPON))
        {

stc("You need the warp weapon to use this power.\n\r",ch);
return;
}
 
save_char_obj(ch);

  if ((obj = create_object(get_obj_index( 222),60)) == NULL)
    {
        send_to_char( "Error - Please inform Sage.\n\r", ch);
	return;
    }

    if ( IS_EXTRA(ch, EXTRA_AXE) )
    {
      ch->pcdata->obj_vnum = 0;
      REMOVE_BIT(ch->affected_by, AFF_POLYMORPH);
      REMOVE_BIT(ch->extra, EXTRA_OSWITCH);
      REMOVE_BIT(ch->extra, EXTRA_AXE);
      ch->pcdata->chobj = NULL;
      obj->chobj = NULL;
      free_string(ch->morph);
      ch->morph = str_dup("");
      act("$p transforms into $n.",ch,obj,NULL,TO_ROOM);
      act("You reform your human body.",ch,obj,NULL,TO_CHAR);
      extract_obj( obj );
      return;
                
    }
    
    if ( IS_AFFECTED(ch, AFF_POLYMORPH) )
    {
	send_to_char( "Not while polymorphed.\n\r", ch );
	return;
    }
    act("$n transforms into $p and falls to the ground.",ch,obj,NULL,TO_ROOM);
    act("You transform into $p and fall to the ground.",ch,obj,NULL,TO_CHAR);
    ch->pcdata->obj_vnum = ch->pcdata->powers[VPOWER_OBJ_VNUM];
    obj->chobj = ch;
    ch->pcdata->chobj = obj;
    SET_BIT(ch->affected_by, AFF_POLYMORPH);
    SET_BIT(ch->extra, EXTRA_OSWITCH);
    SET_BIT(ch->extra, EXTRA_AXE);
    free_string(ch->morph);
    ch->morph = str_dup("An axe of khrone");
    obj_to_room(obj,ch->in_room);
    return;
}
*/

void do_steed (CHAR_DATA * ch, char *argument)
{

   char buf[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   AFFECT_DATA af;
   if (IS_NPC (ch))
      return;
   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_SET (ch->warp, WARP_STEED))
   {

      stc ("You need the warp steed to use this power.\n\r", ch);
      return;
   }



/*
    if !IS_SET(ch->warp, WARP_STEED))
    {
    send_to_char("You require warp steed to use this command.\n\r",ch);
    return;
    }
 */
   if (ch->pcdata->followers > 5)
   {
      send_to_char ("Nothing happens.\n\r", ch);
      return;
   }
   ch->pcdata->followers++;

   victim = create_mobile (get_mob_index (MOB_VNUM_STEED));
   victim->level = 200;
   victim->hit = 5000;
   victim->max_hit = 5000;
   victim->hitroll = 50;
   victim->damroll = 50;
   victim->armor = 300;
   SET_BIT (victim->act, ACT_NOEXP);

   strcpy (buf, "Rise creature of darkness bow before me!");
   do_say (ch, buf);

   send_to_char
      ("A huge demon bursts from the ground and bows before you.\n\r", ch);
   act ("$N bursts from the ground and bows before $n.", ch, NULL, victim,
	TO_ROOM);

   char_to_room (victim, ch->in_room);


   add_follower (victim, ch);
   af.duration = 666;
   af.location = APPLY_NONE;
   af.modifier = 0;
   af.bitvector = AFF_CHARM;
   affect_to_char (victim, &af);
   return;

}

/* Disgustingly laid out code.. think ill tidy to make it more
 * readable
 * Mac 3/12/99 */

void do_breath (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char buf[MAX_STRING_LENGTH];
   int dam = 0;

   if (IS_NPC (ch))
      return;
   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (IS_CLASS (ch, CLASS_DEMON) && !IS_SET (ch->warp, WARP_BADBREATH))
   {
      send_to_char ("You need bad breath warp to use this.\n\r", ch);
      return;
   }

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

   if (!IS_NPC (victim))
   {
      dam = ch->spl[RED_MAGIC] * 15;
   }
   else if (IS_NPC (victim))
   {
      dam = ch->spl[RED_MAGIC] * 20;
   }
   if (is_safe (ch, victim) == TRUE)
      return;

   WAIT_STATE (ch, 25);

   dam += number_range (1, 30);

   if IS_EVIL
      (victim) dam = dam / 4;

   if IS_NEUTRAL
      (victim) dam = dam / 2;
   if (dam <= 0)
      dam = 1;

   sprintf (buf,
	    "Your blast of putrid breath hits $N incredibly hard! [%d]\n\r",
	    dam);
   act (buf, ch, NULL, victim, TO_CHAR);
   sprintf (buf,
	    "$n's blast of putrid breath hits you incredibly hard! [%d]\n\r",
	    dam);
   act (buf, ch, NULL, victim, TO_VICT);
   sprintf (buf,
	    "$n's blast of putrid breath hits $N incredibly hard! [%d]\n\r",
	    dam);
   act (buf, ch, NULL, victim, TO_NOTVICT);

   send_to_char ("\n\r", ch);

   if (!IS_NPC (victim) || IS_EVIL (victim))
      victim->hit -= dam / 4;
   else
      victim->hit -= dam;
   victim->hit -= dam;
   return;
}
void do_bodyspikes (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_NDEMPOWER (ch, DEM_BODYSPIKES))
   {
      send_to_char ("You haven't been granted the gift of Bodyspikes.\n\r",
		    ch);
      return;
   }

   if (IS_DEMAFF (ch, DEM_BODYSPIKES))
   {
      send_to_char ("Your bodyspikes slowly retracts under your skin.\n\r",
		    ch);
      act ("The razor sharp spikes slowly retracts under $n's skin..", ch,
	   NULL, NULL, TO_ROOM);
      REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_BODYSPIKES);
      return;
   }
   send_to_char
      ("Razor sharp spikes slowly push their way up through your skin.\n\r",
       ch);
   act ("Razor sharp spikes slowly push their way out of $n's skin.", ch,
	NULL, NULL, TO_ROOM);
   SET_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_BODYSPIKES);
   return;

}

/*moved*/
void do_flamehooves (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      send_to_char ("Huh?\n\r", ch);
      return;
   }
   if (!IS_SET (ch->pcdata->powers[DPOWER_FLAGS2], DEM_FLAMEHOOVES))
   {
      send_to_char
	 ("You haven't been granted the gift of Flaming hooves.\n\r", ch);
      return;
   }
   if (!IS_DEMAFF (ch, DEM_HOOVES))
   {
      send_to_char ("Your feet aren't hooves, yet.\n\r", ch);
      return;
   }
   if (IS_DEMAFF (ch, DEM_FLAMEHOOVES))
   {
      send_to_char ("The flames around your hooves are extinguished.\n\r",
		    ch);
      act ("The flames around $n's hooves die away.", ch, NULL, NULL,
	   TO_ROOM);
      REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_FLAMEHOOVES);
      return;
   }
   send_to_char ("Your hooves erupt into hellish flames.\n\r", ch);
   act ("$n's hooves erupts into hellish flames..", ch, NULL, NULL, TO_ROOM);
   SET_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_FLAMEHOOVES);
   return;
}
void do_hooves (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }
   if (!IS_DEMPOWER (ch, DEM_HOOVES))
   {
      send_to_char ("You haven't been granted the gift of horns.\n\r", ch);
      return;
   }

   if (IS_DEMAFF (ch, DEM_HOOVES))
   {
      send_to_char ("Your hooves transform into feet.\n\r", ch);
      act ("$n's hooves transform back into $s feet.", ch, NULL, NULL,
	   TO_ROOM);
      REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_HOOVES);
      return;
   }
   send_to_char ("Your feet transform into hooves.\n\r", ch);
   act ("$n's feet transform into hooves.", ch, NULL, NULL, TO_ROOM);
   SET_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_HOOVES);
   return;
}

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

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON) && !IS_SET (ch->special, SPC_CHAMPION)
       && !IS_CLASS (ch, CLASS_DRAGON))
   {
      do_rand_typo (ch);
      return;
   }
   if (IS_CLASS (ch, CLASS_DRAGON)
       && !IS_SET (ch->pcdata->dragonaff, DRA_WINGS))
   {
      send_to_char ("You don't have your wings yet.\n\r", ch);
      return;
   }
   if (IS_CLASS (ch, CLASS_DEMON) && !IS_DEMPOWER (ch, DEM_WINGS))
   {
      send_to_char ("You haven't been granted the gift of wings.\n\r", ch);
      return;
   }

   if (arg[0] != '\0')
   {
      if (!IS_DEMAFF (ch, DEM_WINGS))
      {
	 send_to_char ("First you better get your wings out!\n\r", ch);
	 return;
      }
      if (!str_cmp (arg, "unfold") || !str_cmp (arg, "u"))
      {
	 if (IS_DEMAFF (ch, DEM_UNFOLDED))
	 {
	    send_to_char ("But your wings are already unfolded!\n\r", ch);
	    return;
	 }
	 send_to_char ("Your wings unfold from behind your back.\n\r", ch);
	 act ("$n's wings unfold from behind $s back.", ch, NULL, NULL,
	      TO_ROOM);
	 SET_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_UNFOLDED);
	 return;
      }
      else if (!str_cmp (arg, "fold") || !str_cmp (arg, "f"))
      {
	 if (!IS_DEMAFF (ch, DEM_UNFOLDED))
	 {
	    send_to_char ("But your wings are already folded!\n\r", ch);
	    return;
	 }
	 send_to_char ("Your wings fold up behind your back.\n\r", ch);
	 act ("$n's wings fold up behind $s back.", ch, NULL, NULL, TO_ROOM);
	 REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_UNFOLDED);
	 return;
      }
      else
      {
	 send_to_char ("Do you want to FOLD or UNFOLD your wings?\n\r", ch);
	 return;
      }
   }

   if (IS_DEMAFF (ch, DEM_WINGS))
   {
      if (IS_DEMAFF (ch, DEM_UNFOLDED))
      {
	 send_to_char ("Your wings fold up behind your back.\n\r", ch);
	 act ("$n's wings fold up behind $s back.", ch, NULL, NULL, TO_ROOM);
	 REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_UNFOLDED);
      }
      send_to_char ("Your wings slide into your back.\n\r", ch);
      act ("$n's wings slide into $s back.", ch, NULL, NULL, TO_ROOM);
      REMOVE_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_WINGS);
      return;
   }
   send_to_char ("Your wings extend from your back.\n\r", ch);
   act ("A pair of wings extend from $n's back.", ch, NULL, NULL, TO_ROOM);
   SET_BIT (ch->pcdata->powers[DPOWER_CURRENT], DEM_WINGS);
   return;
}

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

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON) && !IS_SET (ch->special, SPC_CHAMPION))
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_DEMPOWER (ch, DEM_LIFESPAN))
   {
      send_to_char ("You haven't been granted the gift of lifespan.\n\r", ch);
      return;
   }

   if ((obj = ch->pcdata->chobj) == NULL)
   {
      do_rand_typo (ch);
      return;
   }

   if (obj->chobj == NULL || obj->chobj != ch)
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_HEAD (ch, LOST_HEAD))
   {
      send_to_char ("You cannot change your lifespan in this form.\n\r", ch);
      return;
   }

   if (!str_cmp (arg, "l") || !str_cmp (arg, "long"))
      obj->timer = 0;
   else if (!str_cmp (arg, "s") || !str_cmp (arg, "short"))
      obj->timer = 1;
   else
   {
      send_to_char ("Do you wish to have a long or short lifespan?\n\r", ch);
      return;
   }
   send_to_char ("Ok.\n\r", ch);

   return;
}

void do_pact (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   bool can_sire = FALSE;

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON) && !IS_SET (ch->special, SPC_CHAMPION))
   {
      do_rand_typo (ch);
      return;
   }



   if (IS_SET (ch->special, SPC_DEMON_LORD))
      can_sire = TRUE;
   else if (IS_SET (ch->special, SPC_SIRE))
      can_sire = TRUE;
   else if (IS_SET (ch->special, SPC_PRINCE))
      can_sire = TRUE;
   else
      can_sire = FALSE;

/*
    if ( strlen( ch->clan ) < 3  || IS_SET(ch->special, SPC_ANARCH) )
    {
	stc("You have no Clan therefore you are unable to make a pact.\n\r", ch);
	return;
    }
*/
   if (!can_sire)
   {
      send_to_char ("You are not able to make a pact.\n\r", ch);
      return;
   }

   if (arg[0] == '\0')
   {
      send_to_char ("Make a pact with 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 ("Not on NPC's.\n\r", ch);
      return;
   }

   if (ch == victim)
   {
      send_to_char ("You cannot make a pact with yourself.\n\r", ch);
      return;
   }

/*
    if (IS_CLASS(victim, CLASS_DEMON))
    {
        victim->clan = str_dup(ch->clan);
	stc("You induct them into your clan.\n",ch);
	act("$n inducts you into $s clan.",ch,NULL,victim,TO_VICT);
        return;
    }
*/
   if (victim->class != 0)
   {
      send_to_char ("Not on them!\n\r", ch);
      return;
   }

   if (victim->max_hit < 3000)
   {
      stc ("You need 3000hps before you can be classed\n\r", victim);
      stc ("They need 3000hps before they can be classed\n\r", ch);
      return;
   }
   if (victim->level != LEVEL_AVATAR && !IS_IMMORTAL (victim))
   {
      send_to_char ("You can only make pacts with avatars.\n\r", ch);
      return;
   }

   if (!IS_IMMUNE (victim, IMM_DEMON))
   {
      send_to_char ("You cannot make a pact with an unwilling person.\n\r",
		    ch);
      return;
   }

   if (ch->exp < 666)
   {
      send_to_char ("You cannot afford the 666 exp to make a pact.\n\r", ch);
      return;
   }

   if (!IS_EVIL (victim))
   {
      send_to_char ("They must be evil!\n\r", ch);
      return;
   }

   ch->exp = ch->exp - 666;
   act ("You make $N a demonic champion!", ch, NULL, victim, TO_CHAR);
   act ("$n makes $N a demonic champion!", ch, NULL, victim, TO_NOTVICT);
   act ("$n makes you a demonic champion!", ch, NULL, victim, TO_VICT);
   victim->class = CLASS_DEMON;
   SET_BIT (victim->special, SPC_CHAMPION);

   if (IS_CLASS (victim, CLASS_VAMPIRE))
      do_mortalvamp (victim, "");
   REMOVE_BIT (victim->act, PLR_HOLYLIGHT);
   REMOVE_BIT (victim->act, PLR_WIZINVIS);
   victim->pcdata->stats[UNI_RAGE] = 0;
//    free_string(victim->clan);
//    victim->clan = str_dup(ch->clan);
   free_string (victim->morph);

   save_char_obj (ch);
   save_char_obj (victim);
   return;
}

void do_offersoul (CHAR_DATA * ch, char *argument)
{
   char arg[MAX_INPUT_LENGTH];
   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;

   if (!IS_IMMUNE (ch, IMM_DEMON))
   {
/*
	send_to_char("That would be a very bad idea...\n\r",ch);
	return;
*/
      send_to_char ("You will now allow demons to buy your soul.\n\r", ch);
      SET_BIT (ch->immune, IMM_DEMON);
      return;

   }
   send_to_char ("You will no longer allow demons to buy your soul.\n\r", ch);
   REMOVE_BIT (ch->immune, IMM_DEMON);
   return;
}

void do_weaponform (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj;
   if (IS_NPC (ch))
      return;
   if (!IS_CLASS (ch, CLASS_DEMON) && !IS_SET (ch->special, SPC_CHAMPION))
   {
      do_rand_typo (ch);
      return;
   }
   else if (IS_AFFECTED (ch, AFF_POLYMORPH))
   {
      send_to_char ("You cannot do this while polymorphed.\n\r", ch);
      return;
   }
   if (ch->in_room->area->owned > 0
       && ch->in_room->area->owned != ch->pcdata->kingdom)
   {
      stc ("Not in someone elses HQ\n\r", ch);
      return;
   }
   if (ch->in_room->vnum == ROOM_VNUM_ALTAR)
   {
      stc ("Not in this room sorry!\n\r", ch);
      return;
   }
   if (IS_SET (ch->flag2, AFF2_INARENA))
   {
      stc ("Not while in the arena.\n\r", ch);
      return;
   }
   if (ch->fight_timer > 0)
   {
      stc ("Not with a fight timer.\n\r", ch);
      return;
   }
   if (IS_SET (ch->war, WARRING))
   {
      stc ("Not while in a war!\n\r", ch);
      return;
   }

   if (IS_SET (ch->warp, WARP_WEAPON))
      ch->pcdata->powers[DPOWER_OBJ_VNUM] = OBJ_VNUM_KHORNE;

   if (ch->pcdata->powers[DPOWER_OBJ_VNUM] < 1)
   {
      send_to_char ("You don't have the ability to change into a weapon.\n\r",
		    ch);
      return;
   }
   if ((obj =
	create_object (get_obj_index (ch->pcdata->powers[DPOWER_OBJ_VNUM]),
		       60)) == NULL)
   {
      send_to_char ("You don't have the ability to change into a weapon.\n\r",
		    ch);
      return;
   }
   if (IS_AFFECTED (ch, AFF_WEBBED))
   {
      send_to_char ("Not with all this sticky webbing on.\n\r", ch);
      return;
   }
   obj_to_room (obj, ch->in_room);
   act ("$n transforms into $p and falls to the ground.", ch, obj, NULL,
	TO_ROOM);
   act ("You transform into $p and fall to the ground.", ch, obj, NULL,
	TO_CHAR);
   ch->pcdata->obj_vnum = ch->pcdata->powers[DPOWER_OBJ_VNUM];
   obj->chobj = ch;
   ch->pcdata->chobj = obj;
   ch->stimer = 60;
   SET_BIT (ch->affected_by, AFF_POLYMORPH);
   SET_BIT (ch->extra, EXTRA_OSWITCH);
   free_string (ch->morph);
   ch->morph = str_dup (obj->short_descr);
   return;
}

void do_humanform (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj;

   if (IS_NPC (ch))
      return;
   if ((obj = ch->pcdata->chobj) == NULL)
   {
      send_to_char ("You are already in human form.\n\r", ch);
      return;
   }

   ch->pcdata->obj_vnum = 0;
   obj->chobj = NULL;
   ch->pcdata->chobj = NULL;
   REMOVE_BIT (ch->affected_by, AFF_POLYMORPH);
   REMOVE_BIT (ch->extra, EXTRA_OSWITCH);
   free_string (ch->morph);
   ch->morph = str_dup ("");
   act ("$p transforms into $n.", ch, obj, NULL, TO_ROOM);
   act ("You reform your human body.", ch, obj, NULL, TO_CHAR);
   extract_obj (obj);
   if (ch->in_room->vnum == ROOM_VNUM_IN_OBJECT)
   {
      char_from_room (ch);
      char_to_room (ch, get_room_index (ROOM_VNUM_HELL));
   }
   return;
}

void do_champions (CHAR_DATA * ch, char *argument)
{
   char buf[MAX_STRING_LENGTH];
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *gch;
   char clan[MSL];
   one_argument (argument, arg);

   if (IS_NPC (ch))
      return;
   if (!IS_CLASS (ch, CLASS_DEMON) && !IS_SET (ch->special, SPC_CHAMPION))
   {
      do_rand_typo (ch);
      return;
   }
   sprintf (buf, "The Demonic Hoarde:\n\r");
   send_to_char (buf, ch);
   send_to_char
      ("[      Name      ] [     Clan     ] [ Hits ] [ Mana ] [ Move ] [   Exp    ] [       Power        ]\n\r",
       ch);

   for (gch = char_list; gch != NULL; gch = gch->next)
   {
      if (IS_NPC (gch))
	 continue;
      if (gch->clannum > 0)
          sprintf(clan, "%s", nclans_table[gch->clannum].name);
      else
          sprintf(clan, "Rogue");
      if (!IS_CLASS (gch, CLASS_DEMON)
	  && !IS_SET (gch->special, SPC_CHAMPION))
	 continue;
      if (IS_IMMORTAL (gch) && !can_see (ch, gch))
	 continue;
      sprintf (buf,
               "[%-16s] [%-13s] [%-6d] [%-6d] [%-6d] [%10lli] [ %-9d%9d ]\n\r",
	       capitalize (gch->name),clan,
	       gch->hit, gch->mana, gch->move,
	       gch->exp, gch->pcdata->stats[DEMON_CURRENT],
	       gch->pcdata->stats[DEMON_TOTAL]);
      send_to_char (buf, ch);
   }
   return;
}


void do_eyespy (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   CHAR_DATA *familiar;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      stc ("Huh?\n\r", ch);
      return;
   }
/*    if (!IS_DEMPOWER( ch, DEM_EYESPY))
    {
        send_to_char("You haven't been granted the gift of eyespy.\n\r",ch);
        return;
    }
*/
   if (IS_HEAD (ch, LOST_EYE_L) && IS_HEAD (ch, LOST_EYE_R))
   {
      send_to_char ("But you don't have any more eyes to pluck out!\n\r", ch);
      return;
   }

   if (!IS_HEAD (ch, LOST_EYE_L) && number_range (1, 2) == 1)
   {
      act ("You pluck out your left eyeball and throw it to the ground.", ch,
	   NULL, NULL, TO_CHAR);
      act ("$n plucks out $s left eyeball and throws it to the ground.", ch,
	   NULL, NULL, TO_ROOM);
   }
   else if (!IS_HEAD (ch, LOST_EYE_R))
   {
      act ("You pluck out your right eyeball and throw it to the ground.", ch,
	   NULL, NULL, TO_CHAR);
      act ("$n plucks out $s right eyeball and throws it to the ground.", ch,
	   NULL, NULL, TO_ROOM);
   }
   else
   {
      act ("You pluck out your left eyeball and throw it to the ground.", ch,
	   NULL, NULL, TO_CHAR);
      act ("$n plucks out $s left eyeball and throws it to the ground.", ch,
	   NULL, NULL, TO_ROOM);
   }
   if ((familiar = ch->pcdata->familiar) != NULL)
   {
      make_part (ch, "eyeball");
      return;
   }

   victim = create_mobile (get_mob_index (MOB_VNUM_EYE));
   if (victim == NULL)
   {
      send_to_char ("Error - please inform KaVir.\n\r", ch);
      return;
   }

   char_to_room (victim, ch->in_room);

   ch->pcdata->familiar = victim;
   victim->wizard = ch;
   return;
}


/*
void do_gifts( CHAR_DATA *ch, char *argument )
{
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    int improve;
    int cost;
    int max;

    argument = one_argument( argument, arg1 );
    argument = one_argument( argument, arg2 );

    if (IS_NPC(ch)) return;

    if (!IS_CLASS(ch, CLASS_DEMON))
    {
        do_rand_typo(ch);
	return;
    }

    if (arg1[0] == '\0' && arg2[0] == '\0')
    {
	sprintf(buf,"Gifts: Strength of Satan, Speed of Satan, Stake, Cone of fire, True Form\n\r");
	send_to_char(buf,ch);
	return;
    }
    if (arg2[0] == '\0')
    {
	if (!str_cmp(arg1,"Strength"))
	{
	    send_to_char("Strength of Satan: You are as strong as your creator.\n\r",ch);
	    return;
	}
	else if (!str_cmp(arg1,"Speed"))
	{
	    send_to_char("Speed: The Speed of satan you dodge most attacks wth incredible speed.\n\r",ch);
	    return;
	}
	else if (!str_cmp(arg1,"Stake"))
	{
	    send_to_char("Stake: You have the ability to make a silver stake.\n\r",ch);
	    return;
	}
	else if (!str_cmp(arg1,"Cone"))
	{
	    send_to_char("Cone: You have the power to breath a cone fo fire.\n\r",ch);
	    return;
	}
	else if (!str_cmp(arg1,"Form"))
	{
	    send_to_char("Form: The power to go into true demon form.\n\r",ch);
	    return;
	}
	
	sprintf(buf,"Gifts: Strength of Satan, Speed of Satan, Stake, Cone of fire, True Form\n\r");
        send_to_char(buf,ch);
	return;
    }
    if (!str_cmp(arg2,"improve"))
    {
	     if (!str_cmp(arg1,"strength"   )) {improve = DEM_STRENGTH;max=1;}
	else if (!str_cmp(arg1,"speed"   )) {improve = DEM_SPEEDY;max=1;}
	else if (!str_cmp(arg1,"stake"   )) {improve = DEM_STAKE;max=1;}
	else if (!str_cmp(arg1,"cone"    )) {improve = DEM_CONE;max=1;}
	else if (!str_cmp(arg1,"form" )) {improve = DEM_FORM;max=1;}
	else
	{
	    send_to_char("You can improve: Strength Speed Stake Cone Form\n\r",ch);
	    return;
	}
	cost = (ch->pcdata->powers[improve]+1) * 50;
	arg1[0] = UPPER(arg1[0]);
	if ( ch->pcdata->powers[improve] >= max )
	{
	    sprintf(buf,"You have already gained this gift.\n\r");
	    send_to_char(buf,ch);
	    return;
	}
	if ( cost > ch->practice )
	{
	    sprintf(buf,"It costs you %d primal to improve your gifts.\n\r", cost);
	    send_to_char(buf,ch);
	    return;
	}
       ch->pcdata->powers[improve] += 1;
       ch->practice -= cost;
       sprintf(buf,"You improve your gifts.\n\r");
       send_to_char(buf,ch);
      }
}
*/

void do_cone (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char arg[MAX_INPUT_LENGTH];
   int sn;
   int level;
   int spelltype;

   argument = one_argument (argument, arg);
   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

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

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

   if ((sn = skill_lookup ("cone")) < 0)
      return;
   spelltype = skill_table[sn].target;
   level = ch->spl[spelltype] * 1.0;
   level = level * 1.0;
   act ("You Blast $N with a cone of fire.", ch, NULL, victim, TO_CHAR);
   act ("$n Blasts you with a cone of fire.", ch, NULL, victim, TO_VICT);
   (*skill_table[sn].spell_fun) (sn, level, ch, victim);
   WAIT_STATE (ch, 10);
   ch->mana = ch->mana - 100;
   return;
}

void do_dstake (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj;

   if (IS_NPC (ch))
      return;

   if (!IS_CLASS (ch, CLASS_DEMON))
   {

      do_rand_typo (ch);
      return;
   }

   if (60 > ch->practice)
   {
      send_to_char ("It costs 60 points of primal to create a stake.\n\r",
		    ch);
      return;
   }
   ch->practice -= 60;
   obj = create_object (get_obj_index (OBJ_VNUM_STAKE), 0);
   if (IS_SET (obj->quest, QUEST_ARTIFACT))
      REMOVE_BIT (obj->quest, QUEST_ARTIFACT);
   obj_to_char (obj, ch);
   act ("A Stake appears in your hands in a flash of light.", ch, NULL, NULL,
	TO_CHAR);
   act ("A Stake appears in $n's hands in a flash of light.", ch, NULL, NULL,
	TO_ROOM);
   return;
}


void frost_breath args ((CHAR_DATA * ch, CHAR_DATA * victim, bool all));
DECLARE_DO_FUN (do_stance);

DO_COM (do_grab)
{
   CHAR_DATA *victim;
   CHAR_DATA *rch;
   char arg[MAX_INPUT_LENGTH];

   argument = one_argument (argument, arg);

   if (IS_NPC (ch))
      return;
   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      stc ("Huh?\n\r", ch);
      return;
   }
   if (!IS_DEMPOWER (ch, DEM_GRAB))
   {
      stc ("You have not been granted that power.\n\r", ch);
      return;
   }


   if (arg[0] == '\0')
   {
      if (IS_AFFECTED (ch, AFF_SHADOWPLANE))
	 send_to_char ("Grab who into the umbra?\n\r", ch);
      else
	 send_to_char ("Grab who out of the umbra?\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_AFFECTED (ch, AFF_SHADOWPLANE)
       && IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      send_to_char ("They are already in the umbra.\n\r", ch);
      return;
   }
   else if (!IS_AFFECTED (ch, AFF_SHADOWPLANE)
	    && !IS_AFFECTED (victim, AFF_SHADOWPLANE))
   {
      send_to_char ("They are already in the real world.\n\r", ch);
      return;
   }
   if (victim->fighting != NULL && victim->in_room != NULL)
   {
      stop_fighting (victim, TRUE);
      for (rch = victim->in_room->people; rch != NULL;
	   rch = rch->next_in_room)
      {
	 if (rch->fighting == victim)
	    stop_fighting (rch, TRUE);
      }
   }

   if (IS_AFFECTED (ch, AFF_SHADOWPLANE))
   {
      act ("You grab hold of $N, and pull $M into the umbra.", ch, NULL,
	   victim, TO_CHAR);
      act ("$n grabs hold of you, and pulls you into the umbra.", ch, NULL,
	   victim, TO_VICT);
      act ("$N vanishes from sight.", ch, NULL, victim, TO_NOTVICT);
      SET_BIT (victim->affected_by, AFF_SHADOWPLANE);
      return;
   }
   else
   {
      act ("You grab hold of $N, and pull $M into the real world.", ch, NULL,
	   victim, TO_CHAR);
      act ("$n grabs hold of you, and pulls you into the real world.", ch,
	   NULL, victim, TO_VICT);
      act ("$N fades back into existance.", ch, NULL, victim, TO_NOTVICT);
      REMOVE_BIT (victim->affected_by, AFF_SHADOWPLANE);
      return;
   }
   return;
}

void do_dgate (CHAR_DATA * ch, char *argument)
{
   char arg1[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;

   argument = one_argument (argument, arg1);

   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      stc ("Huh?\n\r", ch);
      return;
   }
   if (!IS_DEMPOWER (ch, DEM_GATE))
   {
      stc ("You have not been granted that power.\n\r", ch);
      return;
   }
   if (IS_SET (ch->flag2, AFF2_INARENA))
   {
      stc ("Not while in the arena.\n\r", ch);
      return;
   }
   if (arg1[0] == '\0')
   {
      send_to_char ("Gate whom?\n\r", ch);
      return;
   }
   if (ch->fight_timer > 0)
   {
      send_to_char ("Not until your fight timer expires.\n\r", ch);
      return;
   }



   if ((ch->move < 500))
   {
      stc ("You need atleast 500 movement to demongate.\n\r", ch);
      return;
   }

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

   if (victim == ch
       || (IS_NPC (victim) && victim->level > 150)
       || (!IS_NPC (victim) && !IS_IMMUNE (victim, IMM_SUMMON))
       || victim->in_room == NULL
       || IS_SET (victim->in_room->room_flags, ROOM_GOD)
       || victim->in_room == ch->in_room)
   {
      send_to_char ("You failed.\n\r", ch);
      return;
   }
//here

   if IS_SET
      (victim->in_room->room_flags, ROOM_CCHAMBER)
   {
      stc ("You failed.\n\r", ch);
      return;
   }
   if (IS_NPC (victim) && IS_SET (victim->in_room->area->aflags, AFLAG_HQ))
   {
      stc ("You failed.\n\r", ch);
      return;
   }
   if (victim->in_room == NULL)
   {
      send_to_char ("They are in limbo.\n\r", ch);
      return;
   }
   if (!IS_NPC (victim) && !IS_IMMUNE (victim, IMM_SUMMON))
   {
      send_to_char ("Your powers seem to have failed you.\n\r", ch);
      return;
   }

   if (IS_SET (victim->in_room->room_flags, ROOM_PRIVATE))
   {
      stc ("You failed.\n\r", ch);
      return;
   }
   if (victim->fighting != NULL)
      stop_fighting (victim, TRUE);
   char_from_room (ch);
   char_to_room (ch, victim->in_room);
   act ("You step though a demonic gate.\n\rYou leap out of the demonic gate before $N.", ch, NULL, victim, TO_CHAR);
   act ("$n leaps out of a glowing demonic gate.", ch, NULL, victim,
	TO_NOTVICT);
   act ("$n leaps out of a glowing demonic gate.", ch, NULL, victim, TO_VICT);
   ch->move -= 500;
   do_look (ch, "auto");
}

void do_immolate (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj;


   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_DEMPOWER (ch, DEM_IMMOLATE))
   {
      stc ("You have not been granted that power.\n\r", ch);
      return;
   }

   if (argument[0] == '\0')
   {
      send_to_char ("Which item do you wish to immolate?\n\r", ch);
      return;
   }

   if ((obj = get_obj_carry (ch, argument)) == NULL)
   {
      send_to_char ("You are not carrying that item.\n\r", ch);
      return;
   }

   if (obj->item_type != ITEM_WEAPON)
   {
      send_to_char ("That is not a weapon!\n\r", ch);
      return;
   }

   if (dice (1, 100) == 1)
   {
      act ("$p explodes in a burst of flames.", ch, obj, NULL, TO_ROOM);
      act ("$p explodes in a burst of flames.", ch, obj, NULL, TO_CHAR);
      damage (ch, ch, 500, gsn_inferno);
      extract_obj (obj);
      return;
   }

   if (IS_WEAP (obj, WEAPON_FLAMING))
   {
      act ("$p is already flaming.", ch, obj, NULL, TO_CHAR);
      return;
   }

   act ("$p bursts into flames.", ch, obj, NULL, TO_CHAR);
   act ("$p, carried by $n bursts into flames.", ch, obj, NULL, TO_ROOM);

   WAIT_STATE (ch, 8);
   SET_BIT (obj->weapflags, WEAPON_FLAMING);
}


void do_leech (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;
   char buf[MAX_STRING_LENGTH];


   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_DEMPOWER (ch, DEM_LEECH))
   {

      stc ("You do not have that power.\n\r", ch);
      return;
   }

   if (argument[0] == '\0')
   {
      stc ("Who's life do you wish to leech off of?\n\r", ch);
      return;
   }

   if ((victim = get_char_room (ch, argument)) == NULL)
   {
      stc ("They aren't here.\n\r", ch);
      return;
   }
   if (ch == victim)
   {
	stc("Not on yourself!\n\r", ch);
        return;
   }
   if (is_safe (ch, victim))
      return;

   WAIT_STATE (ch, 10);

   act ("$n stares intently at $N.", ch, NULL, victim, TO_NOTVICT);
   act ("You stare intently at $N.", ch, NULL, victim, TO_CHAR);
   act ("$n stares intently at you.", ch, NULL, victim, TO_VICT);

   if (victim->hit >= 1000)
   {
      sh_int power;
      sh_int dam;
      power = 150;
      dam = dice (power, power + 2);
      //power = number_range(300,550);
      //dam = dice(power / 5, power);
      if (dam > 500)
	 dam = 500 + (dam / 10);
     // victim->hit -= dam;
     hurt_person(ch,victim,dam);

      ch->hit += dam;
      if (ch->hit >= ch->max_hit + 500)
	 ch->hit = ch->max_hit + 500;
      sprintf (buf, "You absorb %d hitpoints.\n\r", dam);
      stc (buf, ch);
      sprintf (buf, "%s absorbed %d of your hitpoints!\n\r", ch->name, dam);
      stc (buf, victim);
  if (ch->fighting == NULL)
      set_fighting (ch, victim);
   }
   else
      stc ("Nothing seemed to happen.\n\r", ch);
   return;

}

void do_unnerve (CHAR_DATA * ch, char *argument)
{
   CHAR_DATA *victim;


   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_DEMPOWER (ch, DEM_UNNERVE))
   {
      stc ("You have not been granted that power.\n\r", ch);
      return;
   }

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

   if ((victim = get_char_room (ch, argument)) == NULL)
   {
      stc ("They aren't here.\n\r", ch);
      return;
   }
   if (is_safe (ch, victim))
   {
      stc ("I dont think so do you??\n\r", ch);
      return;
   }
   if (IS_IMMORTAL (victim) || IS_NPC (victim))
   {
      send_to_char
	 ("They have nerves of steel, you are unable to unnerve them!\n\r",
	  ch);
      return;
   }
   WAIT_STATE (ch, 14);
   WAIT_STATE (victim, 14);
   do_say (ch, "Xeus Dominus Mortai!");
   do_stance (victim, "");
}

void do_wfreeze (CHAR_DATA * ch, char *argument)
{
   OBJ_DATA *obj;


   if (!IS_CLASS (ch, CLASS_DEMON))
   {
      do_rand_typo (ch);
      return;
   }

   if (!IS_DEMPOWER (ch, DEM_FREEZEWEAPON))
   {
      stc ("You have not been granted that power.\n\r", ch);
      return;
   }

   if (argument[0] == '\0')
   {
      send_to_char ("Which item do you wish to freeze?\n\r", ch);
      return;
   }

   if ((obj = get_obj_carry (ch, argument)) == NULL)
   {
      send_to_char ("You are not carrying that item.\n\r", ch);
      return;
   }

   if (obj->item_type != ITEM_WEAPON)
   {
      send_to_char ("That is not a weapon!\n\r", ch);
      return;
   }

   if (dice (1, 100) == 1)
   {
      act ("$p freezes and shatters.", ch, obj, NULL, TO_ROOM);
      act ("$p freezes and shatters.", ch, obj, NULL, TO_CHAR);
      extract_obj (obj);
      ret

Showing the first 100 KB of 111.3 KB. Download the archive for the full file.

Site Stats

Snippets: 1791
Codebases: 571