djinn.c

demise/src/djinn.c · 61.5 KB

From the archive dodbackup-final.tar.gz

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 improvements copyright (C) 1994, 1995, 1996 by Richard    *
 *  Woolcock.  This mud is NOT to be copied in whole or in part, or to be  *
 *  run without the permission of Richard Woolcock.  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"

void
do_djinnpowers (CHAR_DATA * ch, char *argument)
{
  int pwr = 0;

  if (IS_NPC (ch))
    return;

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

  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SIGHT))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DJINNFORM))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_ILLUSIONMIST))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HIDDEN))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_READAURA))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DARKSOUL))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CLAWS))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SNEAK))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_FIRE))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_PARALYZE))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_ILLUSIONOBJECT))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DREAMWALK))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CRADLING))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DREAMSTAIN))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_REGEN))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SPEED))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_TOUGHNESS))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_WEAPON))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CURSE))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HURRICANE))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_LAMP))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_MIGHT))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_WIND))
    pwr++;
  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SONIC))
    pwr++;



  send_to_char
    ("#P-------------------------------------------------------------------\n\r",
     ch);
  send_to_char
    ("                           #0#Y#o#Y#R Djinn Powers #o#Y#0#Y#n\n\r", ch);
  send_to_char
    ("#P-------------------------------------------------------------------\n\r",
     ch);
  if (pwr > 0)
    {
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SIGHT))
	send_to_char
	  ("#cScry         #0- #CSee with sight beyond sight.\n\r#cHeighten     #0- #CSight stronger than normal.\n\r#cNightsight   #0- #CSee in the dark.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DJINNFORM))
	send_to_char
	  ("#cDjinnform    #0- #CTake the shape of the real scaring Djinn.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_ILLUSIONMIST))
	send_to_char
	  ("#cIllusionmist #0- #CBlow a mist to scare and confuse victims.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HIDDEN))
	send_to_char
	  ("#cHidden       #0- #CDon't be seen, or leave tracks, be hidden.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_READAURA))
	send_to_char
	  ("#cSenseaura    #0- #CSense victims auras, telling their strength.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DARKSOUL))
	send_to_char
	  ("#cDarksoul     #0- #CMirror your dark soul and put the room in darkness.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CLAWS))
	send_to_char
	  ("#cDjinnclaws   #0- #CGrow your strong, poisonous djinnclaws.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SNEAK))
	send_to_char
	  ("#cDjinnsneak   #0- #CDo not be heard when walking.\n\r", ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_FIRE))
	send_to_char
	  ("#cDjinnfire    #0- #CThrow away strong and damageing flames.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_PARALYZE))
	send_to_char
	  ("#cParalyze     #0- #CParalyze targets, making them unable to move.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_ILLUSIONOBJECT))
	send_to_char
	  ("#cIllusionate  #0- #CIllusionate objects descriptions and names.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DREAMWALK))
	send_to_char
	  ("#cDreamwalk    #0- #CGet to a target through their specific dreams.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DREAMSTAIN))
	send_to_char
	  ("#cDreamstain   #0- #CExtra attack, staining them with twisted minds.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CRADLING))
	send_to_char ("#cCradling     #0- #CPuts victims to sleep.\n\r", ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SPEED))
	send_to_char ("#cSpeed        #0- #CDjinn speed (auto).\n\r", ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_TOUGHNESS))
	send_to_char ("#cToughness    #0- #CDjinn toughness (auto).\n\r", ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_REGEN))
	send_to_char
	  ("#cRegenerate   #0- #CYou regenerate your wounds (auto).\n\r", ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_WEAPON))
	send_to_char ("#cWeaponforge  #0- #CForge your scimitars.\n\r", ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CURSE))
	send_to_char ("#cDcurse       #0- #CCurse of the Djinn.\n\r", ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HURRICANE))
	send_to_char
	  ("#cTornado      #0- #CBash your enemies with mighty winds.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_LAMP))
	send_to_char ("#cLampform     #0- #CHide in your shiney lamp.\n\r",
		      ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_MIGHT))
	send_to_char ("#cMight        #0- #CMight of the Djinn (auto).\n\r",
		      ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_WIND))
	send_to_char
	  ("#cWindgust     #0- #CSummon winds from the air elemental plane to crush many enemy's.\n\r",
	   ch);
      if (IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SONIC))
	send_to_char
	  ("#cSonicblast   #0- #CCreate a blast of sound to devistate your enemy's.\n\r",
	   ch);
    }
  else
    send_to_char ("#cYou haven't gained any powers.\n\r", ch);
  send_to_char
    ("#P-------------------------------------------------------------------#n\n\r",
     ch);
  return;
}

void
do_djinngrant (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  char cst[MSL];
  int inp, cost;

  if (IS_NPC (ch))
    return;

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

  if (argument[0] == '\0')
    {
      send_to_char
	("\n\r#0---------------------#o#Y#0------------------------#n\n\r",
	 ch);
      sprintf (buf,
	       "%sSights       #0[#o15000#0]#o | %sDjinnform       #0[#o30000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_SIGHT) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_DJINNFORM) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sIllusionmist #0[#o10000#0]#o | %sHidden          #0[#o12000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_ILLUSIONMIST) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_HIDDEN) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sSenseaura    #0[#o 7500#0]#o | %sDarksoul        #0[#o10000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_READAURA) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_DARKSOUL) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sDjinnclaws   #0[#o 2500#0]#o | %sDjinnsneak      #0[#o 3000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_CLAWS) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_SNEAK) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sDjinnfire    #0[#o 5000#0]#o | %sParalyze        #0[#o 4500#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_FIRE) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_PARALYZE) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sIllusionate  #0[#o 4000#0]#o | %sDreamwalk       #0[#o 5000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_ILLUSIONOBJECT) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_DREAMWALK) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sDreamstain   #0[#o 7500#0]#o | %sCradling        #0[#o 7500#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_DREAMSTAIN) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_CRADLING) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sToughness    #0[#o 5000#0]#o | %sSpeed           #0[#o 7500#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_TOUGHNESS) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_SPEED) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sRegenerate   #0[#o 5000#0]#o | %sWeaponforge     #0[#o10000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_REGEN) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_WEAPON) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sLamp         #0[#o 5000#0]#o | %sTornado         #0[#o 5000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_LAMP) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_HURRICANE) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sCurse        #0[#o 7500#0]#o | %sMight           #0[#o 7500#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_CURSE) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_MIGHT) ? "#R" : "#0");
      stc (buf, ch);
      sprintf (buf,
	       "%sSonicblast   #0[#o 5000#0]#o | %sWindgust        #0[#o20000#0]#n\n\r",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_SONIC) ? "#R" : "#0",
	       IS_SET (ch->pcdata->powers[DJINNPOWERS],
		       DJINN_WIND) ? "#R" : "#0");
      stc (buf, ch);
      send_to_char
	("#0---------------------#o#Y#0------------------------#n\n\r", ch);
      sprintf (buf, "\n\r#R     You have#o %d#R %s power points.\n\r\n\r",
	       ch->pcdata->power[POWER_CURRENT], get_class (ch));
      stc (buf, ch);
      send_to_char
	("#0---------------------#o#Y#0------------------------#n\n\r", ch);
      return;
    }

  if (!str_cmp (argument, "sights"))
    {
      inp = DJINN_SIGHT;
      cost = 15000;
      sprintf (buf, "Sights");
    }
  else if (!str_cmp (argument, "djinnform"))
    {
      inp = DJINN_DJINNFORM;
      cost = 30000;
      sprintf (buf, "Djinnform");
    }
  else if (!str_cmp (argument, "illusionmist"))
    {
      inp = DJINN_ILLUSIONMIST;
      cost = 10000;
      sprintf (buf, "Illusionmist");
    }
  else if (!str_cmp (argument, "hidden"))
    {
      inp = DJINN_HIDDEN;
      cost = 12000;
      sprintf (buf, "Hidden");
    }
  else if (!str_cmp (argument, "senseaura"))
    {
      inp = DJINN_READAURA;
      cost = 7500;
      sprintf (buf, "Senseaura");
    }
  else if (!str_cmp (argument, "darksoul"))
    {
      inp = DJINN_DARKSOUL;
      cost = 10000;
      sprintf (buf, "Darksoul");
    }
  else if (!str_cmp (argument, "djinnclaws"))
    {
      inp = DJINN_CLAWS;
      cost = 2500;
      sprintf (buf, "Djinnclaws");
    }
  else if (!str_cmp (argument, "djinnsneak"))
    {
      inp = DJINN_SNEAK;
      cost = 3000;
      sprintf (buf, "Djinnsneak");
    }
  else if (!str_cmp (argument, "djinnfire"))
    {
      inp = DJINN_FIRE;
      cost = 5000;
      sprintf (buf, "Djinnfire");
    }
  else if (!str_cmp (argument, "paralyze"))
    {
      inp = DJINN_PARALYZE;
      cost = 4500;
      sprintf (buf, "Paralyze");
    }
  else if (!str_cmp (argument, "illusionate"))
    {
      inp = DJINN_ILLUSIONOBJECT;
      cost = 4000;
      sprintf (buf, "Illusionate");
    }
  else if (!str_cmp (argument, "dreamwalk"))
    {
      inp = DJINN_DREAMWALK;
      cost = 5000;
      sprintf (buf, "Dreamwalk");
    }
  else if (!str_cmp (argument, "dreamstain"))
    {
      inp = DJINN_DREAMSTAIN;
      cost = 7500;
      sprintf (buf, "Dreamstain");
    }
  else if (!str_cmp (argument, "cradling"))
    {
      inp = DJINN_CRADLING;
      cost = 7500;
      sprintf (buf, "Cradling");
    }
  else if (!str_cmp (argument, "speed"))
    {
      inp = DJINN_SPEED;
      cost = 7500;
      sprintf (buf, "Speed");
    }
  else if (!str_cmp (argument, "toughness"))
    {
      inp = DJINN_TOUGHNESS;
      cost = 5000;
      sprintf (buf, "Toughness");
    }
  else if (!str_cmp (argument, "regenerate"))
    {
      inp = DJINN_REGEN;
      cost = 5000;
      sprintf (buf, "Regenerate");
    }
  else if (!str_cmp (argument, "weaponforge"))
    {
      inp = DJINN_WEAPON;
      cost = 10000;
      sprintf (buf, "Weaponforge");
    }
  else if (!str_cmp (argument, "tornado"))
    {
      inp = DJINN_HURRICANE;
      cost = 5000;
      sprintf (buf, "Tornado");
    }
  else if (!str_cmp (argument, "lamp"))
    {
      inp = DJINN_LAMP;
      cost = 5000;
      sprintf (buf, "Lamp");
    }
  else if (!str_cmp (argument, "might"))
    {
      inp = DJINN_MIGHT;
      cost = 7500;
      sprintf (buf, "Might");
    }
  else if (!str_cmp (argument, "sonicblast"))
    {
      inp = DJINN_SONIC;
      cost = 7500;
      sprintf (buf, "Sonicblast");
    }
  else if (!str_cmp (argument, "windgust"))
    {
      inp = DJINN_WIND;
      cost = 7500;
      sprintf (buf, "Windgust");
    }
  else if (!str_cmp (argument, "curse"))
    {
      inp = DJINN_CURSE;
      cost = 7500;
      sprintf (buf, "Curse of the Djinn");
    }
  else
    {
      do_djinngrant (ch, "");
      return;
    }

  if (IS_SET (ch->pcdata->powers[DJINNPOWERS], inp))
    {
      send_to_char ("You already have insight of how to use that power!\n\r",
		    ch);
      return;
    }

  if (ch->pcdata->power[POWER_CURRENT] < cost)
    {
      sprintf (cst, "You need another %d Djinn Power to get that.\n\r",
	       (cost - ch->pcdata->power[POWER_CURRENT]));
      send_to_char (cst, ch);
      return;
    }

  SET_BIT (ch->pcdata->powers[DJINNPOWERS], inp);
  ch->pcdata->power[POWER_CURRENT] -= cost;
  if (inp == DJINN_HURRICANE && IS_EFRETI (ch)
      && IS_SET (ch->pcdata->disc[C_POWERS], DEM_PYRO)
      && IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_WIND))
    {
      stc
	("Your mastery of wind and fire blends and forms a shielding globe of flame around you.\n\r",
	 ch);
      act ("A shielding globe of flame forms around $n.\n\r", ch, NULL, NULL,
	   TO_ROOM);
      SET_BIT (ch->xxxbits, XXX_FLAMESHIELD);
    }
  if (inp == DJINN_WIND && IS_EFRETI (ch)
      && IS_SET (ch->pcdata->disc[C_POWERS], DEM_PYRO)
      && IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HURRICANE))
    {
      stc
	("Your mastery of wind and fire blends and forms a shielding globe of flame around you.\n\r",
	 ch);
      act ("A shielding globe of flame forms around $n.\n\r", ch, NULL, NULL,
	   TO_ROOM);
      SET_BIT (ch->xxxbits, XXX_FLAMESHIELD);
    }
  sprintf (cst, "You gain superior insight of the usage of %s.\n\r", buf);
  send_to_char (cst, ch);
  return;
}

