/
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

shaman.c				Various commands/utils/stuff
					associated with an RoA original
					Shaman class.

		******** 100% Completely Original Code ********
		*** BE AWARE OF ALL RIGHTS AND RESERVATIONS ***
		******** 100% Completely Original Code ********
		        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 "db.h"
#include "comm.h"
#include "handler.h"
#include "magic.h"
#include "interpreter.h"
#include "acmd.h"
#include "shaman.h"
#include "fight.h"
#include "affect.h"
#include "lists.h"
#include "global.h"

/* some protos */
void rand_rite_messg(chdata *p);
void jump_to_ritual(chdata *ch);

/* external stuff */
extern char *ritual_names[];
extern struct ritual_type ritual_specs[];
extern BOOL check_mortal_combat(chdata *ch, chdata *vict);

/* What a Ritual/Delay type does --:  The wait state is set on the 
   player by setting his/her descriptor->wait to the numbers of beats
   defined by the skill, for instance, PURGING has a wait of 25...
   What is different about this is that it sets a flag on the character
   which puts them into a ritual state then sends them on their way.
   While comm.c is running it checks for those in a ritual state,
   if they are, it determines what type, decrements the wait, and checks
   to see if they are done waiting.  If they are, it calls ritual_finish
   and send it the character and type of ritual.  Ritual_finish then calls
   the appropriate proc to finish the ritual.  Look in comm.c for where this
   determining of whether or not the player is in a ritual state, etc is.
   If the check in comm.c results in that player not finished with his or
   her wait, it just sends them on their way after decrementing the wait
   by 1.  This gives a type of delay in the ritual itself, rather than a 
   delay AFTER THE FACT as in traditional skills such as BASH or KICK or
   as in NORMAL SPELLS which delay after the spell or skill is performed.
   It's fairly easy to figure out. :) James Rhone RoA */


ACMD(do_init_rite)
{
  char *temp;
  int i, rite;

  if (!IS_SHAMAN(ch))
  {
    send_to_char("Only members of the Shaman class can perform rituals.\n\r",ch);
    return;
  }

  if (RITES(ch) <= 0)
  {
     send_to_char("You feel too weak to perform any rituals!\n\r",ch);
     return;
  }

  for (temp = argument; *temp; temp++)
    *temp = LOWER(*temp); 

  half_chop(argument, arg, buf2);

  if (!*arg || ((rite = search_block(arg, ritual_names, FALSE)) < 0))
  {
    send_to_char("Usage: perform <ritualname> <target>.\n\r",ch);
    send_to_char("Shaman Rituals available: \n\r",ch);
    for (i=1; *ritual_names[i] != '\n'; i++)
      if (ritual_specs[i].rite_fn) /* has function, exists */
      {
	sprintf(buf, "  %%6%s%%0\n\r",ritual_names[i]);
	S2C();
      }
    return;
  }

  // ok, in list, send it on down with rite as subcmd
  do_rituals(ch, buf2, 0, rite);

  // Added 04/18/98 -callahan
  if (RITES(ch) >= 0) {
    sprintf(buf, "\r\n%%6Rituals left today%%0: %d\r\n", RITES(ch));
    S2C();
  }
}

ACMD(do_rituals)
{
  BOOL isgroup = FALSE;
  BOOL is_obj = FALSE;
  chdata *vict = NULL;
  obdata *obj = NULL;
  int beats = 0;
  char *argu = argument;

  if (IN_NOWHERE(ch)) return;

  if (strlen(argument) > MAX_CLAN_LENGTH -1 )
  {
    send_to_char("Argument in ritual call too long.\n\r",ch);
    return;
  }

  if (DELAY_TYPE(ch) || IN_A_RITUAL(ch))
  {
    send_to_char("You are involved in a ritual already!!\n\r",ch);
    return;
  }

  skip_spaces(&argu);
  if (!*argu)
    strcpy(ch->pc_specials->rite_arg, "");
  else
    strcpy(ch->pc_specials->rite_arg, argu);  /* save target on char */

  /* subcmd holds the DELAY_TYPE which we use to reference the ritual
     specifications defined in constants.c */

  if (GET_SKILL(ch, ritual_specs[subcmd].skill_num) <= 0)
  {
    sprintf(buf, "You are unable call forth the %%6%s%%0 spirit!\n\r",
	    ritual_specs[subcmd].spirit_name);
    S2C();
    return;
  }

  if (!ritual_specs[subcmd].combat && FIGHTING(ch))
  {
    send_to_char("You cannot concentrate enough while fighting!\n\r",ch);
    return;
  }

  if (ritual_specs[subcmd].combat && ROOM_FLAGGED(ch->in_room, PEACEFUL))
  {
    send_to_char("Forces beyond your comprehension prevent violence here.\n\r",ch);
    return;
  }

  if (!*argu)
    vict = FIGHTING(ch);
  else
  if (str_cmp(argu, "self") && str_cmp(argu, "me"))
  {
    if (!str_cmp(argu, "group"))
    {
       if (!ritual_specs[subcmd].group)
       {
	 send_to_char("That %6ritual%0 may not be used on a group.\n\r",ch);
	 return;
       }
       if (!IS_AFFECTED(ch, AFF_GROUP))
       {
         send_to_char("You are not in a group!!!\n\r",ch);
	 return;
       }
       isgroup = TRUE;
       vict = NULL;
    } 
    else /* ok wasnt a group call */
    if (ritual_specs[subcmd].target || ritual_specs[subcmd].object)
    {
       if (!(vict = get_char_room_vis(ch, argu)))
       {
	 if (ritual_specs[subcmd].object)
	 {
           if (!(obj = get_obj_in_list_vis(ch, argu, ch->carrying)))
             if (!(obj = get_obj_in_list_vis(ch, argu, world[ch->in_room].contents)))
             {
               send_to_char("Your target is nowhere to be found!\n\r",ch);
	       return;
             }
           is_obj = TRUE;
	 } 
	 else
	 {
           send_to_char("Your target is nowhere to be found!\n\r",ch);
	   return;
	 }
       }  
    } 
    else
      vict = NULL;
  } 

  if (ritual_specs[subcmd].combat && vict && 
      !check_mortal_combat(ch, vict))
  {
    send_to_char("Assassin vs Assassin ONLY.\n\r",ch);
    return;
  }

  sprintf(buf, "You begin to call forth the spirit of the %s...\n\r",
	  ritual_specs[subcmd].spirit_name);
  S2C();

  if (!is_obj)
     sprintf(buf,"You concentrate on %s...\n\r",
             (isgroup ? "your group" : (vict ? GET_NAME(vict):"yourself")));
  else
     sprintf(buf,"You concentrate on %s...\n\r",obj->shdesc);
  S2C();

  act("$n begins mumbling in an %6ancient%0 dialect.", FALSE, ch, 0, 0, TO_ROOM);

  beats = spell_info[ritual_specs[subcmd].skill_num].beats;
  if (isgroup)
    beats *= MAX((num_in_group(ch) / 2), 1);

  WAIT_STATE(ch, beats);
  SET_BIT(PLR_FLAGS(ch), PLR_RITUAL);
  DELAY_TYPE(ch) = subcmd;
  RITES(ch)--;
}

