/
roa/
roa/lib/boards/
roa/lib/config/
roa/lib/edits/
roa/lib/help/
roa/lib/misc/
roa/lib/plrobjs/
roa/lib/quests/
roa/lib/socials/
roa/lib/www/
roa/lib/www/LEDSign/
roa/lib/www/LEDSign/fonts/
roa/lib/www/LEDSign/scripts/
roa/src/s_inc/
roa/src/sclient/
roa/src/sclient/binary/
roa/src/sclient/text/
roa/src/util/
/************************************************************************
	Realms of Aurealis 		James Rhone aka Vall of RoA

sparse.c				Setup spells, assign them to classes
					and various other skill/spell
					routines and front ends.

		******** Heavily modified and expanded ********
		*** BE AWARE OF ALL RIGHTS AND RESERVATIONS ***
		******** Heavily modified and expanded ********
		        All rights reserved henceforth. 

    Please note that no guarantees are associated with any code from
Realms of Aurealis.  All code which has been released to the general
public has been done so with an 'as is' pretense.  RoA is based on both
Diku and CircleMUD and ALL licenses from both *MUST* be adhered to as well
as the RoA license.   *** Read, Learn, Understand, Improve ***
*************************************************************************/
#include "conf.h"
#include "sysdep.h"

#include "structures.h"
#include "utils.h"
#include "comm.h"
#include "db.h"
#include "interpreter.h" 
#include "acmd.h"
#include "magic.h"
#include "handler.h"
#include "nature.h"
#include "affect.h"
#include "lists.h"
#include "darkenelf.h"
#include "global.h"

#define X LEV_IMM

// Checks saving throw and adjusts damage accordingly. -callahan
int SpellDamage(CharData *ch, CharData *victim, int dam, int spell, BOOL rgdls)
{
  int damage(chdata *ch, chdata *victim, int dam, int spellnum, BOOL regardless);

  // Saving-throw check for half damage
  if (saves_spell(victim, spell))
    dam >>= 1;
    
  return damage(ch, victim, dam, spell, rgdls);
}

void	say_spell(chdata *ch, int si )
{
   char splwd[MAX_INPUT_LENGTH];

   int	j, offs;
   chdata *temp_char;

   struct syllable {
      char	org[10];
      char	news[10];
   };

   struct syllable syls[] = {
      { " ", " " },
      { "ar", "abra"   },
      { "au", "kada"    },
      { "bless", "fido" },
      { "blind", "nose" },
      { "bur", "mosa" },
      { "cu", "judi" },
      { "de", "oculo" },
      { "en", "unso" },
      { "light", "dies" },
      { "lo", "hi" },
      { "mor", "zak" },
      { "move", "sido" },
      { "ness", "lacri" },
      { "ning", "illa" },
      { "per", "duda" },
      { "ra", "gru"   },
      { "re", "candus" },
      { "son", "sabru" },
      { "tect", "infra" },
      { "tri", "cula" },
      { "ven", "nofo" },
      { "a", "a" }, { "b", "b" }, { "c", "q" }, { "d", "e" }, { "e", "z" },
      { "f", "y" }, { "g", "o" }, { "h", "p" }, { "i", "u" }, { "j", "y" },
      { "k", "t" }, { "l", "r" }, { "m", "w" }, { "n", "i" }, { "o", "a" },
      { "p", "s" }, { "q", "d" }, { "r", "f" }, { "s", "g" }, { "t", "h" },
      { "u", "j" }, { "v", "z" }, { "w", "x" }, { "x", "n" }, { "y", "l" },
      { "z", "k" }, { "", "" }
   };   

   if (IN_NOWHERE(ch)) return;

   strcpy(buf, "");
   strcpy(splwd, skill_names[si]);

   offs = 0;

   while (*(splwd + offs)) {
      for (j = 0; *(syls[j].org); j++)
	 if (strncmp(syls[j].org, splwd + offs, strlen(syls[j].org)) == 0) {
	    strcat(buf, syls[j].news);
	    if (strlen(syls[j].org))
	       offs += strlen(syls[j].org);
	    else
	       ++offs;
	 }
   }

   sprintf(buf2, "$n utters the words, '%s'", buf);
   sprintf(buf, "$n utters the words, '%s'", skill_names[si]);

   for (temp_char = world[ch->in_room].people; temp_char; 
       temp_char = temp_char->next_in_room)
      if (temp_char != ch) {
	 if (GET_CLASS(ch) == GET_CLASS(temp_char))
	    act(buf, FALSE, ch, 0, temp_char, TO_VICT);
	 else
	    act(buf2, FALSE, ch, 0, temp_char, TO_VICT);
      }
}

// RoA, we redid how one saves vs spell
// its now a percentage out of 100 (easier to follow)
// save will be 0 - 100, 50 would be saves half the time etc
// NOTE this has changed a bunch, now send the spell number to save against
// it will determine save vs XXXX based on spell flags
BOOL saves_spell(chdata *ch, int spell)
{
  int	save;

  if (IS_IMMORTAL(ch))
    return(TRUE);

  // determine what type to save against based on spell flags
  if (SPELL_FLAGGED(spell, S_HEAT))
    save = SAVING_THROW(ch, SV_HEAT);
  else
  if (SPELL_FLAGGED(spell, S_COLD))
    save = SAVING_THROW(ch, SV_COLD);
  else
  if (SPELL_FLAGGED(spell, S_MAGIC))
    save = SAVING_THROW(ch, SV_MAGIC);
  else
  if (SPELL_FLAGGED(spell, S_POISON))
    save = SAVING_THROW(ch, SV_POISON);
  else
  if (SPELL_FLAGGED(spell, S_BREATH))
    save = SAVING_THROW(ch, SV_BREATH);
  else
    return TRUE; // nothing to apply saving throw to, return successful

  if (IS_PC(ch)) 
  {
    save += GET_LEVEL(ch) - number(1, 50);
    // soon to add class algorithm here for class bonuses
    // soon to add race algorithm here for race bonuses
  }

  return( ( MAX(1, save) > number(1, 100) ) );
}

/* cant attack someone if they are truced */
BOOL check_truce(chdata *ch, chdata *vict)
{
  int diff;
  BOOL can_attack;

  if (!ch || !vict) return FALSE;

  if (SPC_FLAGGED(vict, SPC_NOKILL))
  {
    act("Forces beyond your comprehension prevent you from attacking $M!", FALSE, ch, 0, vict, TO_CHAR);
    return FALSE;
  }

  diff = GET_LEVEL(ch) - 59;
  if (diff > 0)
    can_attack = ((diff * 5) > number(1, 100));
  else
    can_attack = FALSE;

  if (IS_AFFECTED(vict, AFF_TRUCE) && !can_attack)
  {
    act("The spirit of the frog prevents you from attacking $M!", FALSE, ch, 0, vict, TO_CHAR);
    act("The spirit of the frog stopped $N from attacking you!", FALSE, vict, 0, ch, TO_CHAR);
    act("The spirit of the frog prevented $n from attacking $N!", FALSE, ch, 0, vict, TO_NOTVICT);
    return FALSE;
  }

  if (IS_AFFECTED(ch, AFF_TRUCE))
  {
    send_to_char("The frog spirit is no longer protecting you!!\n\r", ch);
    affect_from_char(ch, SKILL_TRUCE);
  }
  return TRUE;
}

// Allows abbreviated lookups for spells. 05/03/98 -callahan
int find_skill_num(char *name)
{
  int index = 0, ok;
  char *temp, *temp2;
  char first[256], first2[256];

  while (*skill_names[++index] != '\n') {
    if (is_abbrev(name, skill_names[index]))
      return index;

    ok = 1;
    temp = any_one_arg(skill_names[index], first);
    temp2 = any_one_arg(name, first2);
    while (*first && *first2 && ok) {
      if (!is_abbrev(first2, first))
        ok = 0;
      temp = any_one_arg(temp, first);
      temp2 = any_one_arg(temp2, first2);
    }

    if (ok && !*first2)
      return index;
  }

  return -1;
}

// Allows abbreviated lookups for spells. 05/03/98 -callahan
// nother func for gskills...
int find_gskill_num(char *name)
{
  // start index at -1 so hits 0 first...
  int index = -1, ok;
  char *temp, *temp2;
  char first[256], first2[256];

  while (*gskill_names[++index] != '\n') {
    if (is_abbrev(name, gskill_names[index]))
      return index;   
    
    ok = 1;
    temp = any_one_arg(gskill_names[index], first);
    temp2 = any_one_arg(name, first2);
    while (*first && *first2 && ok) {
      if (!is_abbrev(first2, first))
        ok = 0;
      temp = any_one_arg(temp, first);
      temp2 = any_one_arg(temp2, first2);
    }
    
    if (ok && !*first2)
      return index;
  }
 
  return -1;
}