void
do_windgust (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  CHAR_DATA *vch;
  CHAR_DATA *vch_next;
  int number_hit = 0;

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_WIND))
    {
      stc ("You dont have that power yet.\n\r", ch);
      return;
    }

  send_to_char
    ("#oYou open a portal to the elemental plane of air releasing its terrible winds.#n\n\r",
     ch);
  act
    ("$n#o opens a portal to the elemental plane of air releasing its terrible winds.#n",
     ch, NULL, NULL, TO_ROOM);

  for (vch = ch->in_room->people; vch != NULL; vch = vch_next)
    {
      vch_next = vch->next_in_room;
      if (vch == ch)
	continue;
      if (number_hit > 9)
	continue;
      if (!IS_NPC (vch))
	continue;
      if (is_safe (ch, vch))
	continue;
      {
	more_hit (ch, vch, gsn_windgust, DAM_WIND, number_range (3, 5),
		  FALSE);
	number_hit++;
      }
    }

  waiting (ch, 12);
  return;
}

void
do_djinnform (CHAR_DATA * ch, char *argument)
{
  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DJINNFORM))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (IS_AFFECTED (ch, AFF_POLYMORPH) && !IS_VAMPAFF (ch, VAM_DISGUISED))
    {
      send_to_char ("Not while polymorphed.\n\r", ch);
      return;
    }

  if (IS_POLYAFF (ch, POLY_DJINNFORM))
    {
      REMOVE_BIT (ch->polyaff, POLY_DJINNFORM);
      free_string (ch->morph);
      ch->morph = str_dup (get_form (ch));
      if (strlen (ch->morph) < 2)
	{
	  REMOVE_BIT (ch->affected_by, AFF_POLYMORPH);
	  REMOVE_BIT (ch->vampaff, VAM_DISGUISED);
	}
      REMOVE_BIT (ch->vampaff, VAM_CLAWS);
      REMOVE_BIT (ch->vampaff, VAM_NIGHTSIGHT);
      REMOVE_BIT (ch->extra, EXTRA_VICISSITUDE);
      send_to_char ("Your body shrinks and distorts.\n\r", ch);
      act ("$n shrinks and distorts.", ch, NULL, NULL, TO_ROOM);
      return;
    }
  if (ch->mounted == IS_RIDING)
    do_dismount (ch, "");
  send_to_char ("Your body grows and distorts.\n\r", ch);
  act ("$n's body grows and distorts.", ch, NULL, NULL, TO_ROOM);
  SET_BIT (ch->vampaff, VAM_CLAWS);
  SET_BIT (ch->vampaff, VAM_NIGHTSIGHT);
  SET_BIT (ch->affected_by, AFF_POLYMORPH);
  SET_BIT (ch->vampaff, VAM_DISGUISED);
  SET_BIT (ch->extra, EXTRA_VICISSITUDE);
  SET_BIT (ch->polyaff, POLY_DJINNFORM);
  free_string (ch->morph);
  ch->morph = str_dup (get_form (ch));
  return;
}