/* called from comm.c when ritual timer is all counted down */
void jump_to_ritual(chdata *ch)
{
  char arg[MAX_INPUT_LENGTH];
  BOOL group = FALSE;
  chdata *vict = NULL;
  obdata *obj = NULL;

  REMOVE_BIT(PLR_FLAGS(ch), PLR_RITUAL);
  if (IN_NOWHERE(ch)) return;
  if (IS_NPC(ch)) return;  /* cant check them yet */

  strcpy(arg, ch->pc_specials->rite_arg);
  
  if (!*arg)
  {
    if (ritual_specs[DELAY_TYPE(ch)].combat) 
      vict = FIGHTING(ch);
  }
  else
  if (!str_cmp(arg, "group"))
  {
    if (!IS_AFFECTED(ch, AFF_GROUP))
    {
      send_to_char("Your group has been disbanded, ritual failed.\n\r",ch);
      DELAY_TYPE(ch) = 0;
      return;
    }
    group = TRUE;
  }
  else
  if (str_cmp(arg, "self") && str_cmp(arg, "me"))
    if (!(vict = get_char_room_vis(ch, arg)))
      if (!(obj = get_obj_in_list_vis(ch, ch->pc_specials->rite_arg, ch->carrying)))
        if (!(obj = get_obj_in_list_vis(ch, ch->pc_specials->rite_arg, world[ch->in_room].contents)))
	  ;

  if (ritual_specs[DELAY_TYPE(ch)].rite_fn)
    (*ritual_specs[DELAY_TYPE(ch)].rite_fn)(ch, group, vict, obj);
  else
    send_to_char("Ritual function not defined... seek immortal help.\n\r",ch);

  DELAY_TYPE(ch) = 0;
  return;
}

/* These are ritual specific procs James Rhone RoA*/

void do_ritual_purge(chdata *ch, BOOL group, chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_PURGE);
  int perc;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the %6snake%0 refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    send_to_char("The spirit of the %6snake%0 aids you!\n\r",ch);

    if (!group && !vict && !obj)
    {
      if (!ch->affected) 
      {
        send_to_char("You are already purified!!\n\r",ch);
        act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
        return;
      }
      send_to_char("You feel the impurities cleansed from your body!\n\r",ch);
      act("$n calls forth the spirit of the snake to purify $mself!!", FALSE, ch, 0, 0, TO_ROOM);

      affect_from_char(ch, SPELL_POISON);
      affect_from_char(ch, SPELL_POISON_DART);
      affect_from_char(ch, SPELL_BLINDNESS);

      GET_HIT(ch) += 20; /* set number for now */
      GET_HIT(ch) = MIN(GET_MAX_HIT(ch), GET_HIT(ch));  /* max is highest */
      return;
    }
    else 
    if (group)
    {
      sprintf(buf2, "%s has called forth the %%2snake%%0 spirit!\n\r", GET_NAME(ch));
      while ((k = group_member(ch, TRUE)))
      {
          affect_from_char(k, SPELL_POISON);
          affect_from_char(k, SPELL_POISON_DART);
          affect_from_char(k, SPELL_BLINDNESS);

          GET_HIT(k) += 20; /* set number for now */
          GET_HIT(k) = MIN(GET_MAX_HIT(k), GET_HIT(k)); 
          if (k != ch)
	    send_to_char(buf2, k);
	  send_to_char("You have been purified.\n\r",k);
      }
    }
    else
      if (vict)
      {
        if (!vict->affected) 
        {
	  send_to_char("Your ritual had no affect!\n\r",ch);
          act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
          return;
        }
        send_to_char("You feel the impurities cleansed from your body!\n\r",vict);
        act("$n calls forth the spirit of the snake to purify $N!!", FALSE, ch, 0, vict, TO_NOTVICT);
        act("You call forth the spirit of the snake to purify $N!!", FALSE, ch, 0, vict, TO_CHAR);

        affect_from_char(vict, SPELL_POISON);
        affect_from_char(vict, SPELL_POISON_DART);
        affect_from_char(vict, SPELL_BLINDNESS);

        GET_HIT(vict) += 20; /* set number for now */
        GET_HIT(vict) = MIN(GET_MAX_HIT(vict), GET_HIT(vict));  /* max is highest */
        return;
      }
      else  /* is an object? */
      if (obj)
      {
        if ((obj->type_flag == ITEM_DRINKCON) || 
            (obj->type_flag == ITEM_FOUNTAIN) || 
            (obj->type_flag == ITEM_FOOD)) 
        {
  	   obj->value[3] = FALSE;
           sprintf(buf,"You call forth the snake spirit to cleanse %s!\n\r",obj->shdesc);
           send_to_char(buf, ch);         
	   act("$n causes $p to steam briefly.", FALSE, ch, obj, 0, TO_ROOM);
	}
	else
	{
	  sprintf(buf, "The %%2snake%%0 spirit has no affect on %s.\n\r",
	  	  obj->shdesc);
	  send_to_char(buf, ch);
	}
      }
    else /* no target*/
	send_to_char("Your target is nowhere to be found!\n\r",ch);
  }
  return;
}