// Modified to accept spellname abbreviation. Parts borrowed from CircleMUD 3.0
// 05/03/98 -callahan
// Made Druids use double mana if in cities, rather than not allowing them to
// cast. 08/09/98 -callahan
/* Assumes that *argument does start with first letter of chopped string */
ACMD(do_cast)
{
  char *argu = argument, name[MAX_STRING_LENGTH], *s, *t;
  obdata *tar_obj;
  chdata *tar_char;
  int	spl, i, max;
  BOOL target_ok;

  if (IN_NOWHERE(ch))
    return;

  if (IS_NPC(ch)) {
    send_to_char("Use mcast.\n\r",ch);
    return;
  }

  if (WAITING(ch)) {
    send_to_char("You cannot cast anything right now!\n\r",ch);
    return;
  }

  // added druids  2/19/98 -jtrhone
  // added rangers  3/31/98 -jtrhone
  if (!IS_WARLOCK(ch) && !IS_MAGE(ch) && !IS_CLERIC(ch) && !IS_MADEPT(ch) &&
      !IS_DRUID(ch) && !IS_RANGER(ch)) {
    send_to_char("You know of no such magic.\n\r",ch);
    return;
  }

  /* get: blank, spell name, target name */
  s = strtok(argu, "'");
  
  if (s == NULL) {
    send_to_char("Cast what where?\r\n", ch);
    return;
  }
  s = strtok(NULL, "'");
  if (s == NULL) {
    send_to_char("This type of magic must be enclosed by the holy magic symbols: '\n\r", ch);
    return;
  }
  t = strtok(NULL, "\0");

  spl = find_skill_num(s);

  if (!spl) {
    send_to_char("Your lips do not move, no magic appears.\n\r", ch);
    return;
  }

  if ((spl > 0) && (spl < MAX_SPELLS) && spell_info[spl].spell_pointer) {
    if (GET_POS(ch) < spell_info[spl].minimum_position) {
      switch (GET_POS(ch)) {
      case POS_SLEEPING :
        send_to_char("You dream about great magical powers.\n\r", ch);
        break;
      case POS_RESTING :
        send_to_char("You can't concentrate enough while resting.\n\r", ch);
        break;
      case POS_SITTING :
        send_to_char("You can't do this while sitting!\n\r", ch);
        break;
      case POS_FIGHTING :
        send_to_char("Impossible!  You can't concentrate enough!\n\r", ch);
        break;
      default:
        send_to_char("It seems like you're in a pretty bad shape!\n\r", ch);
        break;
      } /* Switch */
    } else {
      if (GET_LEVEL(ch) < get_spell_min_level(ch, spl)) {
        send_to_char("Such magic is unknown to you.\n\r", ch);
        return;
      }

      if (ROOM_FLAGGED(ch->in_room, PEACEFUL) && SPELL_FLAGGED(spl, S_VIOLENT)) {
        send_to_char("Your violent magic fizzles out and dies.\n\r", ch);
        return;
      }

      // Added this much-needed check. 08/22/98 -callahan
      if (ZONE_FLAGGED(world[InRoom(ch)].zone, Z_ARENA) &&
          SPELL_FLAGGED(spl, S_SUMMON)) {
        SendChar("Your magic is absorbed by the arena.\r\n", ch);
        return;
      }

      if (ROOM_FLAGGED(ch->in_room, NO_MAGIC)) {
        send_to_char("Forces beyond your comprehension prevent magic here.\n\r",ch);
        return;
      }

      /* **************** Locate targets **************** */

      target_ok = FALSE;
      tar_char = 0;
      tar_obj = 0;

      if (!IS_SET(spell_info[spl].targets, TAR_IGNORE)) 
      {
        /* Find the target , bugfix 5/8/98 -jtrhone */
        if (t) 
        {
          skip_spaces(&t);
          strcpy(name, t);
        } 
        else
          strcpy(name, "");
 
        if (t && *t)   // if there was an argument
        {
          if (IS_SET(spell_info[spl].targets, TAR_CHAR_ROOM))
            if ((tar_char = get_char_room_vis(ch, t)))
              target_ok = TRUE;

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_CHAR_WORLD))
            if ((tar_char = get_char_vis(ch, t)))
              target_ok = TRUE;

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_INV))
            if ((tar_obj = get_obj_in_list_vis(ch, t, ch->carrying)))
              target_ok = TRUE;

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_ROOM))
            if ((tar_obj = get_obj_in_list_vis(ch, t, world[ch->in_room].contents)))
              target_ok = TRUE;

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_WORLD))
            if ((tar_obj = get_obj_vis(ch, t)))
              target_ok = TRUE;

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_EQUIP)) 
            for (i = 0; i < MAX_WEAR && !target_ok; i++)
              if (EQ(ch, i) && !str_cmp(t, EQ(ch, i)->name)) {
                tar_obj = EQ(ch, i);
                target_ok = TRUE;
              }

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_SELF_ONLY))
            if (str_cmp(Name(ch), t) == 0) {
              tar_char = ch;
              target_ok = TRUE;
            }
        } 
        else // No argument.
        { 
          if (IS_SET(spell_info[spl].targets, TAR_FIGHT_SELF))
            if (FIGHTING(ch)) {
              tar_char = ch;
              target_ok = TRUE;
            }

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_FIGHT_VICT))
            if (FIGHTING(ch)) {
              tar_char = FIGHTING(ch);
              target_ok = TRUE;
            }

          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_SELF_ONLY)) {
            tar_char = ch;
            target_ok = TRUE;
          }

          // if no target, and spell isn't violent, default to caster
          // 04/01/98 -callahan
          if (!target_ok && IS_SET(spell_info[spl].targets, TAR_CHAR_ROOM) &&
              !IS_SET(spell_info[spl].spell_bits, S_VIOLENT)) {
            tar_char = ch;
            target_ok = TRUE;
          }
        }
      } 
      else // if TAR_IGNORE, send argument as name -roa
      {	
        /* Find the target , bugfix 5/8/98 -jtrhone */
        if (t) 
        {
          skip_spaces(&t);
          strcpy(name, t);
        } 
        else
          strcpy(name, "");
 
        target_ok = TRUE; /* No target, is a good target */
      }

      if (!target_ok) {
        if (*name && !strstr(name, "'")) {
          if (IS_SET(spell_info[spl].targets, TAR_CHAR_ROOM))  
  	    send_to_char("Nobody here by that name.\n\r", ch);
	  else if (IS_SET(spell_info[spl].targets, TAR_CHAR_WORLD))
	    send_to_char("Nobody playing by that name.\n\r", ch);
	  else if (IS_SET(spell_info[spl].targets, TAR_OBJ_INV))
	    send_to_char("You are not carrying anything like that.\n\r", ch);
	  else if (IS_SET(spell_info[spl].targets, TAR_OBJ_ROOM))
	    send_to_char("Nothing here by that name.\n\r", ch);
	  else if (IS_SET(spell_info[spl].targets, TAR_OBJ_WORLD))
            send_to_char("Nothing at all by that name.\n\r", ch);
          else if (IS_SET(spell_info[spl].targets, TAR_OBJ_EQUIP))
	    send_to_char("You are not wearing anything like that.\n\r", ch);
	  else if (IS_SET(spell_info[spl].targets, TAR_OBJ_WORLD))
	    send_to_char("Nothing at all by that name.\n\r", ch);
        } else { /* Nothing was given as argument */
          if (spell_info[spl].targets < TAR_OBJ_INV)
  	    send_to_char("Who should the spell be cast upon?\n\r", ch);
          else
            send_to_char("What should the spell be cast upon?\n\r", ch);
        }
        return;
      } else { /* TARGET IS OK */
        if ((tar_char == ch) && 
             IS_SET(spell_info[spl].targets, TAR_SELF_NONO)) {
          send_to_char("You cannot cast this spell upon yourself.\n\r", ch);
          return;
        } else if ((tar_char != ch) && 
                    IS_SET(spell_info[spl].targets, TAR_SELF_ONLY)) {
          send_to_char("You can only cast this spell upon yourself.\n\r", ch);
          return;
        } else if (IS_AFFECTED(ch, AFF_CHARM) && (ch->master == tar_char)) {
          send_to_char("Such an action could harm your master!\n\r",ch);
          return;
        }
      }

      /* check for assassins */
      // removed duplicate messages being sent  4/19/98 -jtrhone
      if (tar_char && SPELL_FLAGGED(spl, S_VIOLENT) && !check_mortal_combat(ch, tar_char))
        return;

      /* violent spells must be truce checked! */
      if (tar_char && SPELL_FLAGGED(spl, S_VIOLENT) && !check_truce(ch, tar_char))
        return;

      if (!IS_IMMORTAL(ch) && (GET_MANA(ch) < manause(ch, spl))) {
        send_to_char("You can't summon enough energy to cast the spell.\n\r", ch);
        return;
      }

      WAIT_STATE(ch, spell_info[spl].beats);

      if (!spell_info[spl].spell_pointer && spl > 0)
      {
        send_to_char("Sorry, this magic has not yet been implemented :(\n\r", ch);
        return;
      }

      // better chance to fail if cursed... 6/24/98 -jtrhone
      max = 101;
      if (IS_AFFECTED(ch, AFF_CURSE)) 
        max = 200;

      if (number(1, max) > GET_SKILL(ch, spl)) 
      {
        send_to_char("You lost your concentration!\n\r", ch);

        if ((world[InRoom(ch)].terrain_type == TERRAIN_CITY) && IS_DRUID(ch))
          GET_MANA(ch) -= ((manause(ch, spl) * 2) >> 1);
        else
          GET_MANA(ch) -= (manause(ch, spl) >> 1);
        return;
      }

      say_spell(ch, spl);  // Was missing. 08/08/98 -callahan
      do_cast_spell(spl, ch, name, SPELL_TYPE_SPELL, tar_char, tar_obj);

     if ((world[InRoom(ch)].terrain_type == TERRAIN_CITY) && IS_DRUID(ch))
       GET_MANA(ch) -= (manause(ch, spl) * 2);
     else
       GET_MANA(ch) -= (manause(ch, spl));
    }
    return;
  }

  switch (number(1, 5)) {
  case 1:
     send_to_char("Bylle Grylle Grop Gryf???\n\r", ch);
     break;
  case 2:
     send_to_char("Olle Bolle Snop Snyf?\n\r", ch);
     break;
  case 3:
     send_to_char("Olle Grylle Bolle Bylle?!?\n\r", ch);
     break;
  case 4:
     send_to_char("Gryffe Olle Gnyffe Snop???\n\r", ch);
     break;
  default:
     send_to_char("Bolle Snylle Gryf Bylle?!!?\n\r", ch);
     break;
  }
}