void
do_lampform (CHAR_DATA * ch, char *argument)
{
  OBJ_DATA *obj;
  if (IS_NPC (ch))
    return;

  if ((!IS_DJINN (ch)) || IS_HEAD (ch, LOST_HEAD))
    {
      send_to_char ("Huh?\n\r", ch);
      return;
    }

  if (has_fighttimer (ch))
    return;

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_LAMP))
    {
      send_to_char ("You havent been granted your lamp yet.\n\r", ch);
      return;
    }

  if (has_artifact (ch))
    {
      stc ("Not with an artifact.\n\r", ch);
      return;
    }


  if (!IS_XBITS (ch, X_LAMP) && IS_AFFECTED (ch, AFF_POLYMORPH))
    {
      send_to_char ("Not from this form.\n\r", ch);
      return;
    }
  if ((obj = ch->pcdata->chobj) != NULL && IS_EXTRA (ch, EXTRA_OSWITCH))
    {
      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);
      REMOVE_BIT (ch->xbits, X_LAMP);
      free_string (ch->morph);
      ch->morph = str_dup ("");
      act ("A white mist pour's out of $p, and forms into $n.", ch, obj, NULL,
	   TO_ROOM);
      act ("Your 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;
    }

  if (IS_AFFECTED (ch, AFF_POLYMORPH))
    {
      send_to_char ("You cannot do this while polymorphed.\n\r", ch);
      return;
    }
  if ((obj = create_object (get_obj_index (OBJ_VNUM_LAMP), 0)) == NULL)
    {
      send_to_char ("Bug - please inform Corim.\n\r", ch);
      return;
    }
  if (ch->mounted == IS_RIDING)
    do_dismount (ch, "");
  obj_to_room (obj, ch->in_room);
  SET_BIT (obj->quest, QUEST_VANISH);
  act ("$n transforms into a white mist and disapears into $s $p.", ch, obj,
       NULL, TO_ROOM);
  act ("You transform into  a white mist and take shelter inside $p.", ch,
       obj, NULL, TO_CHAR);
  if (IS_EXTRA (ch, TIED_UP))
    {
      act ("The ropes binding you fall to the ground.", ch, NULL, NULL,
	   TO_CHAR);
      act ("The ropes binding $n fall to the ground.", ch, NULL, NULL,
	   TO_ROOM);
      REMOVE_BIT (ch->extra, TIED_UP);
      REMOVE_BIT (ch->extra, GAGGED);
      REMOVE_BIT (ch->extra, BLINDFOLDED);
    }
  if (is_affected (ch, gsn_uberweb))
    {
      act ("The webbing entrapping $n falls of $s form.", ch, NULL, NULL,
	   TO_ROOM);
      send_to_char ("The webbing entrapping you falls of your form.\n\r", ch);
      affect_strip (ch, gsn_uberweb);
      if (is_affected (ch, gsn_web))
	affect_strip (ch, gsn_web);
      REMOVE_BIT (ch->affected_by, AFF_WEBBED);
    }
  if (is_affected (ch, gsn_web))
    {
      act ("The webbing entrapping $n falls of $s form.", ch, NULL, NULL,
	   TO_ROOM);
      send_to_char ("The webbing entrapping you falls of your form.\n\r", ch);
      affect_strip (ch, gsn_web);
      REMOVE_BIT (ch->affected_by, AFF_WEBBED);
    }
  if (is_affected (ch, gsn_tendrils))
    {
      act ("The tendrils of darkness entrapping $n falls of $s form.", ch,
	   NULL, NULL, TO_ROOM);
      send_to_char
	("The tendrils of darkness entrapping you falls of your form.\n\r",
	 ch);
      affect_strip (ch, gsn_tendrils);
    }
  if (IS_AFFECTED (ch, AFF_SHADOW))
    {
      act ("The tendrils of darkness entrapping $n falls of $s form.", ch,
	   NULL, NULL, TO_ROOM);
      send_to_char
	("The tendrils of darkness entrapping you falls of your form.\n\r",
	 ch);
      REMOVE_BIT (ch->affected_by, AFF_SHADOW);
    }
  if (is_affected (ch, gsn_jail))
    {
      act ("The band of water entrapping $n splash to the ground.", ch, NULL,
	   NULL, TO_ROOM);
      send_to_char
	("The bands of water entrapping you splash to the ground.\n\r", ch);
      affect_strip (ch, gsn_jail);
    }
  if (IS_AFFECTED (ch, AFF_JAIL))
    {
      act ("The band of water entrapping $n splash to the ground.", ch, NULL,
	   NULL, TO_ROOM);
      send_to_char
	("The bands of water entrapping you splash to the ground.\n\r", ch);
      REMOVE_BIT (ch->affected_by, AFF_JAIL);
    }
  ch->pcdata->obj_vnum = OBJ_VNUM_LAMP;
  obj->chobj = ch;
  ch->pcdata->chobj = obj;
  SET_BIT (ch->affected_by, AFF_POLYMORPH);
  SET_BIT (ch->extra, EXTRA_OSWITCH);
  SET_BIT (ch->xbits, X_LAMP);
  free_string (ch->morph);
  ch->morph = str_dup (obj->short_descr);
  return;
}

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

  char arg[MSL];
  char buf[MSL];
  OBJ_INDEX_DATA *pObjIndex;
  OBJ_DATA *obj;
  int vnum = 0;
  int cost = 0;

  argument = one_argument (argument, arg);


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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_WEAPON))
    {
      stc ("You dont have this power yet.\n\r", ch);
      return;
    }

  if (IS_ABERRATION (ch) || IS_DEFYLER (ch))
    {
      if (arg[0] == '\0')
	{
	  send_to_char ("Syntax: weaponforge <bracer>\n\r", ch);
	  send_to_char ("Bracers = Butcher, Slaughter.\n\r", ch);
	  return;
	}

      if (!str_cmp (arg, "butcher"))
	{
	  cost = 5000;
	  vnum = 29679;
	}
      else if (!str_cmp (arg, "slaughter"))
	{
	  cost = 5000;
	  vnum = 29679;
	}
      else
	{
	  send_to_char ("Syntax: Weaponforge <bracer>\n\r", ch);
	  send_to_char ("Bracers = Butcher, Slaughter.\n\r", ch);
	  return;
	}
    }
  else
    {
      if (arg[0] == '\0')
	{
	  send_to_char ("Syntax: weaponforge <scimitar>\n\r", ch);
	  send_to_char ("Scimitars = Lightstealer, Nighthunter.\n\r", ch);
	  return;
	}

      if (!str_cmp (arg, "Lightstealer"))
	{
	  cost = 5000;
	  vnum = 29619;
	}
      else if (!str_cmp (arg, "Nighthunter"))
	{
	  cost = 5000;
	  vnum = 29619;
	}
      else
	{
	  send_to_char ("Syntax: Weaponforge <scimitar>\n\r", ch);
	  send_to_char ("Scimitars = Lightstealer, Nighthunter.\n\r", ch);
	  return;
	}
    }

  if (ch->pcdata->power[POWER_CURRENT] < cost)
    {
      send_to_char ("You don't have enough Djinn points.\n\r", ch);
      return;
    }

  if (vnum == 0 || (pObjIndex = get_obj_index (vnum)) == NULL)
    {
      send_to_char ("Missing object, please inform Corim.\n\r", ch);
      return;
    }

  ch->pcdata->power[POWER_CURRENT] -= cost;
  obj = create_object (pObjIndex, 50);

  if (IS_ABERRATION (ch) || IS_DEFYLER (ch))
    {
      obj->value[0] = 250;
      if (!str_cmp (arg, "butcher"))
	{

	  obj->value[3] = 17;

	  sprintf (buf, "#cThe wicked #rBu#Rt#0c#Rh#rer#c bracer#n");
	  free_string (obj->short_descr);
	  obj->short_descr = str_dup (buf);

	  sprintf (buf,
		   "#cThis heinous bracer makes you want to butcher everyone#n");
	  free_string (obj->description);
	  obj->description = str_dup (buf);

	  add_affect (obj, APPLY_HITROLL, 50);
	  add_affect (obj, APPLY_DAMROLL, 50);
	  add_affect (obj, APPLY_AC, -100);

	}

      else if (!str_cmp (arg, "slaughter"))
	{

	  obj->value[3] = 18;

	  sprintf (buf, "#cThe dreaded #0Sl#rau#Rg#rht#0er#c bracer#n");
	  free_string (obj->short_descr);
	  obj->short_descr = str_dup (buf);

	  sprintf (buf,
		   "#cThis heinous bracer makes you want to slaughter everyone#n");
	  free_string (obj->description);
	  obj->description = str_dup (buf);

	  add_affect (obj, APPLY_HITROLL, 50);
	  add_affect (obj, APPLY_DAMROLL, 50);
	  add_affect (obj, APPLY_AC, -100);

	}
    }
  else
    {
      obj->value[1] = 150;
      obj->value[2] = 350;
      if (!str_cmp (arg, "lightstealer"))
	{

	  obj->value[0] = 17004;

	  sprintf (buf, "#cThe wicked#y Light#0Stealer#c Scimitar#n");
	  free_string (obj->short_descr);
	  obj->short_descr = str_dup (buf);

	  sprintf (buf,
		   "#cThis wicked Scimitar seems to absorb all the light in the room#n");
	  free_string (obj->description);
	  obj->description = str_dup (buf);

	  add_affect (obj, APPLY_HITROLL, 50);
	  add_affect (obj, APPLY_DAMROLL, 50);
	  add_affect (obj, APPLY_AC, -100);

	}

      else if (!str_cmp (arg, "nighthunter"))
	{

	  obj->value[0] = 18034;

	  sprintf (buf, "#cThe dreaded #0Night#rHunter#c Scimitar#n");
	  free_string (obj->short_descr);
	  obj->short_descr = str_dup (buf);

	  sprintf (buf,
		   "#cThis Scimitar is so sharp it looks like its cutting the air#n");
	  free_string (obj->description);
	  obj->description = str_dup (buf);

	  add_affect (obj, APPLY_HITROLL, 50);
	  add_affect (obj, APPLY_DAMROLL, 50);
	  add_affect (obj, APPLY_AC, -100);

	}
    }


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

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

  free_string (obj->creator);
  sprintf (buf, "%s (Weaponforge)", ch->name);
  obj->creator = str_dup (buf);

  SET_BIT (obj->quest, QUEST_RELIC);
  SET_BIT (obj->spectype, SITEM_DJINN);
  if (!IS_DEMON (ch))
    {
      if (IS_SET (obj->spectype, SITEM_DEMONIC))
	REMOVE_BIT (obj->spectype, SITEM_DEMONIC);
    }
  else
    {
      if (!IS_SET (obj->spectype, SITEM_DEMONIC))
	SET_BIT (obj->spectype, SITEM_DEMONIC);
    }
  SET_BIT (obj->spectype, SITEM_SILVER);
  if (IS_DEFYLER (ch))
    {
      SET_BIT (obj->spectype, SITEM_WOLFWEAPON);
    }
  obj->condition = 100;
  obj->toughness = 100;
  obj->resistance = 1;
  obj_to_char (obj, ch);

  act ("$p appears in your hands in a blast of dark magic!", ch, obj, NULL,
       TO_CHAR);
  act ("$p appears in $n's hands in a blast of dark magic!", ch, obj, NULL,
       TO_ROOM);

  return;
}