void do_ritual_elusion(chdata *ch, BOOL group, chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_ELUSION);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the weasel refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      if (!IS_AFFECTED(ch, AFF_SNEAK))
      {
        af.type = SKILL_SNEAK;
        af.duration = GET_LEVEL(ch);
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = AFF_SNEAK;
        af.bitvector2 = 0;
        affect_to_char(ch, &af);
      }
      SET_BIT(ch->specials.affected_by, AFF_HIDE);
      send_to_char("You begin to move silently with the weasel!\n\r",ch);
      return;
    }
    else
    if (vict)
    {
      if (!IS_AFFECTED(vict, AFF_SNEAK))
      {
        af.type = SKILL_SNEAK;
        af.duration = GET_LEVEL(ch);
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = AFF_SNEAK;
        af.bitvector2 = 0;
        affect_to_char(vict, &af);
      }
      SET_BIT(vict->specials.affected_by, AFF_HIDE);
      send_to_char("You begin to move silently with the weasel!\n\r",vict);
      act("You call forth the spirit of the weasel to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
      return;
    }
    else  
    if (group)
    {
      sprintf(buf2, "%s has called forth the power of the weasel!\n\r", GET_NAME(ch));
      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();
        if (!IS_AFFECTED(k, AFF_SNEAK))
        {
          af.type = SKILL_SNEAK;
          af.duration = GET_LEVEL(ch);
          af.modifier = 0;
          af.location = APPLY_NONE;
          af.bitvector = AFF_SNEAK;
          af.bitvector2 = 0;
          affect_to_char(k, &af);
          SET_BIT(k->specials.affected_by, AFF_HIDE);
  	  send_to_char("You now walk with the weasel.\n\r",k);
        }
      }
    }
    else
	send_to_char("Your target is nowhere to be found!\n\r",ch);
  }
  return;
}

/* for snakefire */
void do_ritual_snakefire(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_SNAKE_FIRE);
  int perc;
  struct affected_type af;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the snake refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  send_to_char("The spirit of the snake fills your mind!!\n\r",ch);
  if (!vict) vict = FIGHTING(ch);
  if (vict)
  {
     if (!check_truce(ch, vict))  /* victim cant be truced */
       return;
     if (!check_mortal_combat(ch, vict))  /* assassin/npc/arena check*/
       return;

      if (!IS_AFFECTED(ch, AFF_POISON))
      {
        if (!saves_spell(vict, SPELL_POISON) || GET_LEVEL(vict) < 20) 
        {
	   af.type = SPELL_POISON;
	   af.duration = 24;
	   af.modifier = -2;
	   af.location = APPLY_STR;
	   af.bitvector = AFF_POISON;
	   af.bitvector2 = 0;

	   affect_to_char(vict, &af);

	   sprintf(buf, "%s calls down the wrath of the snake spirit upon you!\n\r",GET_NAME(ch));
	   send_to_char(buf, vict);
 	   send_to_char("You call down the wrath of the snake spirit upon your enemy!\n\r",ch);
           act("$n uses the power of the snake against $N!", FALSE, ch, 0, vict, TO_ROOM);
           act("$n cringes in agony as $e is poisoned!", FALSE, vict, 0, 0, TO_ROOM); 
        }
	else /* enemy saves vs para */
        {
	   sprintf(buf, "%s calls down the wrath of the snake spirit upon you!\n\r",GET_NAME(ch));
	   send_to_char(buf, vict);
 	   send_to_char("You call down the wrath of the snake spirit upon your enemy!\n\r",ch);
           act("$n uses the power of the snake against $N!", FALSE, ch, 0, vict, TO_ROOM);
           act("$n screams in triumph as $e repels the snake spirit!", FALSE, vict, 0, 0, TO_ROOM);
        }
      }
      else
      {
        send_to_char("Your enemy is already poisoned!!\n\r",ch);
        act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
      }
      do_kill(vict, GET_NAME(ch), 0, 0);  /* make victim attack */ 
  }
  else  /* no victim */
    send_to_char("Your victim has fled!\n\r",ch);
   return;
}

void do_ritual_sp_strength(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_SP_STRENGTH);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the bear refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      send_to_char("You call forth the power of the bear to strengthen yourself!\n\r",ch);
      act("$n has called the forth the bear spirit!", FALSE, ch, 0, 0, TO_ROOM);

      if (!affected_by_spell(ch, SPELL_STRENGTH))
      {
        af.type = SPELL_STRENGTH;
        af.duration = MIN(GET_LEVEL(ch), 24);
        af.modifier = 1 + (GET_LEVEL(ch) > 40);
        af.location = APPLY_STR;
        af.bitvector = 0;
        af.bitvector2 = 0;
        affect_to_char(ch, &af);
      }
      return;
    }
    else
    if (vict)
    {
      act("$n has called the forth the bear spirit!", FALSE, ch, 0, 0, TO_ROOM);

      if (!affected_by_spell(vict, SPELL_STRENGTH))
      {
        af.type = SPELL_STRENGTH;
        af.duration = MIN(GET_LEVEL(ch), 24);
        af.modifier = 1 + (GET_LEVEL(ch) > 40);
        af.location = APPLY_STR;
        af.bitvector = 0;
        af.bitvector2 = 0;
        affect_to_char(vict, &af);
        send_to_char("The bear spirit has strengthened you!\n\r",vict);
        act("You call forth the spirit of the bear to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
      }
      return;
    }
    else  
    if (group)
    {
      send_to_char("You call forth the bear spirit to help your group with strength!\n\r",ch);
      sprintf(buf2, "%s has called forth the power of the bear to help with your strength!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (ch != k)
          S2C2();

        if (!affected_by_spell(k, SPELL_STRENGTH))
        {
          af.type = SPELL_STRENGTH;
          af.duration = MIN(GET_LEVEL(ch), 24);
          af.modifier = 1 + (GET_LEVEL(ch) > 40);
          af.location = APPLY_STR;
          af.bitvector = 0;
          af.bitvector2 = 0;
          affect_to_char(k, &af);
	  send_to_char("You feel stronger.\n\r",k);
        }
      }
    }
    else
      send_to_char("Your target is nowhere to be found.\n\r",ch);
  }
  return;
}