/* Assumes that *argument does start with first letter of chopped string */
// this is MOBS version of do_cast, doesnt check skills
ACMD(do_mcast)
{
   char *argu = argument, name[MAX_STRING_LENGTH], *s, *t;
   int	spl, i;
   BOOL target_ok;
   obdata *tar_obj;
   chdata *tar_char;

   if (IN_NOWHERE(ch)) return;

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

   if (WAITING(ch))
   {
     send_to_char("You cannot cast anything right now!\n\r",ch);
     return;
   }

   if (CHARMED(ch))
   {
     send_to_char("You need control of your mental abilities to cast!\n\r",ch);
     return;
   }

   if (CHAR_FLAGGED(ch, CH_BECAME))
   {
     send_to_char("You cannot cast anything while posessed!\n\r",ch);
     return;
   }

   /* get: blank, spell name, target name */
   s = strtok(argu, "'");
  
   if (s == NULL) {
     send_to_char("Cast what where?\r\n", ch);
     return;
   }
   s = strtok(NULL, "'");
   if (s == NULL) {
     send_to_char("This type of magic must be enclosed by the holy magic symbols: '\n\r", ch);
     return;
   }
   t = strtok(NULL, "\0");

   spl = find_skill_num(s);

   if (!spl) {
      send_to_char("Your lips do not move, no magic appears.\n\r", ch);
      return;
   }

   if ((spl > 0) && (spl < MAX_SPELLS) && spell_info[spl].spell_pointer)
   {
      if (GET_POS(ch) < spell_info[spl].minimum_position) 
      {
	 switch (GET_POS(ch)) 
         {
	 case POS_SLEEPING :
	    send_to_char("You dream about great magical powers.\n\r", ch);
	    break;
	 case POS_RESTING :
	    send_to_char("You can't concentrate enough while resting.\n\r", ch);
	    break;
	 case POS_SITTING :
	    send_to_char("You can't do this sitting!\n\r", ch);
	    break;
	 case POS_FIGHTING :
	    send_to_char("Impossible!  You can't concentrate enough!\n\r", ch);
	    break;
	 default:
	    send_to_char("It seems like you're in a pretty bad shape!\n\r", ch);
	    break;
	 } /* Switch */
      }	 
      else 
      {
         if(ROOM_FLAGGED(ch->in_room, PEACEFUL) && SPELL_FLAGGED(spl,S_VIOLENT))
	 {
           send_to_char("Your violent magic fizzles out and dies.\n\r", ch);
           return;
         }

         if(ROOM_FLAGGED(ch->in_room, NO_MAGIC)) 
	 {
	   send_to_char("Forces beyond your comprehension prevent magic here.\n\r",ch);
	   return;
	 }

	 /* **************** Locate targets **************** */

	 target_ok = FALSE;
	 tar_char = 0;
	 tar_obj = 0;

	 if (!IS_SET(spell_info[spl].targets, TAR_IGNORE)) 
	 {
             /* Find the target , bugfix 5/8/98 -jtrhone */
             if (t) 
             {
               skip_spaces(&t);
               strcpy(name, t);
             } 
             else
               strcpy(name, "");

	    if (*name) 
	    {
	       if (IS_SET(spell_info[spl].targets, TAR_CHAR_ROOM))
		  if ((tar_char = get_char_room_vis(ch, name)))
		     target_ok = TRUE;

	       if (!target_ok && IS_SET(spell_info[spl].targets, TAR_CHAR_WORLD))
		  if ((tar_char = get_char_vis(ch, name)))
		     target_ok = TRUE;

	       if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_INV))
		  if ((tar_obj = get_obj_in_list_vis(ch, name, ch->carrying)))
		     target_ok = TRUE;

	       if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_ROOM))
		  if ((tar_obj = get_obj_in_list_vis(ch, name, world[ch->in_room].contents)))
		     target_ok = TRUE;

	       if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_WORLD))
		  if ((tar_obj = get_obj_vis(ch, name)))
		     target_ok = TRUE;

	       if (!target_ok && IS_SET(spell_info[spl].targets, TAR_OBJ_EQUIP)) 
		  for (i = 0; i < MAX_WEAR && !target_ok; i++)
		     if (EQ(ch, i) && !str_cmp(name, EQ(ch, i)->name)) 
		     {
			tar_obj = EQ(ch, i);
			target_ok = TRUE;
		     }

	       if (!target_ok && IS_SET(spell_info[spl].targets, TAR_SELF_ONLY))
		  if (!str_cmp(GET_NAME(ch), name))
		  {
		     tar_char = ch;
		     target_ok = TRUE;
		  }

	    } 
	    else /* no argument */
	    {
	      if (IS_SET(spell_info[spl].targets, TAR_FIGHT_SELF) && FIGHTING(ch))
	      {
		tar_char = ch;
		target_ok = TRUE;
	      }

	      if (!target_ok && IS_SET(spell_info[spl].targets, TAR_FIGHT_VICT) && FIGHTING(ch))
	      {
		 tar_char = FIGHTING(ch);
		 target_ok = TRUE;
	      }

	      if (!target_ok && IS_SET(spell_info[spl].targets, TAR_SELF_ONLY)) 
	      {
		tar_char = ch;
		target_ok = TRUE;
	      }
	    }
	 } 
	 else
	 {
	   // if TAR_IGNORE, send argument as name -roa
           /* Find the target , bugfix 5/8/98 -jtrhone */
           if (t) 
           {
             skip_spaces(&t);
             strcpy(name, t);
           } 
           else
             strcpy(name, "");
 
           target_ok = TRUE; /* No target, is a good target */
	 }
         
	 if (!target_ok) 
	 {
	    if (*name) 
	    {
	       if (IS_SET(spell_info[spl].targets, TAR_CHAR_ROOM))
		  send_to_char("Nobody here by that name.\n\r", ch);
	       else if (IS_SET(spell_info[spl].targets, TAR_CHAR_WORLD))
		  send_to_char("Nobody playing by that name.\n\r", ch);
	       else if (IS_SET(spell_info[spl].targets, TAR_OBJ_INV))
		  send_to_char("You are not carrying anything like that.\n\r", ch);
	       else if (IS_SET(spell_info[spl].targets, TAR_OBJ_ROOM))
		  send_to_char("Nothing here by that name.\n\r", ch);
	       else if (IS_SET(spell_info[spl].targets, TAR_OBJ_WORLD))
		  send_to_char("Nothing at all by that name.\n\r", ch);
	       else if (IS_SET(spell_info[spl].targets, TAR_OBJ_EQUIP))
		  send_to_char("You are not wearing anything like that.\n\r", ch);
	       else if (IS_SET(spell_info[spl].targets, TAR_OBJ_WORLD))
		  send_to_char("Nothing at all by that name.\n\r", ch);

	    } 
	    else 
	    { /* Nothing was given as argument */
	       if (spell_info[spl].targets < TAR_OBJ_INV)
		  send_to_char("Who should the spell be cast upon?\n\r", ch);
	       else
		  send_to_char("What should the spell be cast upon?\n\r", ch);
	    }
	    return;
	 } 
         else 
	 { /* TARGET IS OK */
	    if ((tar_char == ch) && IS_SET(spell_info[spl].targets, TAR_SELF_NONO)) 
	    {
	       send_to_char("You cannot cast this spell upon yourself.\n\r", ch);
	       return;
	    } 
	    else 
	    if ((tar_char != ch) && 
		 IS_SET(spell_info[spl].targets, TAR_SELF_ONLY)) 
	    {
	       send_to_char("You can only cast this spell upon yourself.\n\r", ch);
	       return;
	    } 
	    else 
	    if (IS_AFFECTED(ch, AFF_CHARM) && (ch->master == tar_char)) {
	       send_to_char("Such an action could harm your master!\n\r",ch);
	       return;
	    }
	 }
            /* check for assassins */
	 if (tar_char && SPELL_FLAGGED(spl, S_VIOLENT) && !check_mortal_combat(ch, tar_char))
         {
	   send_to_char("%1Assassin%0 vs %1Assassin%0 only!\n\r",ch);
	   return;
	 } 

	 /* violent spells must be truce checked! */
	 if (tar_char && SPELL_FLAGGED(spl, S_VIOLENT) && !check_truce(ch, tar_char))
           return;

	 if (GET_MANA(ch) < manause(ch, spl))
	 {
	   send_to_char("You can't summon enough energy to cast the spell.\n\r", ch);
	   return;
	 }

	 if (!spell_info[spl].spell_pointer && spl > 0)
	    send_to_char("Sorry, this magic has not yet been implemented :(\n\r", ch);
	 else 
	 {
            say_spell(ch, spl);  // Was missing. 08/08/98 -callahan
	    do_cast_spell(spl, ch, name, SPELL_TYPE_SPELL, tar_char, tar_obj);
	    GET_MANA(ch) -= (manause(ch, spl));
	 }
      }	/* if GET_POS < min_pos */
      return;
   }
   send_to_char("Unknown spell.\n\r", ch);
}

// assign general skill/dialect names...
void gskillo(int nr, char *sklname, int level, int rcbitv, int max_perc, int bitv)
{
  if (nr < 0 || nr > MAX_GSKILLS)
  {
    sprintf(buf, "SYSHALT:  GSkill > %d.", MAX_GSKILLS);
    log(buf);
    exit(-1);
  }

  if (strlen(sklname)+1 > 30)
  {
    sprintf(buf, "SYSHALT:  GSkill name %s > 30.", sklname);
    log(buf);
    exit(-1);
  }

  strcpy(gskill_names[nr], sklname);
  GSKILL_LEVEL(nr)   = level;
  GSKILL_MAXPERC(nr) = max_perc;
  GSKILL_RCFLAGS(nr) = rcbitv;
  GSKILL_FLAGS(nr)   = bitv;
}