void
do_dcurse (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char arg[MIL];
  AFFECT_DATA af;
  int mcost = 600, sn;
  int level;


  if (IS_NPC (ch))
    return;

  if (!IS_DJINN (ch))
    {
      if (IS_DRACONIAN (ch))
	{
	  do_drakecurse (ch, argument);
	  return;
	}
      send_to_char ("Huh?\n\r", ch);
      return;
    }
  else
    {
      one_argument (argument, arg);

      if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CURSE))
	{
	  send_to_char ("You haven't learned this skill yet.\n\r", ch);
	  return;
	}

      if (ch->mana < mcost)
	{
	  send_to_char
	    ("You need more mystical power before you can use this skill.\n\r",
	     ch);
	  return;
	}

      if (arg[0] == '\0')
	{
	  send_to_char ("Call down the Curse of the Djinn on who?\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_safe (ch, victim))
	return;

      if ((sn = skill_lookup ("djinn curse")) < 0)
	return;

      if (is_affected (victim, sn))
	{
	  send_to_char ("They are already Cursed by the Djinn's.\n\r", ch);
	  return;
	}

      act ("\n\rYou say, '#yFeel the Curse of the Djinn's!#n'\n\r", ch, NULL,
	   NULL, TO_CHAR);
      act ("\n\r$n says, '#yFeel the Curse of the Djinn's!#n'\n\r", ch, NULL,
	   NULL, TO_ROOM);
      act ("#pA purple cloud envelopes $N.#n\n\r", ch, NULL, victim, TO_CHAR);
      act ("#pA purple cloud envelopes you, making it hard to breath.#n\n\r",
	   ch, NULL, victim, TO_VICT);
      act ("#pA purple cloud envelopes $N.#n\n\r", ch, NULL, victim,
	   TO_NOTVICT);
      act
	("#pAs the cloud fades away you feel the strength beeing drained from your body.#n\n\r",
	 ch, NULL, victim, TO_VICT);
      act ("#pWhen the cloud fades away, it leaves $n a weakend husk.#n\n\r",
	   victim, NULL, NULL, TO_NOTVICT);

      (*skill_table[sn].spell_fun) (sn, level, ch, victim);

      waiting (ch, 12);

      ch->mana -= mcost;
    }

  return;
}