void do_ritual_eagle_eyes(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_EAGLE_EYES);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the eagle refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      send_to_char("You call forth the power of the eagle to sharpen your vision!\n\r",ch);
      act("$n calls forth the spirit of the eagle!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!affected_by_spell(ch, SPELL_DETECT_INVISIBLE) &&
          !affected_by_spell(ch, SPELL_FORESTEYES))
      {
        af.type = SPELL_DETECT_INVISIBLE;
        af.duration = GET_LEVEL(ch) * 3;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = AFF_DETECT_INVISIBLE;
        af.bitvector2 = 0;
        affect_to_char(ch, &af);
        send_to_char("Your eyes tingle with acute sharpness!\n\r",ch);
      }
      else
        send_to_char("You are already affected by detect invisibility.\n\r",ch);
      return;
    }
    else
    if (vict)
    {
      act("$n calls forth the spirit of the eagle!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!affected_by_spell(vict, SPELL_DETECT_INVISIBLE) &&
          !affected_by_spell(vict, SPELL_FORESTEYES))
      {
        af.type = SPELL_DETECT_INVISIBLE;
        af.duration = GET_LEVEL(ch) * 3;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = AFF_DETECT_INVISIBLE;
        af.bitvector2 = 0;
        affect_to_char(vict, &af);
        send_to_char("Your eyes tingle with acute sharpness!\n\r",vict);
        act("You call forth the spirit of the eagle to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
      }
    }
    else  /* is an argument  must be group for now */
    if (group)
    {
      if (GET_LEVEL(ch) < 30)
      {
	send_to_char("You must be level 30 to invoke the eagle spirit on a group.\n\r",ch);
        act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
	return;
      }

      send_to_char("You call forth the eagle spirit to help your group with their vision!\n\r",ch);
      sprintf(buf2, "%s has called forth the power of the eagle to help with your vision!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();

        if (!affected_by_spell(k, SPELL_DETECT_INVISIBLE) &&
            !affected_by_spell(k, SPELL_FORESTEYES))
        {
          af.type = SPELL_DETECT_INVISIBLE;
          af.duration = GET_LEVEL(ch) * 3;
          af.modifier = 0;
          af.location = APPLY_NONE;
          af.bitvector = AFF_DETECT_INVISIBLE;
          af.bitvector2 = 0;
          affect_to_char(k, &af);
          send_to_char("Your eyes tingle with acute sharpness!\n\r",k);
        }
        else
          send_to_char("You are already affected by detect invisibility.\n\r",k);
      }
    }
    else
      send_to_char("Your target is nowhere to be found.\n\r",ch);
  }
}

void do_ritual_truesight(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_TRUESIGHT);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the hawk refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      send_to_char("You call forth the power of the hawk to see into other hearts!\n\r",ch);
      act("$n calls forth the spirit of the hawk!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED(ch, AFF_DETECT_ALIGN))
      {
        af.type = SKILL_TRUESIGHT;
        af.duration = GET_LEVEL(ch) * 3;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = AFF_DETECT_ALIGN;
        af.bitvector2 = 0;
        affect_to_char(ch, &af);
        send_to_char("You are now able to see into the hearts of others!\n\r",ch);
      }
      return;
    }
    else
    if (vict)
    {
      act("$n calls forth the spirit of the hawk!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED(vict, AFF_DETECT_ALIGN))
      {
        af.type = SKILL_TRUESIGHT;
        af.duration = GET_LEVEL(ch) * 3;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = AFF_DETECT_ALIGN;
        af.bitvector2 = 0;
        affect_to_char(vict, &af);
        send_to_char("You are now able to see into the hearts of others!\n\r",vict);
        act("You call forth the spirit of the hawk to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
      }
      return;
    }
    else
    if (group)
    {
      if (GET_LEVEL(ch) < 20)
      {
	send_to_char("You must be level 20 to invoke the hawk spirit on a group.\n\r",ch);
        act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
	return;
      }

      send_to_char("You call forth the hawk spirit to help your group see into other hearts!\n\r",ch);
      sprintf(buf2, "%s has called forth the power of the hawk to help with your sight of truth!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();

        if (!IS_AFFECTED(k, AFF_DETECT_ALIGN))
        {
          af.type = SKILL_TRUESIGHT;
          af.duration = GET_LEVEL(ch) * 2;
          af.modifier = 0;
          af.location = APPLY_NONE;
          af.bitvector = AFF_DETECT_ALIGN;
          af.bitvector2 = 0;
          affect_to_char(k, &af);
          send_to_char("You are now able to see into the hearts of others!\n\r",k);
        }
      }
    }
    else
      send_to_char("Your target is nowhere to be found.\n\r",ch);
  }
  return;
}