// now assign spell name into skill_names array via spello  6/20/98 -jtrhone
void spello(int nr, char *sklname, int beat, int pos, int mana, int tar, 
	    int(*func)(chdata *ch,char *arg,chdata *victim,obdata *obj))
{
  spell_info[nr].spell_pointer = (func);   
  spell_info[nr].beats = (beat);            
  spell_info[nr].minimum_position = (pos);  
  spell_info[nr].min_usesmana = (mana);     
  spell_info[nr].targets = (tar); 

  // now assign spell name into skill_names array via spello  6/20/98 -jtrhone
  if (strlen(sklname)+1 > 30)
  {
    sprintf(buf, "SYSHALT:  Skill name %s > 30.", sklname);
    log(buf);
    exit(-1);
  }

  strcpy(skill_names[nr], sklname);
 
  // spell_bits get set after spello call if needed
}

// assign spell a wearoff message
void set_wearoff(int nr, char *msg)
{
  spell_info[nr].wear_off = STR_DUP(msg);
}

// assign function to spells, set appropriate spell_bit flags
// such as violent, castable, potionable, etc -roa
// set wearoff messages as appropriate upon init  11/29/97 -jtrhone
void	assign_skills(void)
{
   int i;

   // updated cleanout 7/8/98 -jtrhone

   // clear out all fields of the spell info struct
   for (i = 0; i < MAX_SPELLS; i++)
     spello(i, "", 0, 0, 0, 0, 0);

   // do same for gskills...
   for (i = 0; i < MAX_GSKILLS; i++)
     gskillo(i, "", 0, 0, 0, 0);

   // set top and bottom range 6/20/98 -jtrhone
   spello(SKILL_ZERO, "zzzzzzz", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(MAX_SKILLS-1, "\n", 0, POS_STANDING, 0, TAR_IGNORE, 0);

   // Various stuff... 08/06/98 -callahan
   spello(SPELL_ANIMATE_DEAD, "animate dead", 12, POS_STANDING, 60, TAR_IGNORE, spell_animate_dead);
   FLAG_SPELL(SPELL_ANIMATE_DEAD, S_CASTABLE | S_MAGIC | S_SUMMON);

   spello(SPELL_ARMOR_GOLEM, "armor golem", 12, POS_STANDING, 50, TAR_IGNORE, spell_armor_golem);
   FLAG_SPELL(SPELL_ARMOR_GOLEM, S_CASTABLE | S_MAGIC | S_SUMMON);

   spello(SPELL_FORCEFUL_WIND, "forceful wind", 12, POS_FIGHTING, 20, TAR_IGNORE, spell_forceful_wind);
   FLAG_SPELL(SPELL_FORCEFUL_WIND, S_VIOLENT | S_CASTABLE | S_MAGIC);

   spello(SKILL_SNEAK, "sneak", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_SNEAK, "You are no longer sneaking.");
   spello(SKILL_STEAL, "steal", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_HIDE, "hide", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_BACKSTAB, "backstab", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_PICK_LOCK, "pick lock", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_REDIRECT, "redirect", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_FIRST_AID, "firstaid", 30, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_DUAL, "dual wield", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_CIRCLE, "circle", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SUBDUE, "subdue", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DETECTTRAP, "detect trap", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DETECTSNARE, "detect snare", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_REMOVETRAP, "remove trap", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_REMOVESNARE, "remove snare", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DARTTRAP, "darttrap", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_POISONTRAP, "poisontrap", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_FIRETRAP, "firetrap", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_LIGHTNINGTRAP, "lightningtrap", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_EAVESDROP, "eavesdrop", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_BREW, "brew poison", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_BREW, "You stop brewing your poison.");
   spello(SKILL_TPOISON, "thieves poison", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SEALEXIT, "seal exit", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_BLINDSTRIKE, "blindstrike", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_JAMLOCK, "jam lock", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_POISONBLADE, "poisonblade", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SETSNARE, "snare set", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_LOWSTRIKE, "lowstrike", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_BLADEDANCE, "bladedance", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SHADOWWALK, "shadowwalk", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SIDESTEP, "sidestep", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DISEMBOWEL, "disembowel", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DETECTSECRET, "detect secret", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_TUMBLE, "tumble", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_OBSCURE, "obscure exit", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_HAMSTRING, "hamstring", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_ASSASSINATE, "assassinate", 0, POS_STANDING, 0, TAR_IGNORE, 0);

   spello(SKILL_FORTIFY, "fortify", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_FORTIFY, "Your fortification has faded.");
   spello(SKILL_GRAPPLE, "grapple", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SHIELDBLOCK, "shieldblock", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_KICK, "kick", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_BASH, "bash", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_RESCUE, "rescue", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DOUBLE, "double attack", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_TRIPLE, "triple attack", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DISARM, "disarm", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_STUNTOUCH, "stuntouch", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_HURL, "hurl", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_WAR_ENDURANCE, "endurance", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_DODGE, "dodge", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_PARRY, "parry", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_FENGAGE, "forced engage", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_CRIPPLE, "cripple", 0, POS_RESTING, 0, TAR_IGNORE,0);
   spello(SKILL_DOORBASH, "door bash", 0, POS_RESTING, 0, TAR_IGNORE,0);

   spello(SKILL_PURGE, "rite of purification", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_ELUSION, "rite of elusion", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_ELUSION, "The weasel spirit has fled.");
   spello(SKILL_FORTITUDE, "rite of fortitude", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_SNAKE_FIRE, "rite of snake fire", 60, POS_FIGHTING, 0, TAR_IGNORE, 0);
   FLAG_SPELL(SKILL_SNAKE_FIRE, S_VIOLENT | S_POISON);
   spello(SKILL_ENDURANCE, "rite of endurance", 60, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_SP_STRENGTH, "rite of spirit strength", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_SP_STRENGTH, "The bear spirit has fled.");
   spello(SKILL_PROTECTION, "rite of protection", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_TRUESIGHT, "rite of true sight", 90, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_TRUESIGHT, "The hawk spirit has fled.");
   spello(SKILL_EAGLE_EYES, "rite of eagle eyes", 100, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_EAGLE_EYES, "The eagle spirit has fled.");
   spello(SKILL_HEAL, "rite of healing", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_LOCATION, "rite of location", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_TRUCE, "rite of truce", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_TRUCE, "The frog spirit has fled.");
   spello(SKILL_FANG, "rite of fang", 90, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_CROW, "rite of crow", 60, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_CROW, "The crow spirit has fled.");
   spello(SKILL_CLAWS, "rite of cougar", 90, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_CLAWS, "Your claws meld back into their original form.");
   spello(SKILL_WOLF, "rite of wolf", 90, POS_RESTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_WOLF, "The wolf spirit has fled.");
   spello(SKILL_STONE, "rite of stone", 60, POS_RESTING, 0, TAR_IGNORE, 0);

   spello(SKILL_FORAGE, "forage", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_HEALWOUNDS, "healwounds", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_DIVINE, "divine", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SKIN, "skin prey", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_FILET, "filet", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_BEFRIEND, "befriend", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_CAMOUFLAGE, "camouflage", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_WHIRLWIND, "whirlwind", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_SILENTWALK, "silentwalk", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_SILENTWALK, "Your silence while walking has faded.");
   spello(SKILL_SWEEP, "sweep", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_CALL_WILDLIFE, "wildcall", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   spello(SKILL_BECOME, "meld spirit", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_BECOME, "Your natural being has pulled you back.");
   spello(SKILL_PRESENCE, "presence", 0, POS_FIGHTING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_PRESENCE, "Your mind loses contact with the wild.");
   spello(SKILL_TREK, "trek", 0, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SKILL_NOTRACK, "notrack", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SKILL_CREATE_TORCH, "create torch", 0, POS_STANDING, 0, TAR_IGNORE, 0);
   spello(SPELL_POISON_DART, "dart of poison", 12, POS_FIGHTING, 10, 
	  TAR_CHAR_ROOM | TAR_SELF_NONO | TAR_OBJ_INV | TAR_OBJ_EQUIP | TAR_FIGHT_VICT, 
          spell_poison_dart);
   FLAG_SPELL(SPELL_POISON_DART, S_VIOLENT | S_CASTABLE | S_POISON);
   // Changed 'disolved' to 'dissolved' 03/26/98 -callahan
   set_wearoff(SPELL_POISON_DART, "The poison invading your body has dissolved.");
   spello(SPELL_FOREST_SIGHT, "forest sight", 12, POS_STANDING, 20, TAR_CHAR_ROOM, spell_forest_sight);
   FLAG_SPELL(SPELL_FOREST_SIGHT, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_FOREST_SIGHT, "Your forest sight has faded.");
   spello(SKILL_TRAILBLAZE, "trailblaze", 0, POS_RESTING, 0, TAR_IGNORE, 0);
   spello(SPELL_EARTHDARTS, "earthdarts", 12, POS_FIGHTING, 20, TAR_CHAR_ROOM | TAR_SELF_NONO | TAR_FIGHT_VICT, spell_earthdarts);
   FLAG_SPELL(SPELL_EARTHDARTS, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_SPIRITLEAVES, "spirit leaves", 12, POS_FIGHTING, 5, 
          TAR_CHAR_ROOM | TAR_SELF_NONO | TAR_FIGHT_VICT, spell_spiritleaves);
   FLAG_SPELL(SPELL_SPIRITLEAVES, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL | S_MAGIC);
   set_wearoff(SPELL_SPIRITLEAVES, "You feel the spirit leaves leave you.");

   spello(SPELL_ENTANGLE, "entangle", 12, POS_FIGHTING, 75, TAR_CHAR_ROOM | TAR_SELF_NONO | TAR_FIGHT_VICT, spell_entangle);
   FLAG_SPELL(SPELL_ENTANGLE, S_VIOLENT | S_CASTABLE | S_SCROLL | S_MAGIC);
   set_wearoff(SPELL_ENTANGLE, "You feel yourself become untangled.");

   spello(SPELL_BARKSKIN, "barkskin", 12, POS_STANDING, 35, TAR_CHAR_ROOM, spell_barkskin);
   FLAG_SPELL(SPELL_BARKSKIN, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_BARKSKIN, "Your barkskin returns to normal.");

   spello(SPELL_SPIRITBALM, "spirit balm", 12, POS_FIGHTING, 50, TAR_CHAR_ROOM, spell_spiritbalm);
   FLAG_SPELL(SPELL_SPIRITBALM, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_SPIRITSHOCK, "spirit shock", 12, POS_FIGHTING, 35, TAR_CHAR_ROOM | TAR_SELF_NONO | TAR_FIGHT_VICT, 
          spell_spiritshock);
   FLAG_SPELL(SPELL_SPIRITSHOCK, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SKILL_MEDITATE, "meditate", 0, POS_STANDING, 0, TAR_IGNORE, 0);

   spello(SPELL_FORESTEYES, "forest eyes", 12, POS_STANDING, 5, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_foresteyes);
   FLAG_SPELL(SPELL_FORESTEYES, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_FORESTEYES, "You sense the eyes of the forest fade.");

   spello(SPELL_ENSNARE, "ensnare", 12, POS_STANDING, 100, TAR_CHAR_ROOM | TAR_SELF_NONO , spell_ensnare);
   FLAG_SPELL(SPELL_ENSNARE, S_VIOLENT | S_CASTABLE | S_SCROLL | S_MAGIC);
   set_wearoff(SPELL_ENSNARE, "You find yourself able to move once more.");

   spello(SPELL_OCCLUSION, "fog of occlusion", 12, POS_FIGHTING, 75, TAR_IGNORE, spell_occlusion);
   FLAG_SPELL(SPELL_OCCLUSION, S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_CAMPFIRE, "campfire", 12, POS_STANDING, 80, TAR_IGNORE, spell_campfire);
   FLAG_SPELL(SPELL_CAMPFIRE, S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SKILL_CYCLONE, "cyclone", 12, POS_STANDING, 0, TAR_IGNORE, 0);

   spello(SPELL_SPIRITSHIELD, "spirit shield", 12, POS_STANDING, 75, TAR_CHAR_ROOM, spell_spiritshield);
   FLAG_SPELL(SPELL_SPIRITSHIELD, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_SPIRITSHIELD, "The glowing aura surrounding your spirit fades.");

   spello(SKILL_SING, "sing", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_SING, "Your song has ended.");
   spello(SKILL_PLAY, "play", 12, POS_STANDING, 0, TAR_IGNORE, 0);
   set_wearoff(SKILL_PLAY, "Your song has ended.");
   spello(SKILL_CRAFT, "craft", 12, POS_STANDING, 0, TAR_IGNORE, 0);

   spello(SKILL_AURA, "aura", 12, POS_STANDING, 5, TAR_IGNORE, 0);
   spello(SKILL_SENSE, "sense tranquility", 12, POS_RESTING, 5, TAR_IGNORE, 0);
   spello(SKILL_ROLL, "rabbit roll", 12, POS_STANDING, 10, TAR_IGNORE, 0);
   set_wearoff(SKILL_ROLL, "You stop rolling like the rabbit.");
   spello(SKILL_SNARL, "tiger snarl", 12, POS_STANDING, 35, TAR_IGNORE, 0);
   spello(SKILL_RAZOR, "razor nail", 12, POS_STANDING, 10, TAR_IGNORE, 0);
   set_wearoff(SKILL_RAZOR, "You stop hitting as sharply.");
   spello(SKILL_LEVITATE, "levitation", 12, POS_STANDING, 30, TAR_IGNORE, 0);
   set_wearoff(SKILL_LEVITATE, "Your levitation wears off.");
   spello(SKILL_OM, "om", 12, POS_STANDING, 15, TAR_IGNORE, 0);
   set_wearoff(SKILL_OM, "Your 'om' meditation technique wears off.");
   spello(SKILL_MOK, "mok", 12, POS_STANDING, 25, TAR_IGNORE, 0);
   set_wearoff(SKILL_MOK, "Your 'mok' meditation technique wears off.");
   spello(SKILL_IRON, "iron skin", 12, POS_FIGHTING, 60, TAR_IGNORE, 0);
   set_wearoff(SKILL_IRON, "Your iron skin returns to normal.");
   spello(SKILL_LEAP, "cheetah leap", 12, POS_STANDING, 25, TAR_IGNORE, 0);
   set_wearoff(SKILL_LEAP, "Your cheetah leaping technique has faded.");
   spello(SKILL_FLIP, "fox flip", 12, POS_STANDING, 40, TAR_IGNORE, 0);
   set_wearoff(SKILL_FLIP, "Your fox flipping technique has faded.");
   spello(SKILL_TURTLE, "turtle shell", 12, POS_STANDING, 65, TAR_IGNORE, 0);
   set_wearoff(SKILL_TURTLE, "Your 'turtle shell' defense technique has faded.");
   spello(SKILL_WA, "wa", 12, POS_STANDING, 40, TAR_IGNORE, 0);
   set_wearoff(SKILL_WA, "Your 'wa' meditation technique wears off.");
   spello(SKILL_TRANCE, "trance", 12, POS_STANDING, 65, TAR_IGNORE, 0);
   set_wearoff(SKILL_TRANCE, "You slip back into reality from your trance.");
   spello(SKILL_STONE_FINGER, "stone finger", 12, POS_FIGHTING, 25, TAR_IGNORE, 0);
   set_wearoff(SKILL_STONE_FINGER, "Your 'stone finger' attack technique has faded.");
   spello(SKILL_FIST, "fist of lightning", 12, POS_FIGHTING, 65, TAR_IGNORE, 0);
   set_wearoff(SKILL_FIST, "Your lightning fists have returned to normal.");
   spello(SKILL_HASTEN, "hasten self", 12, POS_FIGHTING, 55, TAR_IGNORE, 0);
   set_wearoff(SKILL_HASTEN, "Your hastened abilities have vanished.");
   spello(SKILL_CLEANSE, "cleanse", 12, POS_RESTING, 20, TAR_IGNORE, 0);
   set_wearoff(SKILL_CLEANSE, "You feel vulnerable to poison once more.");
   spello(SKILL_IRONHAND, "iron hands", 12, POS_RESTING, 40, TAR_IGNORE,0);
   set_wearoff(SKILL_IRONHAND, "Your hands have lost their touch of iron.");

   spello(SPELL_MAGIC_MISSILE, "magic missile", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_magic_missile);
   FLAG_SPELL(SPELL_MAGIC_MISSILE, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_CHILL_TOUCH, "chill touch", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_chill_touch);
   FLAG_SPELL(SPELL_CHILL_TOUCH, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_BURNING_HANDS, "burning hands", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_burning_hands);
   FLAG_SPELL(SPELL_BURNING_HANDS, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_HEAT);

   spello(SPELL_SHOCKING_GRASP, "shocking grasp", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_shocking_grasp);
   FLAG_SPELL(SPELL_SHOCKING_GRASP, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_LIGHTNING_BOLT, "lightning bolt", 12, POS_FIGHTING, 50, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_lightning_bolt);
   FLAG_SPELL(SPELL_LIGHTNING_BOLT, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_CHAIN_LIGHTNING,  "chain lightning", 40, POS_FIGHTING, 100, 
	  TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_chain_lightning);
   FLAG_SPELL(SPELL_CHAIN_LIGHTNING,  S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_COLOUR_SPRAY, "color spray", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_colour_spray);
   FLAG_SPELL(SPELL_COLOUR_SPRAY, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_ENERGY_DRAIN, "energy drain", 12, POS_FIGHTING, 35, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_energy_drain);
   FLAG_SPELL(SPELL_ENERGY_DRAIN, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_FIREFLASH, "fireflash", 12, POS_FIGHTING, 50, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_fireflash);
   FLAG_SPELL(SPELL_FIREFLASH, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_HEAT);

   spello(SPELL_FIREBALL, "fireball", 40, POS_FIGHTING, 100, TAR_IGNORE, spell_fireball);
   FLAG_SPELL(SPELL_FIREBALL, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_HEAT);

   spello(SPELL_FIREWALL, "firewall", 12, POS_STANDING, 50, TAR_IGNORE, spell_firewall);
   FLAG_SPELL(SPELL_FIREWALL, S_VIOLENT | S_CASTABLE | S_SCROLL | S_HEAT);

   spello(SPELL_ICEWALL, "icestorm", 12, POS_STANDING, 50, TAR_IGNORE,spell_icewall);
   FLAG_SPELL(SPELL_ICEWALL, S_VIOLENT | S_CASTABLE | S_SCROLL | S_COLD);

   spello(SPELL_TYPHOON, "typhoon", 12, POS_STANDING, 60, TAR_IGNORE, spell_typhoon);
   FLAG_SPELL(SPELL_TYPHOON, S_VIOLENT | S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_VOID, "temporal void", 12, POS_STANDING, 50, TAR_IGNORE, spell_void);
   FLAG_SPELL(SPELL_VOID, S_VIOLENT | S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_GASCLOUD, "gascloud", 12, POS_STANDING, 50, TAR_IGNORE, spell_gascloud);
   FLAG_SPELL(SPELL_GASCLOUD, S_VIOLENT | S_CASTABLE | S_SCROLL | S_POISON);
   set_wearoff(SPELL_GASCLOUD, "You feel you can breathe much easier now.");

   spello(SPELL_BLINDWALL, "cloak of blindness", 12, POS_STANDING, 50, TAR_IGNORE, spell_blindwall);
   FLAG_SPELL(SPELL_BLINDWALL, S_VIOLENT | S_CASTABLE | S_SCROLL | S_MAGIC);
   set_wearoff(SPELL_BLINDWALL, "The cloak of blindess surrounding you has vanished.");

   spello(SPELL_CONFUSION, "confusion", 12, POS_STANDING, 55, TAR_IGNORE, spell_confusion);
   FLAG_SPELL(SPELL_CONFUSION, S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_SWARM, "swarm", 12, POS_FIGHTING, 90, TAR_IGNORE, spell_swarm);
   FLAG_SPELL(SPELL_SWARM, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_EARTHQUAKE, "earthquake", 12, POS_FIGHTING, 15, TAR_IGNORE, spell_earthquake);
   FLAG_SPELL(SPELL_EARTHQUAKE, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_DISPEL_EVIL, "dispel evil", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_dispel_evil);
   FLAG_SPELL(SPELL_DISPEL_EVIL, S_VIOLENT | S_CASTABLE | S_SCROLL | S_POTION | S_WAND | S_MAGIC);

   spello(SPELL_CALL_LIGHTNING, "call lightning", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_call_lightning);
   FLAG_SPELL(SPELL_CALL_LIGHTNING, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_HARM, "harm", 12, POS_FIGHTING, 35, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_harm);
   FLAG_SPELL(SPELL_HARM, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_ARMOR, "armor", 12, POS_STANDING, 5, TAR_CHAR_ROOM, spell_armor);
   FLAG_SPELL(SPELL_ARMOR, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_ARMOR, "You feel less protected.");

   spello(SPELL_TELEPORT, "teleport", 12, POS_FIGHTING, 35, TAR_SELF_ONLY, spell_teleport);
   FLAG_SPELL(SPELL_TELEPORT, S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_BLESS, "bless", 12, POS_STANDING, 5, TAR_OBJ_INV | TAR_OBJ_EQUIP | TAR_CHAR_ROOM, spell_bless);
   FLAG_SPELL(SPELL_BLESS, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_BLESS, "You feel less righteous.");

   spello(SPELL_BLINDNESS, "blindness", 12, POS_FIGHTING, 5, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_blindness);
   FLAG_SPELL(SPELL_BLINDNESS, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   // Changed 'disolved' to 'dissolved' 03/26/98 -callahan
   set_wearoff(SPELL_BLINDNESS, "You feel a cloak of blindness dissolve.");

   spello(SPELL_CHARM_PERSON, "charm person", 12, POS_STANDING, 30, TAR_CHAR_ROOM | TAR_SELF_NONO, spell_charm_person);
   FLAG_SPELL(SPELL_CHARM_PERSON, S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);
   set_wearoff(SPELL_CHARM_PERSON, "You feel more like yourself again.");

   spello(SPELL_KNOCK, "knock", 12, POS_STANDING, 40, TAR_IGNORE, spell_knock);

   spello(SPELL_CONTROL_WEATHER, "control weather", 12, POS_STANDING, 25, TAR_IGNORE, spell_control_weather);
   FLAG_SPELL(SPELL_CONTROL_WEATHER, S_CASTABLE | S_MAGIC);

   spello(SPELL_CREATE_FOOD, "create food", 12, POS_STANDING, 5, TAR_IGNORE, spell_create_food);
   FLAG_SPELL(SPELL_CREATE_FOOD, S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_CREATE_WATER, "create water", 12, POS_STANDING, 5, TAR_OBJ_INV | TAR_OBJ_EQUIP, spell_create_water);
   FLAG_SPELL(SPELL_CREATE_WATER, S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_CURE_BLIND, "cure blindness", 12, POS_STANDING, 5, TAR_CHAR_ROOM, spell_cure_blind);
   FLAG_SPELL(SPELL_CURE_BLIND, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_CURE_CRITIC, "cure critic", 12, POS_FIGHTING, 20, TAR_CHAR_ROOM, spell_cure_critic);
   FLAG_SPELL(SPELL_CURE_CRITIC, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_CURE_LIGHT, "cure light", 12, POS_FIGHTING, 15, TAR_CHAR_ROOM, spell_cure_light);
   FLAG_SPELL(SPELL_CURE_LIGHT, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_CURSE, "curse", 12, POS_STANDING, 20, TAR_CHAR_ROOM | TAR_OBJ_ROOM | 
	  TAR_OBJ_INV | TAR_OBJ_EQUIP | TAR_FIGHT_VICT, spell_curse);
   FLAG_SPELL(SPELL_CURSE, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_CURSE, "Your soul feels cleaner .");

   spello(SPELL_DETECT_EVIL, "detect evil", 12, POS_STANDING, 5, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_detect_evil);
   FLAG_SPELL(SPELL_DETECT_EVIL, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_DETECT_EVIL, "You sense your awareness of evil fade.");

   spello(SPELL_DETECT_INVISIBLE, "detect invisibility", 12, POS_STANDING, 5, 
	  TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_detect_invisibility);
   FLAG_SPELL(SPELL_DETECT_INVISIBLE, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_DETECT_INVISIBLE, "You sense your invisibility awareness fade.");

   spello(SPELL_DETECT_MAGIC, "detect magic", 12, POS_STANDING, 5, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_detect_magic);
   FLAG_SPELL(SPELL_DETECT_MAGIC, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_DETECT_MAGIC, "You sense your magical awareness fade.");

   spello(SPELL_DETECT_POISON, "detect poison", 12, POS_STANDING, 5, 
	  TAR_CHAR_ROOM | TAR_OBJ_INV | TAR_OBJ_EQUIP, spell_detect_poison);
   FLAG_SPELL(SPELL_DETECT_POISON, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_DETECT_POISON, "You sense your awareness of poison fade.");

   spello(SPELL_ENCHANT_WEAPON, "enchant weapon", 12, POS_STANDING, 50, TAR_OBJ_INV | TAR_OBJ_EQUIP, spell_enchant_weapon);
   FLAG_SPELL(SPELL_ENCHANT_WEAPON, S_CASTABLE | S_MAGIC);

   spello(SPELL_HEAL, "heal", 12, POS_FIGHTING, 50, TAR_CHAR_ROOM, spell_heal);
   FLAG_SPELL(SPELL_HEAL, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_INVISIBLE, "invisibility", 12, POS_STANDING, 5, 
	  TAR_CHAR_ROOM | TAR_OBJ_INV | TAR_OBJ_ROOM | TAR_OBJ_EQUIP, spell_invisibility);
   FLAG_SPELL(SPELL_INVISIBLE, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
    // Removed space before period. 04/18/98 -callahan
   set_wearoff(SPELL_INVISIBLE, "Your invisibility has expired.");

   spello(SPELL_LOCATE_OBJECT, "locate object", 12, POS_STANDING, 20, TAR_OBJ_WORLD, spell_locate_object);
   FLAG_SPELL(SPELL_LOCATE_OBJECT, S_CASTABLE | S_MAGIC);

   spello(SPELL_POISON, "poison", 12, POS_STANDING, 10, 
	  TAR_CHAR_ROOM | TAR_SELF_NONO | TAR_OBJ_INV | TAR_OBJ_EQUIP | TAR_FIGHT_VICT, spell_poison);
   FLAG_SPELL(SPELL_POISON, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_POISON);
   // Changed 'disolved' to 'dissolved' 03/26/98 -callahan
   set_wearoff(SPELL_POISON, "The poison invading your body has dissolved.");

   spello(SPELL_PROTECT_FROM_EVIL, "protection vs evil", 12, POS_STANDING, 5,
	  TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_protection_from_evil);
   FLAG_SPELL(SPELL_PROTECT_FROM_EVIL, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_PROTECT_FROM_EVIL, "You feel less protected against evil.");

   spello(SPELL_REMOVE_CURSE, "remove curse", 12, POS_STANDING, 5, 
	  TAR_CHAR_ROOM | TAR_OBJ_INV | TAR_OBJ_EQUIP | TAR_OBJ_ROOM, spell_remove_curse);
   FLAG_SPELL(SPELL_REMOVE_CURSE, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_SANCTUARY, "sanctuary", 12, POS_STANDING, 75, TAR_CHAR_ROOM, spell_sanctuary);
   FLAG_SPELL(SPELL_SANCTUARY, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_SANCTUARY, "The glowing aura around your body fades away.");

   spello(SPELL_SLEEP, "sleep", 12, POS_STANDING, 15, TAR_CHAR_ROOM, spell_sleep);
   FLAG_SPELL(SPELL_SLEEP, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_SLEEP, "You suddenly feel more awake.");

   spello(SPELL_STRENGTH, "strength", 12, POS_STANDING, 20, TAR_CHAR_ROOM, spell_strength);
   FLAG_SPELL(SPELL_STRENGTH, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_STRENGTH, "Your artificial strength subsides.");

   spello(SPELL_SUMMON, "summon", 12, POS_STANDING, 50, TAR_CHAR_WORLD, spell_summon);
   FLAG_SPELL(SPELL_SUMMON, S_CASTABLE | S_MAGIC | S_SUMMON);

/* Commented out...maybe add later? 04/21/98 -callahan
   spello(SPELL_VENTRILOQUATE, "ventriloquate", 12, POS_STANDING, 5,
	  TAR_CHAR_ROOM | TAR_OBJ_ROOM | TAR_SELF_NONO, spell_ventriloquate);
   FLAG_SPELL(SPELL_VENTRILOQUATE, S_CASTABLE | S_MAGIC);
*/

   spello(SPELL_WORD_OF_RECALL, "word of recall", 12, POS_STANDING, 5,
	  TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_word_of_recall);
   FLAG_SPELL(SPELL_WORD_OF_RECALL, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_REMOVE_POISON, "remove poison", 12, POS_STANDING, 5,
	  TAR_CHAR_ROOM | TAR_OBJ_INV | TAR_OBJ_ROOM, spell_remove_poison);
   FLAG_SPELL(SPELL_REMOVE_POISON, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_SENSE_LIFE, "sense life", 12, POS_STANDING, 5, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_sense_life);
   FLAG_SPELL(SPELL_SENSE_LIFE, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_SENSE_LIFE, "You feel less aware of your surroundings.");

   spello(SPELL_IDENTIFY, "identify", 1, POS_STANDING, 10, TAR_OBJ_INV | 
	  TAR_OBJ_EQUIP | TAR_OBJ_ROOM | TAR_CHAR_ROOM, spell_identify); 
   FLAG_SPELL(SPELL_IDENTIFY, S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_ICE_SHAFT, "ice shaft", 12, POS_FIGHTING, 40, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_ice_shaft);
   FLAG_SPELL(SPELL_ICE_SHAFT, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_COLD);

   spello(SPELL_PROTECT_FROM_GOOD, "protection vs goodness", 12, POS_STANDING, 
          5, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_protection_from_good);
   FLAG_SPELL(SPELL_PROTECT_FROM_GOOD, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_PROTECT_FROM_GOOD, "You feel less protected against goodness.");

   spello(SPELL_STONE_SKIN, "stone skin", 12, POS_STANDING, 20, TAR_CHAR_ROOM, spell_stone_skin);
   FLAG_SPELL(SPELL_STONE_SKIN, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_STONE_SKIN, "Your skin of stone returns to normal.");

   spello(SPELL_HOLD_PERSON, "hold person", 12, POS_STANDING, 100, TAR_CHAR_ROOM, spell_hold_person);
   FLAG_SPELL(SPELL_HOLD_PERSON, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_HOLD_PERSON, "You find yourself able to move once more.");

   spello(SPELL_CALM, "calm", 12, POS_FIGHTING, 25, TAR_IGNORE, spell_calm);
   FLAG_SPELL(SPELL_CALM, S_CASTABLE | S_SCROLL | S_WAND | S_STAFF | S_MAGIC);
   set_wearoff(SPELL_CALM, "Your overwhelming sense of peace has faded.");

   spello(SPELL_ILLUMINATE, "illuminate", 12, POS_FIGHTING, 18, TAR_CHAR_ROOM, spell_illuminate);
   FLAG_SPELL(SPELL_ILLUMINATE, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_ILLUMINATE, "The illumination surrounding you has faded.");

   spello(SPELL_PROTECT_UNDEAD, "protection vs undead", 12, POS_STANDING, 10, TAR_CHAR_ROOM | 
	  TAR_SELF_ONLY, spell_protect_undead);
   FLAG_SPELL(SPELL_PROTECT_UNDEAD, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_PROTECT_UNDEAD, "You feel less protected against the undead.");

   spello(SPELL_LOCATE_BEING, "locate being", 12, POS_FIGHTING, 35, TAR_CHAR_WORLD, spell_locate_being);
   FLAG_SPELL(SPELL_LOCATE_BEING, S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_VIEW_HIDDEN, "view hidden", 12, POS_STANDING, 20, TAR_CHAR_ROOM, spell_view_hidden);
   FLAG_SPELL(SPELL_VIEW_HIDDEN, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_VIEW_HIDDEN, "You feel less aware of your surroundings.");

   spello(SPELL_SILENCE, "silence", 12, POS_STANDING, 80, TAR_IGNORE, spell_silence);
   FLAG_SPELL(SPELL_SILENCE, S_CASTABLE | S_SCROLL | S_STAFF | S_MAGIC);

   spello(SPELL_HASTE, "haste", 12, POS_STANDING, 50, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_haste);
   FLAG_SPELL(SPELL_HASTE, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   // This needed to be added. 03/26/98 -callahan
   set_wearoff(SPELL_HASTE, "You seem to have slowed considerably.");

   spello(SPELL_MIRRORIMAGE, "mirror image", 12, POS_STANDING, 25, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_mirror_image);
   FLAG_SPELL(SPELL_MIRRORIMAGE, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_WINGS, "wings", 12, POS_STANDING, 20, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_wings);
   FLAG_SPELL(SPELL_WINGS, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_WINGS, "Your flight ability has faded.");

   spello(SPELL_GILLS, "gills", 12, POS_STANDING, 20, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_gills);
   FLAG_SPELL(SPELL_GILLS, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_GILLS, "Your ability to breath underwater has faded.");

   spello(SPELL_P_HEAL, "power heal", 12, POS_STANDING, 91, TAR_CHAR_ROOM, spell_power_heal);
   FLAG_SPELL(SPELL_P_HEAL, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF | S_WAND | S_MAGIC);

   spello(SPELL_IMPLOSION, "implosion", 12, POS_FIGHTING, 30, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_implosion);
   FLAG_SPELL(SPELL_IMPLOSION, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_MAGIC);

   spello(SPELL_GATEWAY, "gateway", 12, POS_STANDING, 105, TAR_CHAR_WORLD, spell_gateway);
   FLAG_SPELL(SPELL_GATEWAY, S_CASTABLE | S_MAGIC);

   spello(SPELL_RETRIEVE_CORPSE, "retrieve corpse", 12, POS_FIGHTING, 200, TAR_IGNORE, spell_retrieve_corpse);
   FLAG_SPELL(SPELL_RETRIEVE_CORPSE, S_CASTABLE | S_MAGIC);

   spello(SPELL_MINDTRAP, "mindtrap", 12, POS_RESTING, 50, TAR_SELF_ONLY, spell_mindtrap);
   FLAG_SPELL(SPELL_MINDTRAP, S_CASTABLE | S_SCROLL | S_MAGIC);
   set_wearoff(SPELL_MINDTRAP, "Your mindtrap has faded...");

   spello(SPELL_RECHARGE, "recharge item", 1, POS_STANDING, 80, TAR_OBJ_INV | TAR_OBJ_EQUIP | TAR_OBJ_ROOM, spell_recharge); 
   FLAG_SPELL(SPELL_RECHARGE, S_CASTABLE | S_MAGIC);

   spello(SPELL_AREA_OF_RETURN, "area of return", 12, POS_STANDING, 105, TAR_IGNORE, spell_area_of_return);
   FLAG_SPELL(SPELL_AREA_OF_RETURN, S_CASTABLE | S_MAGIC);

   spello(SPELL_RETURN, "return", 12, POS_STANDING, 20, TAR_IGNORE, spell_return);
   FLAG_SPELL(SPELL_RETURN, S_CASTABLE | S_MAGIC);

   spello(SPELL_PROJECT, "projection", 12, POS_STANDING, 35, TAR_IGNORE, spell_project);
   FLAG_SPELL(SPELL_PROJECT, S_CASTABLE | S_MAGIC);


   // Druids. 04/18/98 -callahan
   spello(SPELL_ROCK_TO_MUD, "rock to mud",
          12, POS_STANDING, 70, TAR_IGNORE, spell_rock_to_mud);
   FLAG_SPELL(SPELL_ROCK_TO_MUD, S_CASTABLE | S_SCROLL);

   spello(SPELL_NATURES_CALTROPS, "natures caltrops",
          12, POS_STANDING, 30, TAR_IGNORE, spell_natures_caltrops);
   FLAG_SPELL(SPELL_NATURES_CALTROPS, S_VIOLENT | S_CASTABLE | S_SCROLL);

   spello(SPELL_HOLD_ANIMAL, "hold animal", 12, POS_STANDING, 100,
          TAR_CHAR_ROOM, spell_hold_animal);
   FLAG_SPELL(SPELL_HOLD_ANIMAL, S_VIOLENT | S_CASTABLE | S_POTION | S_SCROLL |
              S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_HOLD_ANIMAL, "You find yourself able to move once more.");

   spello(SPELL_TONGUES, "tongues",
          12, POS_STANDING, 35, TAR_CHAR_ROOM | TAR_SELF_ONLY, spell_tongues);
   FLAG_SPELL(SPELL_TONGUES, S_CASTABLE | S_MAGIC);
   set_wearoff(SPELL_TONGUES,
               "Your knowledge of language seems to have lessened.");

   spello(SPELL_NATURE_COMMUNION, "nature communion",
          12, POS_STANDING, 30, TAR_CHAR_ROOM | TAR_SELF_ONLY,
          spell_nature_communion);
   FLAG_SPELL(SPELL_NATURE_COMMUNION, S_CASTABLE | S_MAGIC);
   set_wearoff(SPELL_NATURE_COMMUNION,
               "You can no longer hear the breath of the forest.");

   spello(SPELL_WATER_WALK, "water walk",
          12, POS_STANDING, 15, TAR_CHAR_ROOM | TAR_SELF_ONLY,
          spell_water_walk);
   FLAG_SPELL(SPELL_WATER_WALK, S_CASTABLE | S_MAGIC);
   set_wearoff(SPELL_WATER_WALK, "You feel somewhat heavier.");

   spello(SPELL_FOREST_WARRIOR, "forest warrior",
          12, POS_STANDING, 45, TAR_CHAR_ROOM | TAR_SELF_ONLY,
          spell_forest_warrior);
   FLAG_SPELL(SPELL_FOREST_WARRIOR, S_CASTABLE | S_MAGIC);
   set_wearoff(SPELL_FOREST_WARRIOR,
               "The power of the forest seems to have left you.");

   spello(SPELL_FIRESTORM, "firestorm",
          12, POS_STANDING, 50, TAR_IGNORE, spell_firestorm);
   FLAG_SPELL(SPELL_FIRESTORM, S_VIOLENT | S_CASTABLE | S_SCROLL | S_HEAT);

   spello(SPELL_FIRE_SERVANT, "fire servant",
          12, POS_STANDING, 0, TAR_IGNORE, spell_fire_servant);
   FLAG_SPELL(SPELL_FIRE_SERVANT, S_CASTABLE | S_MAGIC | S_SUMMON);

   spello(SPELL_EARTH_SERVANT, "earth servant",
          12, POS_STANDING, 0, TAR_IGNORE, spell_earth_servant);
   FLAG_SPELL(SPELL_EARTH_SERVANT, S_CASTABLE | S_MAGIC | S_SUMMON);

   spello(SPELL_ANIMAL_SUMMONING,
          "animal summoning", 12, POS_STANDING, 0, TAR_IGNORE,
          spell_animal_summoning);
   FLAG_SPELL(SPELL_ANIMAL_SUMMONING, S_CASTABLE | S_MAGIC | S_SUMMON);

   spello(SPELL_WALL_FIRE, "wall of fire",
          12, POS_STANDING, 45, TAR_CHAR_ROOM | TAR_SELF_ONLY,
          spell_wall_of_fire);
   FLAG_SPELL(SPELL_WALL_FIRE, S_CASTABLE | S_SCROLL | S_STAFF | S_WAND |
              S_MAGIC);
   set_wearoff(SPELL_WALL_FIRE,
               "The flames around you flicker out of existence.");

   spello(SPELL_WALL_BRAMBLES, "wall of brambles",
          12, POS_STANDING, 40, TAR_CHAR_ROOM | TAR_SELF_ONLY,
          spell_wall_of_brambles);
   FLAG_SPELL(SPELL_WALL_BRAMBLES, S_CASTABLE | S_SCROLL | S_STAFF | S_WAND |
              S_MAGIC);
   set_wearoff(SPELL_WALL_BRAMBLES,
               "The brambles around you wither into dust.");

   spello(SPELL_OBSCURE_PASSING, "obscure passing",
          12, POS_STANDING, 30, TAR_CHAR_ROOM | TAR_SELF_ONLY,
          spell_obscure_passing);
   FLAG_SPELL(SPELL_OBSCURE_PASSING, S_CASTABLE | S_SCROLL | S_STAFF | S_WAND |
              S_MAGIC);
   set_wearoff(SPELL_OBSCURE_PASSING,
               "You feel less obscure in your movements.");

   spello(SPELL_THORNSTORM, "thornstorm",
          12, POS_FIGHTING, 40, TAR_CHAR_ROOM | TAR_FIGHT_VICT | TAR_SELF_NONO,
          spell_thornstorm);
   FLAG_SPELL(SPELL_THORNSTORM, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND |
              S_MAGIC);

   spello(SPELL_PROTECT_FROM_FIRE, "protection from fire",
          12, POS_STANDING, 30, TAR_CHAR_ROOM, spell_protection_from_fire);
   FLAG_SPELL(SPELL_PROTECT_FROM_FIRE, S_CASTABLE | S_POTION | S_SCROLL |
              S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_PROTECT_FROM_FIRE,
               "You feel less protected against fire.");

   spello(SPELL_PROTECT_FROM_COLD, "protection from cold",
          12, POS_STANDING, 30, TAR_CHAR_ROOM, spell_protection_from_cold);
   FLAG_SPELL(SPELL_PROTECT_FROM_COLD, S_CASTABLE | S_POTION | S_SCROLL |
              S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_PROTECT_FROM_COLD,
               "You feel less protected against cold.");

   spello(SPELL_PROTECT_FROM_DRAGON, "protection from dragons",
          12, POS_STANDING, 35, TAR_CHAR_ROOM, spell_protection_from_dragons);
   FLAG_SPELL(SPELL_PROTECT_FROM_DRAGON, S_CASTABLE | S_POTION | S_SCROLL |
              S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_PROTECT_FROM_DRAGON,
               "You feel less protected against dragons.");

   spello(SPELL_PROTECT_FROM_POISON, "protection from poison",
           12, POS_STANDING, 30, TAR_CHAR_ROOM, spell_protection_from_poison);
   FLAG_SPELL(SPELL_PROTECT_FROM_POISON, S_CASTABLE | S_POTION | S_SCROLL |
              S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_PROTECT_FROM_POISON,
               "You feel less protected against poison.");

   spello(SPELL_TRUE_SEEING, "true seeing",
          12, POS_STANDING, 50, TAR_CHAR_ROOM | TAR_SELF_ONLY,
          spell_true_seeing);
   FLAG_SPELL(SPELL_TRUE_SEEING, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF |
              S_WAND | S_MAGIC);
   set_wearoff(SPELL_TRUE_SEEING, "You cannot seem to see things as clearly.");

   spello(SPELL_KNOW_ALIGNMENT, "know alignment",
          12, POS_STANDING, 50, TAR_CHAR_ROOM, spell_know_alignment);
   FLAG_SPELL(SPELL_KNOW_ALIGNMENT, S_CASTABLE | S_POTION | S_SCROLL |
              S_STAFF | S_WAND | S_MAGIC);
   set_wearoff(SPELL_KNOW_ALIGNMENT,
               "You can no longer peer into the hearts of others.");

   spello(SPELL_TREESKIN, "treeskin",
          12, POS_STANDING, 5, TAR_CHAR_ROOM, spell_treeskin);
   FLAG_SPELL(SPELL_TREESKIN, S_CASTABLE | S_POTION | S_SCROLL | S_STAFF |
              S_WAND | S_MAGIC);
   set_wearoff(SPELL_TREESKIN, "Your skin loses its bark-like quality.");

   // End of Druid spells.

   /* NPC SPELLS in skill list, possibly drakyn or racial later... -jtrhone */
   /* racial/former NPC only spells moved into skill list */
   spello(SPELL_FIRE_BREATH, "firebreath", 12, POS_FIGHTING, 30, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_fire_breath);
   FLAG_SPELL(SPELL_FIRE_BREATH, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_BREATH | S_NPCONLY);

   spello(SPELL_GAS_BREATH, "gasbreath", 12, POS_FIGHTING, 30, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_gas_breath);
   FLAG_SPELL(SPELL_GAS_BREATH, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_BREATH | S_NPCONLY);

   spello(SPELL_FROST_BREATH, "frostbreath", 12, POS_FIGHTING, 30, TAR_CHAR_ROOM | TAR_FIGHT_VICT,  spell_frost_breath);
   FLAG_SPELL(SPELL_FROST_BREATH, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_BREATH | S_NPCONLY);

   spello(SPELL_ACID_BREATH, "acidbreath", 12, POS_FIGHTING, 30, TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_acid_breath);
   FLAG_SPELL(SPELL_ACID_BREATH, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_BREATH | S_NPCONLY);

   spello(SPELL_LIGHTNING_BREATH, "lightningbreath", 12, POS_FIGHTING, 30, 
          TAR_CHAR_ROOM | TAR_FIGHT_VICT, spell_lightning_breath);
   FLAG_SPELL(SPELL_LIGHTNING_BREATH, S_VIOLENT | S_CASTABLE | S_SCROLL | S_WAND | S_BREATH | S_NPCONLY);

   spello(SPELL_SHOWEROFLIFE, "shower of life", 12, POS_STANDING, 50, TAR_IGNORE, spell_shower_of_life);
   FLAG_SPELL(SPELL_SHOWEROFLIFE, S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_CURSED_GROUNDS, "cursed grounds", 12, POS_STANDING, 50, TAR_IGNORE, spell_cursed_grounds);
   FLAG_SPELL(SPELL_CURSED_GROUNDS, S_VIOLENT | S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_ABSOLUTE_WARD, "absolute ward", 12, POS_STANDING, 50, TAR_IGNORE, spell_absolute_ward);
   FLAG_SPELL(SPELL_ABSOLUTE_WARD, S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_CIRCLE_OF_WARDING, "circle of warding", 12, POS_STANDING, 50, TAR_IGNORE, spell_circle_of_warding);
   FLAG_SPELL(SPELL_CIRCLE_OF_WARDING, S_CASTABLE | S_SCROLL | S_MAGIC);

   spello(SPELL_WALLOFFOG, "fogwall", 12, POS_STANDING, 50, TAR_IGNORE, spell_walloffog);
   FLAG_SPELL(SPELL_WALLOFFOG, S_CASTABLE | S_SCROLL | S_MAGIC);

   // now assign languages/gskills 7/1/98 -jtrhone
  gskillo(LANG_COMMON,  "common", 1, 0, 95, G_DIALECT);
  gskillo(LANG_ELVEN,   "elven", 1, 0, 95, G_DIALECT);
  gskillo(LANG_ORCISH,  "orcish", 1, 0, 95, G_DIALECT);
  gskillo(LANG_OGRE,    "ogre", 1, 0, 95, G_DIALECT);
  gskillo(LANG_DROW,    "zhaunil", 1, 0, 95, G_DIALECT);
  gskillo(LANG_DWARVEN, "dwarven", 1, 0, 95, G_DIALECT);
  gskillo(LANG_IXISH,   "allarri", 1, 0, 95, G_DIALECT);
  gskillo(LANG_DRAGON,  "drakyn", 1, 0, 95, G_DIALECT);
  gskillo(GSKILL_RUNIC, "runic", 1, 0, 95, 0);

  gskillo(MAX_GSKILLS, "\n", LEV_IMPL, 0, 0, 0);
}