void
do_illusionmist (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char arg[MIL];
  AFFECT_DATA af;
  int mcost = 1500;
  int sn;

  one_argument (argument, arg);

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_ILLUSIONMIST))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (mcost > ch->mana)
    {
      send_to_char
	("You do not have the required mystical power to use this skill.\n\r",
	 ch);
      return;
    }

  if (arg[0] == '\0')
    {
      send_to_char ("Blow a mist of illusion at 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 ((sn = skill_lookup ("curse")) < 0)
    return;

  if (is_affected (victim, sn))
    {
      send_to_char ("They are already Cursed by the Djinn's.\n\r", ch);
      return;
    }

  act ("You reach out your hand, and blow a mist of illusion at $N.", ch,
       NULL, victim, TO_CHAR);
  act ("$n reaches out their hand, and blows a mist of illusion at you.", ch,
       NULL, victim, TO_VICT);
  act ("$n reaches out their hand, and blows a mist of illusion at $N.", ch,
       NULL, victim, TO_NOTVICT);
  af.type = gsn_curse;
  af.duration = 5;
  af.location = APPLY_HITROLL;
  af.modifier = -50;
  af.bitvector = 0;
  affect_to_char (victim, &af);
  af.location = APPLY_DAMROLL;
  af.modifier = -50;
  affect_to_char (victim, &af);
  ch->mana -= mcost;
  waiting (ch, 12);
  return;
}

void
do_hidden (CHAR_DATA * ch, char *argument)
{
  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HIDDEN))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (IS_SET (ch->evenmore, EM_HIDDEN))
    {
      send_to_char ("You are no longer hidden.\n\r", ch);
      REMOVE_BIT (ch->evenmore, EM_HIDDEN);
      return;
    }
  send_to_char ("You are now hidden from others.\n\r", ch);
  SET_BIT (ch->evenmore, EM_HIDDEN);
  return;
}

void
do_senseaura (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  OBJ_DATA *obj;
  char arg[MIL];
  char buf[MSL];
  int con_hit, con_dam, con_ac, con_hp, con_mana, con_move;
  int con_str, con_int, con_dex, con_wis, con_con;
  int con_max_hp, con_max_mana, con_max_move;

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_READAURA))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (arg[0] == '\0')
    {
      send_to_char ("Sense the aura on what?\n\r", ch);
      return;
    }

  if ((victim = get_char_room (ch, arg)) == NULL)
    {
      if ((obj = get_obj_carry (ch, arg)) == NULL)
	{
	  send_to_char ("Sense the aura on what?\n\r", ch);
	  return;
	}
      spell_identify (skill_lookup ("identify"), ch->level, ch, obj);
      return;
    }

  if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_SHIELDED)
      && !IS_ITEMAFF (ch, ITEMA_VISION))
    {
      send_to_char ("You are unable to sense their aura.\n\r", ch);
      if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
	{
	  guardian_message (victim);
	  act ("$n just failed to use Sense Aura on you.", ch, NULL, victim,
	       TO_VICT);
	}
      return;
    }

  act ("$n examines $N intently.", ch, NULL, victim, TO_NOTVICT);
  act ("$n examines you intently.", ch, NULL, victim, TO_VICT);

  if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_FAKE_CON))
    {
      con_hit = victim->pcdata->fake_hit;
      con_dam = victim->pcdata->fake_dam;
      con_ac = victim->pcdata->fake_ac;
      con_str = victim->pcdata->fake_stats[STAT_STR];
      con_int = victim->pcdata->fake_stats[STAT_INT];
      con_wis = victim->pcdata->fake_stats[STAT_WIS];
      con_dex = victim->pcdata->fake_stats[STAT_DEX];
      con_con = victim->pcdata->fake_stats[STAT_CON];
      con_hp = victim->pcdata->fake_hp;
      con_mana = victim->pcdata->fake_mana;
      con_move = victim->pcdata->fake_move;
      con_max_hp = victim->pcdata->fake_max_hp;
      con_max_mana = victim->pcdata->fake_max_mana;
      con_max_move = victim->pcdata->fake_max_move;
    }
  else
    {
      con_hit = char_hitroll (victim);
      con_dam = char_damroll (victim);
      con_ac = char_ac (victim);
      con_str = get_curr_str (victim);
      con_int = get_curr_int (victim);
      con_wis = get_curr_wis (victim);
      con_dex = get_curr_dex (victim);
      con_con = get_curr_con (victim);
      con_hp = victim->hit;
      con_mana = victim->mana;
      con_move = victim->move;
      con_max_hp = victim->max_hit;
      con_max_mana = victim->max_mana;
      con_max_move = victim->max_move;
    }

  if (IS_NPC (victim))
    sprintf (buf, "%s is an NPC.\n\r", victim->short_descr);
  else
    {
      if (victim->level == 12)
	sprintf (buf, "%s is an Implementor.\n\r", victim->name);
      else if (victim->level == 11)
	sprintf (buf, "%s is a High Judge.\n\r", victim->name);
      else if (victim->level == 10)
	sprintf (buf, "%s is a Judge.\n\r", victim->name);
      else if (victim->level == 9)
	sprintf (buf, "%s is an Enforcer.\n\r", victim->name);
      else if (victim->level == 8)
	sprintf (buf, "%s is a Quest Maker.\n\r", victim->name);
      else if (victim->level == 7)
	sprintf (buf, "%s is a Builder.\n\r", victim->name);
      else if (victim->level >= 3)
	sprintf (buf, "%s is an Avatar.\n\r", victim->name);
      else
	sprintf (buf, "%s is a Mortal.\n\r", victim->name);
    }
  send_to_char (buf, ch);
  sprintf (buf, "Str: %d.  Int: %d.  Wis: %d.  Dex: %d.  Con: %d.\n\r",
	   con_str, con_int, con_wis, con_dex, con_con);
  send_to_char (buf, ch);
  if (IS_MAGE (victim))
    {
      sprintf (buf, "Life: %d/%d, Mp: %d/%d, Vitality: %d/%d.\n\r",
	       con_hp, con_max_hp, con_mana, con_max_mana, con_move,
	       con_max_move);
    }
  else
    {
      sprintf (buf, "Hp: %d/%d, Vitality: %d/%d.\n\r",
	       con_hp, con_max_hp, con_move, con_max_move);
    }
  send_to_char (buf, ch);
  sprintf (buf, "Hitroll: %d, Damroll: %d, AC: %d.\n\r",
	   con_hit, con_dam, con_ac);
  send_to_char (buf, ch);
  if (!IS_NPC (victim))
    {
      sprintf (buf, "Status: %d, ", victim->race);
      send_to_char (buf, ch);
    }
  sprintf (buf, "Alignment: %d.\n\r", victim->alignment);
  send_to_char (buf, ch);
  if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_PREGNANT))
    act ("$N is pregnant.", ch, NULL, victim, TO_CHAR);
  if (!IS_NPC (victim) && IS_VAMPIRE (victim)
      && victim->pcdata->diableries[DIAB_EVER] >= 5)
    act ("$N's soul is permanently stained with multiple diablerie.", ch,
	 NULL, victim, TO_CHAR);
  else if (!IS_NPC (victim) && IS_VAMPIRE (victim)
	   && victim->pcdata->diableries[DIAB_TIME] > 0)
    act ("$N has recently committed diablerie.", ch, NULL, victim, TO_CHAR);
  if (!IS_NPC (victim) && IS_MORE (victim, MORE_INFORM))
    {
      if (ch->pcdata->lie == LIE_TRUE)
	act ("$N has recently lied.", ch, NULL, victim, TO_CHAR);
      else
	act ("$N has recently spoken truthfully.", ch, NULL, victim, TO_CHAR);
    }
  if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
    {
      guardian_message (victim);
      act ("$n just used Sense Aura on you.", ch, NULL, victim, TO_VICT);
    }
  return;
}