void do_ritual_fortitude(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_FORTITUDE);
  int perc;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the herdbeast refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      send_to_char("You call forth the power of the herdbeast to heal your wounds!\n\r",ch);
      act("$n calls forth the spirit of the herdbeast!!", FALSE, ch, 0, 0, TO_ROOM);

      GET_HIT(ch)+=GET_LEVEL(ch);
      GET_HIT(ch) = MIN(GET_MAX_HIT(ch), GET_HIT(ch));
      send_to_char("Your spirit merges with the spirit of the herdbeast!\n\r",ch);
      send_to_char("You feel better!\n\r",ch);
      return;
    }
    else
    if (vict)
    {
      act("$n calls forth the spirit of the herdbeast!!", FALSE, ch, 0, 0, TO_ROOM);
      GET_HIT(vict)+=GET_LEVEL(ch);
      GET_HIT(vict) = MIN(GET_MAX_HIT(vict), GET_HIT(vict));
      send_to_char("Your spirit merges with the spirit of the herdbeast!\n\r",vict);
      send_to_char("You feel better!\n\r",vict);
      act("You call forth the spirit of the herdbeast to aid $N!!", FALSE, ch, 0, 
          vict, TO_CHAR);
      return;
    }
    else
    if (group)
    {
      send_to_char("You call forth the herdbeast spirit to help your group heal their wounds!\n\r",ch);
      sprintf(buf2, "%s has called forth the power of the herdbeast to heal your injuries!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();

        GET_HIT(k) += GET_LEVEL(ch)/2;
        GET_HIT(k)  = MIN(GET_MAX_HIT(k), GET_HIT(k));
        send_to_char("Your spirit merges with the spirit of the herdbeast!\n\r",k);
        send_to_char("You feel better!\n\r",k);
      }
    }
    else
      send_to_char("Your target is nowhere to be found.\n\r",ch);
  }
}

void do_ritual_heal(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_HEAL);
  int perc;

  perc = number(1,101);
  if (prob<perc)
  {
    send_to_char("The spirit of the snake refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!vict)
    {
      send_to_char("You call forth the power of the snake to heal your wounds!\n\r",
                   ch);
      act("$n calls forth the spirit of the snake to heal $mself!!", 
          FALSE, ch, 0, 0, TO_ROOM);

      GET_HIT(ch) = GET_MAX_HIT(ch);
      send_to_char("Your spirit merges with the spirit of the snake!\n\r",ch);
      send_to_char("You feel MUCH better!\n\r",ch);
      return;
    }
    else
    if (vict)
    {
        GET_HIT(vict)+=dice(25, 10);
        if (GET_HIT(vict) > GET_MAX_HIT(vict))
           GET_HIT(vict) = GET_MAX_HIT(vict);

        act("You call forth the snake spirit to heal $N!", FALSE, ch, 0, vict, 
            TO_CHAR);
        act("$n calls forth the spirit of the snake to heal $N!!",FALSE,ch,0,vict,
            TO_ROOM);
        send_to_char("Your spirit merges with the spirit of the snake!\n\r",vict);
        send_to_char("You feel MUCH better!\n\r",vict);
    }
    else 
      send_to_char("Your target is nowhere to be found.\n\r",ch);
  }
}

void do_ritual_endurance(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_ENDURANCE);
  int perc;

  perc = number(1,101);
  if (prob<perc)
  {
    send_to_char("The spirit of the herdbeast refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!vict)
    {
      send_to_char("You call forth the power of the herdbeast to increase your endurance!\n\r",ch);
      act("$n calls forth the spirit of the herdbeast to increase $s endurance!", FALSE, ch, 0, 0, TO_ROOM);

      GET_MOVE(ch) += number(10, 50);
      send_to_char("Your spirit merges with the spirit of the herdbeast!\n\r",ch);
      return;
    }
    else
    if (vict)
    {
      GET_MOVE(ch) += number(10, 50);
      sprintf(buf, "You call forth the herdbeast for %s!\n\r",GET_NAME(vict));
      S2C();
      act("$n calls forth the spirit of the herdbeast for $N!!", FALSE, ch, 0, vict, TO_ROOM);
      send_to_char("Your spirit merges with the spirit of the herdbeast!\n\r",vict);
    }
    else 
      send_to_char("Your target is nowhere to be found.\n\r",ch);
  }
  return;
}

void do_ritual_location(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_LOCATION);
  int perc;
  obdata *i;
  int j;

  if (IS_NPC(ch)) return;  /* cant check them yet */

  perc = number(1,101);
  if (prob<perc)
  {
    send_to_char("The spirit of the lynx refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!*ch->pc_specials->rite_arg)
    {
      send_to_char("You must supply an argument for this ritual.\n\r",ch);
      return;
    }
    else  /* is an argument find target*/
    {
        sprintf(buf, "You call forth the lynx to locate %s!\n\r",
	        ch->pc_specials->rite_arg);
        send_to_char(buf, ch);
        act("$n calls forth the spirit of the lynx to locate something!!", FALSE, ch, 0, 0, TO_ROOM);

   j = 5;
   for (i = object_list; i && (j > 0); i = i->next)
      if (isname(ch->pc_specials->rite_arg, i->name)) {
	 if (i->carried_by) {
	    sprintf(buf, "%s carried by %s.\n\r",
	        i->shdesc, PERS(i->carried_by, ch));
	    send_to_char(buf, ch);
	 } else if (i->in_obj) {
	    sprintf(buf, "%s in %s.\n\r", i->shdesc,
	        i->in_obj->shdesc);
	    send_to_char(buf, ch);
	 } else
	  {
	    sprintf(buf, "%s in %s.\n\r", i->shdesc,
	        (i->in_room == NOWHERE ? "use but uncertain" : world[i->in_room].name));
	    send_to_char(buf, ch);
	 }
        j--;
      }

      if (j == 5)
         send_to_char("The lynx spirit could not locate it!.\n\r", ch);        

    }
  }
  return;
}

