/*----------------------------------------------------------------------------------*\
*									            *												*			
*  This snippet was written by Kaine De'Arque of Vampire Wars: Embrace the Darkness *
*  (VWETD).  If you use this snippet all I ask is that you email me saying that you *
*  used, benefited, didnt like, etc. from it ( shane@computers-mn.com ).            +
*										    *										*
*  This snippet should work with any VW mud, if it doesnt let me know.	            *
*  The original code was taking from dystopia and converted to work with VW.        *
*  It didnt take me a lot of time or effort to do this so ya dont owe me anything   *
*  Id just appreciate an email PLEASE!						    *
*										    *											*
*  The concept is very simple, instead of typing out 'stance bull' or whatever      *
*  before ya try and kill something everytime, ya type 'autostance bull' once and   *
*  it sets it for you to stance bull everytime you attack or get attacked.          *
*  As of now the only thing it doesnt do is save the stance you set if you          *
*  disconnect, Ill add that in at a later date but Im VERY busy as of now and dont  *
*  have time.  When I code it Ill make sure to send a patch and the full code with  *
*  it. -Kaine
\*----------------------------------------------------------------------------------*/




/*** any.c ***/
/* In any C file (create a new one if youd like) */
/* Towards the top put this: */

#define AUTODROP 12

/* In the same C file add the following */

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

  one_argument( argument, arg, MAX_INPUT_LENGTH );
  if (IS_NPC(ch)) return;
  if (!str_cmp(arg,"none"))
  {
    send_to_char("Autostance set to None.\n\r", ch );
    ch->stance[AUTODROP] = STANCE_NONE;
  }
  else if (!str_cmp(arg, "crane"))
  {
    send_to_char("Autostance set to Crane.\n\r",ch );
    ch->stance[AUTODROP] = STANCE_CRANE;
  }
  else if (!str_cmp(arg, "bull"))
  {
    send_to_char("Autostance set to Bull.\n\r", ch );
    ch->stance[AUTODROP] = STANCE_BULL;
  }
  else if (!str_cmp(arg, "viper"))
  {
    send_to_char("Autostance set to Viper.\n\r", ch );
    ch->stance[AUTODROP] = STANCE_VIPER;
  }
  else if (!str_cmp(arg, "mongoose"))
  {
    send_to_char("Autostance set to Mongoose.\n\r", ch);
    ch->stance[AUTODROP] = STANCE_MONGOOSE;
  }
  else if (!str_cmp(arg, "swallow") && ch->stance[STANCE_CRANE] >= 200 && ch->stance[STANCE_MONGOOSE] >= 200 )
  {
    send_to_char("Autostance set to Swallow.\n\r", ch);
    ch->stance[AUTODROP] = STANCE_SWALLOW;
  }
  else if (!str_cmp(arg, "lion") && ch->stance[STANCE_BULL] >= 200 && ch->stance[STANCE_VIPER] >= 200 )
  {
    send_to_char("Autostance set to Lion.\n\r", ch);
    ch->stance[AUTODROP] = STANCE_LION;
  }
  else if (!str_cmp(arg, "falcon") && ch->stance[STANCE_MONGOOSE] >= 200 && ch->stance[STANCE_BULL] >= 200 )
  {
    send_to_char("Autostance set to Falcon.\n\r", ch);
    ch->stance[AUTODROP] = STANCE_FALCON;
  }
  else if (!str_cmp(arg, "cobra") && ch->stance[STANCE_VIPER] >= 200 && ch->stance[STANCE_CRANE] >= 200 )
  {
    send_to_char("Autostance set to Cobra.\n\r", ch);
    ch->stance[AUTODROP] = STANCE_COBRA;
  }
  else if (!str_cmp(arg, "panther") && ch->stance[STANCE_VIPER] >= 200 && ch->stance[STANCE_MONGOOSE] >= 200 )
  {
    send_to_char("Autostance set to Panther.\n\r", ch);
    ch->stance[AUTODROP] = STANCE_PANTHER;
  }
  else if (!str_cmp(arg, "grizzlie") && ch->stance[STANCE_BULL] >= 200 && ch->stance[STANCE_CRANE] >= 200 )
  {
    send_to_char("Autostance set to Grizzlie.\n\r", ch);
    ch->stance[AUTODROP] = STANCE_GRIZZLIE;
  }
  else send_to_char ("No such Stance.\n\r", ch);
}

void autodrop(CHAR_DATA *ch)
{
  char buf [MAX_INPUT_LENGTH];
  char buf2 [MAX_INPUT_LENGTH];
  char stancename [10];

  if (IS_NPC(ch)) return;
  if (ch->stance[AUTODROP]==STANCE_NONE) return;
  else if (ch->stance[AUTODROP]==STANCE_VIPER) sprintf(stancename,"viper");
  else if (ch->stance[AUTODROP]==STANCE_CRANE) sprintf(stancename,"crane");
  else if (ch->stance[AUTODROP]==STANCE_MONGOOSE) sprintf(stancename,"mongoose");
  else if (ch->stance[AUTODROP]==STANCE_BULL) sprintf(stancename,"bull");
  else if (ch->stance[AUTODROP]==STANCE_SWALLOW) sprintf(stancename, "swallow");
  else if (ch->stance[AUTODROP]==STANCE_LION) sprintf(stancename, "lion");
  else if (ch->stance[AUTODROP]==STANCE_FALCON) sprintf(stancename, "falcon");
  else if (ch->stance[AUTODROP]==STANCE_PANTHER) sprintf(stancename, "panther");
  else if (ch->stance[AUTODROP]==STANCE_COBRA) sprintf(stancename, "cobra");
  else if (ch->stance[AUTODROP]==STANCE_GRIZZLIE) sprintf(stancename, "grizzlie");
  else return;
  if (ch->stance[0] < 1)
  {
    ch->stance[0] = ch->stance[AUTODROP];;
    sprintf(buf, "You fall into the %s stance.", stancename);
    act(buf, ch, NULL, NULL, TO_CHAR);
    sprintf(buf2, "$n falls into the %s stance.",stancename);
    act(buf2, ch, NULL, NULL, TO_ROOM);
  }
}


/*** merc.h ***/
/* Add this next piece either in the global functions of the .c file you put it in
   or add it under one of em (look for act_info.c or act_wiz.c or whatever its around
   there
*/

void    autodrop      args ((CHAR_DATA *ch));

/* Look for DECLARE_DO_FUN ( do_autosac ); and add this below it: */

DECLARE_DO_FUN(   do_autostance );

/*** interp.c ***/
/* once again look for autosac and put this line below it: */

    { "autostance",             do_autostance,  POS_DEAD,        0,  LOG_NORMAL },


/* Make, Copyover/Reboot, and execute, see if it works or not and let me know.  If something
goes wrong Im more then willing to help out with the installation.  If you have any add-ons,
ideas, fixes, bugs, etc. etc. email me at shane@computers-mn.com and let me know. Thanks.
-Kaine De'Arque
*/