void
do_darksoul (CHAR_DATA * ch, char *argument)
{
  bool blah = FALSE;

  if (IS_NPC (ch))
    return;

  if (!IS_DJINN (ch) && !IS_XX (ch, XX_RAKDJINN))
    {
      send_to_char ("Huh?\n\r", ch);
      return;
    }

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DARKSOUL)
      && !IS_XX (ch, XX_RAKDJINN))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (IS_SET (ch->corbits, COR_DARKNESS))
    {
      send_to_char ("You banish your globe of darkness.\n\r", ch);
      act ("The globe of darkness around $n disappears.", ch, NULL, NULL,
	   TO_ROOM);
      REMOVE_BIT (ch->corbits, COR_DARKNESS);
      if (ch->in_room != NULL)
	{
	  if (IS_SET (ch->in_room->room_flags, ROOM_DJINN_DARKNESS))
	    REMOVE_BIT (ch->in_room->room_flags, ROOM_DJINN_DARKNESS);
	}
      ch->darkdjinn = 60;
      return;
    }

  if (has_fighttimer (ch))
    return;

  if (ch->mana < 500)
    {
      send_to_char
	("You don't have enough mystical power to mirror your dark soul.\n\r",
	 ch);
      return;
    }

  send_to_char
    ("You show the depth of your soul, banishing the room into darkness.\n\r",
     ch);
  act ("$n shows the depth of $s soul, banishing the room into darkness!", ch,
       NULL, NULL, TO_ROOM);
  ch->mana -= 500;
  if (IS_SET (ch->extra, TIED_UP))
    {
      REMOVE_BIT (ch->extra, TIED_UP);
      blah = TRUE;
    }

  if (IS_AFFECTED (ch, AFF_WEBBED))
    {
      REMOVE_BIT (ch->affected_by, AFF_WEBBED);
      blah = TRUE;
    }

  if (blah)
    send_to_char ("The darkness sets you free.\n\r", ch);

  if (ch->in_room != NULL)
    {
      SET_BIT (ch->corbits, COR_DARKNESS);
      if (!IS_SET (ch->in_room->room_flags, ROOM_DJINN_DARKNESS))
	SET_BIT (ch->in_room->room_flags, ROOM_DJINN_DARKNESS);
    }
  ch->darkdjinn = 60;
  return;
}

void
do_djinnclaws (CHAR_DATA * ch, char *argument)
{
  char arg[MIL];

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CLAWS))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (IS_VAMPAFF (ch, VAM_CLAWS))
    {
      send_to_char ("Your talons slide back into your fingers.\n\r", ch);
      act ("$n's talons slide back into $s fingers.", ch, NULL, NULL,
	   TO_ROOM);
      REMOVE_BIT (ch->vampaff, VAM_CLAWS);
      return;
    }

  send_to_char ("Razor sharp talons extend from your fingers.\n\r", ch);
  act ("Razor sharp talons extend from $n's fingers.", ch, NULL, NULL,
       TO_ROOM);
  SET_BIT (ch->vampaff, VAM_CLAWS);
  return;
}

void
do_djinnsneak (CHAR_DATA * ch, char *argument)
{
  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SNEAK))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (IS_AFFECTED (ch, AFF_SNEAK))
    {
      SET_BIT (ch->affected_by, AFF_SNEAK);
      send_to_char ("Your footsteps stop making any sound.\n\r", ch);
      return;
    }
  SET_BIT (ch->affected_by, AFF_SNEAK);
  send_to_char ("Your footsteps stop making any sound.\n\r", ch);
  return;
}

void
do_hurricane (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char buf[MSL];
  char arg[MIL];
  int dam = ch->move / 8;

  argument = one_argument (argument, arg);

  dam = dam + number_range (500, 1500);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HURRICANE))
    {
      send_to_char ("You havent been granted Tornado yet.\n\r", ch);
      return;
    }

  if (!IS_POLYAFF (ch, POLY_DJINNFORM))
    {
      send_to_char ("You dont have any Tornado rageing around you.\n\r", ch);
      return;
    }

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

  if (ch->position < POS_SLEEPING)
    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 == victim)
    {
      send_to_char ("Now that would be just plain stupid.\n\r", ch);
      return;
    }


  if (!IS_NPC (victim))
    {
      if (dam >= 8000)
	{
	  dam = 8000 + number_range (250, 1250);
	}
    }

  if (IS_NPC (victim))
    {
      sprintf (buf,
	       "#cYour raging winds strikes %s#c incredibly hard [#R%d#c].\n\r",
	       victim->short_descr, dam);
      stc (buf, ch);
      sprintf (buf,
	       "%s#c raging winds strikes you incredibly hard [#R%d#c].\n\r",
	       ch->name, dam);
      stc (buf, victim);
      sprintf (buf, "%s#c raging winds strikes %s#c incredibly hard.\n\r",
	       ch->name, victim->short_descr, dam);
      act (buf, ch, NULL, victim, TO_NOTVICT);
    }

  if (!IS_NPC (victim))
    {
      sprintf (buf,
	       "#cYour raging winds strikes %s#c incredibly hard [#R%d#c].\n\r",
	       victim->name, dam);
      stc (buf, ch);
      sprintf (buf,
	       "%s#c raging winds strikes you incredibly hard [#R%d#c].\n\r",
	       ch->name, dam);
      stc (buf, victim);
      sprintf (buf, "%s#c raging winds strikes %s#c incredibly hard.\n\r",
	       ch->name, victim->name);
      act (buf, ch, NULL, victim, TO_NOTVICT);
    }

  hurt_person (ch, victim, dam, 0);
  waiting (ch, 12);
  return;
}

void
do_firestorm (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char buf[MSL];
  char arg[MIL];
  int dam = ch->move / 6;

  argument = one_argument (argument, arg);

  dam = dam + number_range (500, 1500);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_HURRICANE))
    {
      send_to_char
	("You need to be able to call on the Tornado to use this power.\n\r",
	 ch);
      return;
    }

  if (!IS_POLYAFF (ch, POLY_DJINNFORM))
    {
      send_to_char ("You dont have any rageing winds about you.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to strike with your Fire Storm?\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 == victim)
    {
      send_to_char ("Now that would be just plain stupid.\n\r", ch);
      return;
    }


  if (!IS_NPC (victim))
    {
      if (dam >= 15000)
	{
	  dam = 15000 + number_range (500, 2500);
	}
    }

  if (IS_NPC (victim))
    {
      sprintf (buf,
	       "#cYour #rF#Rl#ya#Rm#re #rS#Rt#yo#Rr#rm#c envelopse $N#c scoorching $S flesh.");
      act (buf, ch, NULL, victim, TO_CHAR);
      sprintf (buf,
	       "$n#c #rF#Rl#ya#Rm#re #rS#Rt#yo#Rr#rm#c envelpose $N#c scoorching $S flesh.");
      act (buf, ch, NULL, victim, TO_NOTVICT);
    }

  if (!IS_NPC (victim))
    {
      sprintf (buf,
	       "#cYour #rF#Rl#ya#Rm#re #rS#Rt#yo#Rr#rm#c envelopse $N#c scoorching $S flesh.");
      act (buf, ch, NULL, victim, TO_CHAR);
      sprintf (buf,
	       "$n#c #rF#Rl#ya#Rm#re #rS#Rt#yo#Rr#rm#c envelopse $N#c scoorching your flesh.");
      act (buf, ch, NULL, victim, TO_VICT);
      sprintf (buf,
	       "$n#c #rF#Rl#ya#Rm#re #rS#Rt#yo#Rr#rm#c envelopse $N#c scoorching $S flesh.");
      act (buf, ch, NULL, victim, TO_NOTVICT);
    }

  if (!IS_AFFECTED (victim, AFF_FLAMING))
    {
      send_to_char ("You are engulfed in flames!\n\r", victim);
      act ("$n is engulfed in flames!", victim, NULL, NULL, TO_ROOM);
      SET_BIT (victim->affected_by, AFF_FLAMING);
    }

  damage (ch, victim, dam, gsn_firestorm, DAM_FIRE, TRUE, FALSE, FALSE);
  waiting (ch, 9);
  return;
}

void
do_sonicblast (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char buf[MSL];
  char arg[MIL];
  int dam = 0;

  argument = one_argument (argument, arg);


  dam = ch->spl[PURPLE_MAGIC] * number_range (10, 20);

  dam = dam + number_range (500, 1500);


  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_SONIC))
    {
      send_to_char ("You havent been granted Sonicblast yet.\n\r", ch);
      return;
    }

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

  if (ch->position < POS_SLEEPING)
    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 == victim)
    {
      send_to_char ("Now that would be just plain stupid.\n\r", ch);
      return;
    }


  sprintf (buf,
	   "#PYou concentrate then suddenly release a Sonic scream at $N#n",
	   dam);
  act (buf, ch, NULL, victim, TO_CHAR);
  sprintf (buf,
	   "#PA look of concentration crosses $n#P's face, then suddenly an invisible force strikes you#n",
	   dam);
  act (buf, ch, NULL, victim, TO_VICT);
  sprintf (buf,
	   "#PA look of concentration crosses $n#P's face, suddenly $N#P releases a scream as someting seems to strike $M.");
  act (buf, ch, NULL, victim, TO_NOTVICT);

  damage (ch, victim, dam, gsn_sonicblast, DAM_SONIC, FALSE, FALSE, FALSE);
  if (victim->position != POS_FIGHTING)
    {
      if (ch->position != POS_FIGHTING)
	set_fighting (ch, victim);
    }
  waiting (ch, 10);
  return;
}