void do_ritual_truce(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_TRUCE);
  int perc;
  struct affected_type af;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the frog refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!vict)
    {
      send_to_char("You call forth the power of the frog!\n\r",ch);

      if (!IS_AFFECTED(ch, AFF_TRUCE))
      {
        af.type = SKILL_TRUCE;
        af.duration = 6;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = AFF_TRUCE;
        af.bitvector2 = 0;
        affect_to_char(ch, &af);
      send_to_char("You feel the truce of the waterhole protecting you!\n\r",ch);
      act("$n calls forth the frog spirit to protect $mself!!", FALSE, ch, 0, 0, TO_ROOM);
      }
      return;
    }
    else 
    if (vict) /* is an argument  find victim */
    {
        if (!IS_AFFECTED(vict, AFF_TRUCE))
        {
          af.type = SKILL_TRUCE;
          af.duration = 6;
          af.modifier = 0;
          af.location = APPLY_NONE;
          af.bitvector = AFF_TRUCE;
          af.bitvector2 = 0;
          affect_to_char(vict, &af);
          send_to_char("You feel the truce of the waterhole protecting you!\n\r",vict);
          act("$n calls forth the frog spirit to protect $N!!", FALSE, ch, 0, vict, TO_ROOM);
          act("You call forth the frog spirit to protect $N!!", FALSE, ch, 0, vict, TO_CHAR);
        }
    }
    else
      send_to_char("Your victim is nowhere to be found.\n\r",ch);
  }
  return;
}

/* for fangs of the snake */
void do_ritual_fang(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_FANG);
  int perc;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the snake refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  send_to_char("The spirit of the snake fills your mind!!\n\r",ch);
  if (!vict) vict = FIGHTING(ch);
  if (vict)
  {
     if (!check_truce(ch, vict))  /* victim cant be truced */
       return;
     if (!check_mortal_combat(ch, vict))  /* assassin/npc/arena check*/
       return;

     sprintf(buf, "%s calls down the wrath of the snake spirit upon you!\n\r",GET_NAME(ch));
     send_to_char(buf, vict);
     send_to_char("You call down the wrath of the snake spirit upon your enemy!\n\r",ch);
     act("$n uses the fierce power of the snake against $N!", FALSE, ch, 0, vict, TO_ROOM);
     act("$n cringes in agony as $e is PIERCED by the snake's fang!", FALSE, vict, 0, 0, TO_ROOM); 
  
   GET_HIT(vict) -= (2 * number(70, 100));  /* twice fireball */
   GET_HIT(vict) = MAX(1, GET_HIT(vict));  /* wont kill victim */

   if (!FIGHTING(vict))
     hit(vict, ch, TYPE_UNDEFINED, FALSE);  /* make victim attack */ 
  }
  else
    send_to_char("Your target is nowhere to be found.\n\r",ch);

  return;
}

void do_ritual_crow(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_CROW);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the crow refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      send_to_char("You call forth the power of the crow to protect yourself!\n\r",ch);
      act("$n calls forth the spirit of the crow!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED2(ch, AFF2_CROW) && !IS_AFFECTED(ch, AFF_SANCTUARY))
      {
        af.type = SKILL_CROW;
        af.duration = 4;
        af.modifier = 2;
        af.location = APPLY_HITROLL;
        af.bitvector = 0;
        af.bitvector2 = AFF2_CROW;
        affect_to_char(ch, &af);
        send_to_char("You are now protected by the crow!\n\r",ch);
	return;
      }
      return;
    }
    else
    if (vict)
    {
      act("$n calls forth the spirit of the crow!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED2(vict, AFF2_CROW) && !IS_AFFECTED(vict, AFF_SANCTUARY))
      {
        af.type = SKILL_CROW;
        af.duration = 4;
        af.modifier = 2;
        af.location = APPLY_HITROLL;
        af.bitvector = 0;
        af.bitvector2 = AFF2_CROW;
        affect_to_char(vict, &af);
        send_to_char("You are now protected by the crow!\n\r",vict);
        act("You call forth the spirit of the crow to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
      }
      return;
    }
    else  
    if (group) /* is an argument  must be group for now */
    {
      if (GET_LEVEL(ch) < 65)
      {
	send_to_char("You must be level 65 to invoke the crow spirit on a group.\n\r",ch);
        act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
	return;
      }

      send_to_char("You call forth the crow spirit to protect your group!\n\r",ch);
      sprintf(buf2, "%s has called forth the power of the crow to protect you!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();

        if (!IS_AFFECTED2(k, AFF2_CROW) && !IS_AFFECTED(k, AFF_SANCTUARY))
        {
          af.type = SKILL_CROW;
          af.duration = 4;
          af.modifier = 2;
          af.location = APPLY_HITROLL;
          af.bitvector = 0;
          af.bitvector2 = AFF2_CROW;
          affect_to_char(k, &af);
          send_to_char("You are now protected by the crow!\n\r",k);
        }
      }
    }
    else
      send_to_char("Your victim is nowhere to be found.\n\r",ch);
  }
}

void do_ritual_claws(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_CLAWS);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the cougar refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && (!vict || vict == FIGHTING(ch)))
    {
      send_to_char("You call forth the power of the cougar to arm yourself!\n\r",ch);
      act("$n calls forth the spirit of the cougar!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED2(ch, AFF2_CLAWS))
      {
        af.type = SKILL_CLAWS;
        af.duration = 6;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = 0;
        af.bitvector2 = AFF2_CLAWS;
        affect_to_char(ch, &af);
        send_to_char("You free your hands as they meld into claws!\n\r",ch);
        if(EQ(ch, W_WIELD)) 
	  obj_to_char(unequip_char(ch, W_WIELD, TRUE), ch);
        if(EQ(ch, W_HOLD)) 
	  obj_to_char(unequip_char(ch, W_HOLD, TRUE), ch);
	return;
      }
    }
    else
    if (vict)
    {
      act("$n calls forth the spirit of the cougar!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED2(vict, AFF2_CLAWS))
      {
        af.type = SKILL_CLAWS;
        af.duration = 6;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = 0;
        af.bitvector2 = AFF2_CLAWS;
        affect_to_char(vict, &af);
        act("You call forth the spirit of the cougar to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
        send_to_char("You free your hands as they %1meld%0 into claws!\n\r",vict);

        if (EQ(vict, W_WIELD)) 
	  obj_to_char(unequip_char(vict, W_WIELD, TRUE), vict);

        if (EQ(vict, W_HOLD)) 
	  obj_to_char(unequip_char(vict, W_HOLD, TRUE), vict);
	return;
      }
    }
    else
    if (group)  /* is an argument  must be group for now */
    {
      if (GET_LEVEL(ch) < 70)
      {
        send_to_char("You must be level 70 to invoke the cougar spirit on a group.\n\r",ch);
        act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
        return;
      }

      send_to_char("You call forth the cougar spirit to aid your group!\n\r",ch);
      sprintf(buf2, "%s has called forth the power of the cougar to aid you!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();

        if (!IS_AFFECTED2(k, AFF2_CLAWS)) 
        {
          af.type = SKILL_CLAWS;
          af.duration = 6;
          af.modifier = 0;
          af.location = APPLY_NONE;
          af.bitvector = 0;
          af.bitvector2 = AFF2_CLAWS;
          affect_to_char(k, &af);
          send_to_char("You free your hands as they meld into claws!\n\r",k);

          if(EQ(k, W_WIELD)) 
	    obj_to_char(unequip_char(k, W_WIELD, TRUE), k);
          if(EQ(k, W_HOLD)) 
	    obj_to_char(unequip_char(k, W_HOLD, TRUE), k);
        }
      }
    }
    else
      send_to_char("your target is nowhere to be found.\n\r",ch);
  }
}

void do_ritual_wolf(chdata *ch, BOOL group,chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_WOLF);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the wolf refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && (!vict || vict == FIGHTING(ch)))
    {
      send_to_char("You call forth the power of the wolf for retribution!\n\r",ch);
      act("$n calls forth the spirit of the wolf!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED2(ch, AFF2_WOLF))
      {
        af.type = SKILL_WOLF;
        af.duration = 2;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = 0;
        af.bitvector2 = AFF2_WOLF;
        affect_to_char(ch, &af);
        send_to_char("You feel the wolf become one with you!\n\r",ch);
	return;
      }
    }
    else
    if (vict)
    {
      act("$n calls forth the spirit of the wolf!!", FALSE, ch, 0, 0, TO_ROOM);

      if (!IS_AFFECTED2(vict, AFF2_WOLF))
      {
        af.type = SKILL_WOLF;
        af.duration = 2;
        af.modifier = 0;
        af.location = APPLY_NONE;
        af.bitvector = 0;
        af.bitvector2 = AFF2_WOLF;
        affect_to_char(vict, &af);
        send_to_char("You feel the wolf become one with you!\n\r",vict);
        act("You call forth the spirit of the wolf to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
	return;
      }
    }
    else 
    if (group)
    {
      if (GET_LEVEL(ch) < LEV_IMM)
      {
	send_to_char("You must be immortal to invoke the wolf spirit on a group.\n\r",ch);
        act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
	return;
      }

      send_to_char("You call forth the wolf spirit to aid your group!\n\r",ch);
      sprintf(buf2, "%s has called forth the power of the wolf to aid you!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();

        if (!IS_AFFECTED2(k, AFF2_WOLF))
        {
          af.type = SKILL_WOLF;
          af.duration = 2;
          af.modifier = 0;
          af.location = APPLY_NONE;
          af.bitvector = 0;
          af.bitvector2 = AFF2_WOLF;
          affect_to_char(k, &af);
          send_to_char("You feel the wolf become one with you!\n\r",k);
        }
      }
    }
    else
      send_to_char("Your target is nowhere to be found.\n\r",ch);
  }
}

void do_ritual_protection(chdata *ch, BOOL group, chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_PROTECTION);
  int perc;
  struct affected_type af;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the tortise refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      if (!affected_by_spell(ch, SPELL_ARMOR) && 
          !affected_by_spell(ch, SPELL_STONE_SKIN) &&
          !affected_by_spell(ch, SPELL_BARKSKIN))
      {
        af.type = SPELL_ARMOR;
        af.duration = 24;
        af.modifier = -GET_LEVEL(ch);
        af.location = APPLY_AC;
        af.bitvector = 0;
        af.bitvector2 = 0;
        affect_to_char(ch, &af);
      }
      send_to_char("You feel protected!\n\r",ch);
      return;
    }
    else
    if (vict)
    {
      if (!affected_by_spell(vict, SPELL_ARMOR) && 
          !affected_by_spell(vict, SPELL_STONE_SKIN) &&
          !affected_by_spell(ch, SPELL_BARKSKIN))
      {
        af.type = SPELL_ARMOR;
        af.duration = 24;
        af.modifier = -GET_LEVEL(ch);
        af.location = APPLY_AC;
        af.bitvector = 0;
        af.bitvector2 = 0;
        affect_to_char(vict, &af);
      }
      send_to_char("You feel protected!\n\r",vict);
      act("You call forth the spirit of the tortise to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
      return;
    }
    else  
    if (group)
    {
      sprintf(buf2, "%s has called forth the power of the tortise!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();

        if (!affected_by_spell(k, SPELL_ARMOR) && 
            !affected_by_spell(k, SPELL_STONE_SKIN) &&
            !affected_by_spell(ch, SPELL_BARKSKIN))
        {
          af.type = SPELL_ARMOR;
          af.duration = 24;
          af.modifier = -GET_LEVEL(ch);
          af.location = APPLY_AC;
          af.bitvector = 0;
          af.bitvector2 = 0;
          affect_to_char(k, &af);
	  send_to_char("You feel protected!\n\r",k);
        }
      }
    }
    else
	send_to_char("Your target is nowhere to be found!\n\r",ch);
  }
}