void
do_djinnfire (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  int dam, sn;
  char arg[MIL];

  one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_FIRE))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (IS_ITEMAFF (ch, ITEMA_PEACE))
    do_majesty (ch, "");

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

  if (ch->position < POS_SLEEPING)
    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))
    {
      if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
	{
	  guardian_message (victim);
	  act ("$n just failed to use Djinnfire on you.", ch, NULL, victim,
	       TO_VICT);
	}
      return;
    }

  if (ch == victim)
    {
      send_to_char ("Now that would be just plain stupid.\n\r", ch);
      return;
    }

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

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

  dam = number_range (1500, 3000);

  if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_HEAT))
    {
      damage (ch, victim, dam, sn, DAM_FIRE, FALSE, TRUE, TRUE);
    }
  else
    {
      damage (ch, victim, dam, sn, DAM_FIRE, TRUE, TRUE, TRUE);
    }
  waiting (ch, 9);
  if (victim == NULL || victim->position == POS_DEAD)
    return;
  if (!IS_AFFECTED (victim, AFF_FLAMING))
    {
      send_to_char ("You are engulfed in flames!\n\r", victim);
      act ("$n is engulfed in flames!", victim, NULL, NULL, TO_ROOM);
      SET_BIT (victim->affected_by, AFF_FLAMING);
    }
  update_pos (victim);
  return;
}

void
do_cradling (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char arg1[MIL];
  argument = one_argument (argument, arg1);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_CRADLING))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (arg1[0] == '\0')
    {
      send_to_char ("Expose whom to the Cradling?\n\r", ch);
      return;
    }


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

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Not on yourself!\n\r", ch);
      return;
    }

  if (ch->position == POS_FIGHTING)
    {
      send_to_char ("Not while fighting!\n\r", ch);
      return;
    }

  if (victim->hit < 1)
    {
      act ("$N is to hurt for that.", ch, NULL, victim, TO_CHAR);
      return;
    }

  if (IS_XBITS (victim, X_SLEEP) || victim->position <= POS_SLEEPING)
    {
      act ("$N is already sleeping.", ch, NULL, victim, TO_CHAR);
      return;
    }

  if (victim->sleeptimer > 0)
    {
      victim->sleeptimer = 0;
    }

  if (victim->in_room == ch->in_room)
    {
      act
	("You look deeply into $N's eyes, and a bright white light puts them to sleep.",
	 ch, NULL, victim, TO_CHAR);
      act
	("$n looks deeply into your eyes, you see a bright white light, and feel sleepy.",
	 ch, NULL, victim, TO_VICT);
      if (number_range (1, 10) < 4)
	{
	  act ("You failed.", ch, NULL, victim, TO_CHAR);
	  act ("$n just failed to put you to sleep.", ch, NULL, victim,
	       TO_VICT);
	  if (victim->position != POS_FIGHTING)
	    {
	      if (ch->position != POS_FIGHTING)
		set_fighting (ch, victim);
	    }
	  return;
	}

      victim->position = POS_SLEEPING;
      SET_BIT (victim->xbits, X_SLEEP);
      victim->sleeptimer = number_range (20, 30);
      waiting (ch, 12);
      return;

    }
  return;
}

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

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_PARALYZE))
    {
      send_to_char ("You haven't been granted this gift.\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_safe (ch, victim))
    return;

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

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

  if ((sn = skill_lookup ("web")) < 0)
    return;
  spelltype = skill_table[sn].target;
  level = ch->spl[spelltype] * 0.25;
  (*skill_table[sn].spell_fun) (sn, level, ch, victim);
  waiting (ch, 12);
  if (number_range (1, 10) > 6)
    {
      act ("You freeze up and can't move.\n\r", ch, NULL, victim, TO_VICT);
      act ("$N is paralyzed by your stare.\n\r", ch, NULL, victim, TO_CHAR);
      waiting (victim, 16);
      return;
    }
  act ("Your attempt to paralyze $N failed.\n\r", ch, NULL, victim, TO_CHAR);
  if (victim->position != POS_FIGHTING)
    {
      if (ch->position != POS_FIGHTING)
	set_fighting (victim, ch);
    }
  return;
}

void
do_illusionate (CHAR_DATA * ch, char *argument)
{
  OBJ_DATA *obj;
  char arg1[MIL];
  char arg2[MIL];
  char buf[MSL];
  char endchar[15];

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

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_ILLUSIONOBJECT))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (arg1[0] == '\0' || arg2[0] == '\0' || argument[0] == '\0')
    {
      send_to_char
	("Syntax: Illusionate <object> rename  <short description>\n\r", ch);
      send_to_char
	("Syntax: Illusionate <object> keyword <extra keyword/s>\n\r", ch);
      send_to_char ("Syntax: Illusionate <object> flags   <glow/hum>\n\r",
		    ch);
      return;
    }

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


  if (obj->item_type == ITEM_QUEST || obj->item_type == ITEM_AMMO
      || obj->item_type == ITEM_EXP || obj->item_type == ITEM_EGG || obj->item_type == ITEM_PIECE
      || obj->item_type == ITEM_VOODOO || obj->item_type == ITEM_CRYSTAL
      || obj->item_type == ITEM_MONEY || obj->item_type == ITEM_TREASURE
      || obj->item_type == ITEM_TOOL || obj->item_type == ITEM_SYMBOL
      || obj->item_type == ITEM_PAGE || IS_SET (obj->quest, QUEST_ARTIFACT))
    {
      send_to_char ("You cannot change the name of that item.\n\r", ch);
      return;
    }

  if (!IS_IMMORTAL (ch)
      && (obj->questowner == NULL || str_cmp (ch->name, obj->questowner)))
    {
      send_to_char ("You can only change an item you own.\n\r", ch);
      return;
    }

  if (!str_cmp (arg2, "rename"))
    {
      if (IS_SET (obj->quest, QUEST_RELIC))
	{
	  send_to_char ("Not on a relic.\n\r", ch);
	  return;
	}
      if (strlen (argument) < 5)
	{
	  send_to_char ("Name should be at least 5 characters long.\n\r", ch);
	  return;
	}
      endchar[0] = (argument[strlen (argument) - 1]);
      endchar[1] = '\0';
      if (!str_cmp (endchar, "."))
	argument[strlen (argument) - 1] = '\0';
      free_string (obj->name);
      obj->name = str_dup (argument);
      free_string (obj->short_descr);
      obj->short_descr = str_dup (argument);
      if (is_in (argument, "|pair of*"))
	sprintf (buf, "%s are lying here.", argument);
      else
	sprintf (buf, "%s is lying here.", argument);
      buf[0] = UPPER (buf[0]);
      free_string (obj->description);
      obj->description = str_dup (buf);
      send_to_char ("Ok.\n\r", ch);
      if (obj->questmaker != NULL)
	free_string (obj->questmaker);
      obj->questmaker = str_dup (ch->name);
      return;
    }

  if (!str_cmp (arg2, "keyword") || !str_cmp (arg2, "keywords"))
    {
      if (IS_SET (obj->quest, QUEST_RELIC))
	{
	  send_to_char ("Not on a relic.\n\r", ch);
	  return;
	}
      if (strlen (argument) < 3)
	{
	  send_to_char ("Keywords should be at least 3 characters long.\n\r",
			ch);
	  return;
	}
      strcpy (argument, capitalize (argument));
      argument[0] = LOWER (argument[0]);
      endchar[0] = (argument[strlen (argument) - 1]);
      endchar[1] = '\0';
      if (!str_cmp (endchar, "."))
	argument[strlen (argument) - 1] = '\0';
      strcpy (buf, obj->name);
      if (strlen (buf) > 120)
	{
	  send_to_char
	    ("You cannot fit any more keywords on this object.\n\r", ch);
	  return;
	}
      strcat (buf, " ");
      strcat (buf, argument);
      free_string (obj->name);
      obj->name = str_dup (buf);
      send_to_char ("Ok.\n\r", ch);
      if (obj->questmaker != NULL)
	free_string (obj->questmaker);
      obj->questmaker = str_dup (ch->name);
      return;
    }

  if (!str_cmp (arg2, "flags"))
    {

      if (!str_cmp (argument, "glow"))
	{
	  if (IS_SET (obj->extra_flags, ITEM_GLOW))
	    REMOVE_BIT (obj->extra_flags, ITEM_GLOW);
	  else
	    SET_BIT (obj->extra_flags, ITEM_GLOW);
	}
      else if (!str_cmp (argument, "hum"))
	{
	  if (IS_SET (obj->extra_flags, ITEM_HUM))
	    REMOVE_BIT (obj->extra_flags, ITEM_HUM);
	  else
	    SET_BIT (obj->extra_flags, ITEM_HUM);
	}
      else
	{
	  send_to_char ("Syntax: Illusionate <object> flags <glow/hum>\n\r",
			ch);
	  return;
	}

      if (obj->edited != NULL)
	{
	  sprintf (buf, "%s %s", ch->name, obj->edited);
	  free_string (obj->edited);
	  obj->edited = str_dup (buf);
	}
      else
	{
	  obj->edited = str_dup (ch->name);
	}

      send_to_char ("Ok.\n\r", ch);
      if (obj->questmaker != NULL)
	free_string (obj->questmaker);
      obj->questmaker = str_dup (ch->name);
      return;
    }

  send_to_char
    ("Syntax: Illusionate <object> rename  <short description>\n\r", ch);
  send_to_char ("Syntax: Illusionate <object> keyword <extra keyword/s>\n\r",
		ch);
  send_to_char ("Syntax: Illusionate <object> flags   <glow/hum>\n\r", ch);
  return;
}