void do_ritual_stone(chdata *ch, BOOL group, chdata *vict, obdata *obj)
{
  int prob = GET_SKILL(ch, SKILL_STONE);
  int perc;
  chdata *k;

  perc = number(1,100);
  if (prob<perc)
  {
    send_to_char("The spirit of the mountain refuses to aid you!\n\r",ch);
    act("$n finishes mumbling with no results.", FALSE, ch, 0, 0, TO_ROOM);
    return;
  }
  else
  {
    if (!group && !vict)
    {
      GET_HIT(ch) += (GET_HIT(ch) / 3);
      send_to_char("You surge with power!\n\r",ch);
      return;
    }
    else
    if (vict)
    {
      GET_HIT(vict) += (GET_HIT(ch) / 3);
      send_to_char("You surge with power!\n\r",vict);
      act("You call forth the spirit of the mountain to aid $N!!", FALSE, ch, 0, vict, TO_CHAR);
      return;
    }
    else  
    if (group)
    {
      sprintf(buf2, "%s has called forth the power of the mountain!\n\r", GET_NAME(ch));

      while ((k = group_member(ch, TRUE)))
      {
        if (k != ch)
          S2C2();
        GET_HIT(k) += (GET_HIT(ch) / 3);
        send_to_char("You surge with power!\n\r",k);
      }
    }
    else
      send_to_char("Your target is nowhere to be found!\n\r",ch);
  }
}


/* write the random spiritual message every 60 pulses per ritual */
/* called from comm.c */
void rand_rite_messg(chdata *p)
{

  switch(DELAY_TYPE(p)) {
   case DELAY_PURGE:
   case DELAY_HEAL:
   case DELAY_SNAKEFIRE:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "A distant slithering can be heard.\n\r");
     break;
     case 1:
     sprintf(buf, "The hiss of a thousand snakes fills your mind!.\n\r");
     break;
     default:
     sprintf(buf, "You catch a glimpse of a snakelike figure in the distance.\n\r");
     break;
    }
     break;
   case DELAY_ELUSION:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "Visions of the weasel cloud your mind!\n\r");
     break;
     case 1:
     sprintf(buf, "A tingling feeling on your neck forces you to look behind you.\n\r");
     break;
     default:
     sprintf(buf, "You catch a glimpse of a fur cloaked figure in the shadows.\n\r");
     break;
    }
     break;
   case DELAY_FORTITUDE:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "The strength of the heardbeast spirit surrounds you!\n\r");
     break;
     case 1:
     sprintf(buf, "Visions of the migrating heardbeast cloud your vision!.\n\r");
     break;
     default:
     sprintf(buf, "You catch a glimpse of a massive figure in the distance.\n\r");
     break;
    }
     break;
   case DELAY_SP_STRENGTH:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "The strength of the bear spirit surrounds you!\n\r");
     break;
     case 1:
     sprintf(buf, "Visions of savage bears cloud your vision!.\n\r");
     break;
     default:
     sprintf(buf, "You catch a glimpse of a massive figure in the distance.\n\r");
     break;
    }
     break;
   case DELAY_EAGLE_EYES:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "You sense the image of an eagle soaring freely through the sky.\n\r");
     break;
     case 1:
     sprintf(buf, "Adrenaline rushes through you as you sense the power of the eagle!\n\r");
     break;
     default:
     sprintf(buf, "The power of the eagle fills your mind!\n\r");
     break;
    }
     break;
   case DELAY_TRUESIGHT:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "You sense the image of a hawk soaring through the sky.\n\r");
     break;
     case 1:
     sprintf(buf, "Adrenaline rushes through you as you sense the power of the hawk!\n\r");
     break;
     default:
     sprintf(buf, "The hawk's grace and deadly hunting prowess surge through you!\n\r");
     break;
    }
     break;
   case DELAY_TRUCE:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "Visions of the frog clutter your mind!\n\r");
     break;
     case 1:
     sprintf(buf, "A sudden feeling of thirst overwhelms you.\n\r");
     break;
     default:
     sprintf(buf, "You catch a glimpse of a small green figure in the distance.\n\r");
     break;
    }
     break;
   case DELAY_FANG:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "Visions of the snake rage through your mind!\n\r");
     break;
     case 1:
     sprintf(buf, "A sudden feeling of violence overwhelms you.\n\r");
     break;
     default:
     sprintf(buf, "You shiver as you sense the furiousity of the snake!\n\r");
     break;
    }
     break;
   case DELAY_CROW:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "Visions of the crow fill your mind!\n\r");
     break;
     case 1:
     sprintf(buf, "A sudden feeling of peace overwhelms you.\n\r");
     break;
     default:
     sprintf(buf, "You catch a glimpse of a dark figure flying high above you!\n\r");
     break;
    }
     break;
   case DELAY_CLAWS:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "Visions of the cougar rage through your mind!\n\r");
     break;
     case 1:
     sprintf(buf, "A sudden feeling of violence overwhelms you!\n\r");
     break;
     default:
     sprintf(buf, "You sense the presence of the cougar spirit!\n\r");
     break;
    }
     break;
   case DELAY_WOLF:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "Visions of the wolf rage through your mind!\n\r");
     break;
     case 1:
     sprintf(buf, "A sudden feeling of stealth overwhelms you!\n\r");
     break;
     default:
     sprintf(buf, "You sense the presence of the wolf spirit!\n\r");
     break;
    }
     break;
   default:
    switch (number(0,2)) {
     case 0:
     sprintf(buf, "Whispers and silent humming echo around you.\n\r");
     break;
     case 1:
     sprintf(buf, "This area seems to dim slightly in the shadow of something great!\n\r");
     break;
     default:
     sprintf(buf, "You sense that what you see is not all that exists.\n\r");
     break;
    }
     break;
  }
  send_to_room(buf,p->in_room);

  return;
}