void
do_dreamwalk (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  OBJ_DATA *obj;
  char arg[MIL];
  int duration;
  char buf[MSL];

  one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

  if (!IS_SET (ch->pcdata->powers[DJINNPOWERS], DJINN_DREAMWALK))
    {
      send_to_char ("You haven't been granted this gift.\n\r", ch);
      return;
    }

  if (has_fighttimer (ch))
    return stc ("Not with a fight timer\n\r", ch);

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

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

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

  if (victim == ch || (!IS_NPC (victim) && !IS_IMMUNE (victim, IMM_SUMMON)))
    {
      if (!IS_NPC (victim) && victim->position != POS_SLEEPING)
	{
	  if (!IS_NPC (victim) && ch != victim
	      && IS_MORE (victim, MORE_GUARDIAN))
	    {
	      guardian_message (victim);
	      act
		("$n just failed to create a gate through your dreams to you.",
		 ch, NULL, victim, TO_VICT);
	    }
	  send_to_char ("You failed.\n\r", ch);
	  return;
	}
    }
  if (IS_IMMORTAL (victim))
    {
      stc ("The spell failed.\n\r", ch);
      sprintf (buf, "%s just tried to step to you.\n\r", ch->name);
      stc (buf, victim);
      return;
    }
  if (IS_SET (victim->evenmore, EM_JAILED))
    {
      send_to_char ("What??? You wish to go to jail too?\n\r", ch);
      return;
    }

  duration = number_range (2, 3) * 4;

  obj = create_object (get_obj_index (OBJ_VNUM_PORTAL), 0);
  obj->value[0] = victim->in_room->vnum;
  obj->value[3] = ch->in_room->vnum;
  obj->timer = duration;
  free_string (obj->name);
  obj->name = str_dup ("gate moon portal");
  free_string (obj->short_descr);
  obj->short_descr = str_dup ("a dreamgate");
  free_string (obj->description);
  obj->description =
    str_dup ("A glimmering gate through somebody's dreams floats here.");
  if (IS_AFFECTED (ch, AFF_SHADOWPLANE))
    obj->extra_flags = ITEM_SHADOWPLANE;
  if (IS_NYM (ch, NYM_DEATHPLANE))
    obj->extra_flags = ITEM_DEATHPLANE;
  obj_to_room (obj, ch->in_room);

  obj = create_object (get_obj_index (OBJ_VNUM_PORTAL), 0);
  obj->value[0] = ch->in_room->vnum;
  obj->value[3] = victim->in_room->vnum;
  obj->timer = duration;
  free_string (obj->name);
  obj->name = str_dup ("gate dream portal");
  free_string (obj->short_descr);
  obj->short_descr = str_dup ("a dreamgate");
  free_string (obj->description);
  obj->description =
    str_dup ("A glimmering gate through somebody's dreams floats here.");
  if (IS_AFFECTED (victim, AFF_SHADOWPLANE))
    obj->extra_flags = ITEM_SHADOWPLANE;
  if (IS_NYM (victim, NYM_DEATHPLANE))
    obj->extra_flags = ITEM_DEATHPLANE;
  obj_to_room (obj, victim->in_room);

  act ("$p appears in front of $n.", ch, obj, NULL, TO_ROOM);
  act ("$p appears in front of you.", ch, obj, NULL, TO_CHAR);
  act ("$p appears in front of $n.", victim, obj, NULL, TO_ROOM);
  act ("$p appears in front of you.", ch, obj, victim, TO_VICT);
  if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
    {
      guardian_message (victim);
      act ("$n just created a gate to you through your dreams.", ch, NULL,
	   victim, TO_VICT);
    }
  return;
}

Site Stats

Snippets: 1791
Codebases: 571