stance_code.c
demise/src/stance_code.c · 29.0 KB
From the archive dodbackup-final.tar.gz
Download the archive « Back to the archive contents
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
void
do_setstance (CHAR_DATA * ch, char *argument)
{
char arg1[MIL];
char arg2[MIL];
char buf[MSL];
char arg_buf[MSL];
int p_l = 0, p_g = 0, p_s = 0;
int mincost = 250, maxcost = 500;
int selected = 0, cost = 0, supers = 0;
int lesser = 0, greater = 0, supreme = 0;
int max_lesser = 0, max_greater = 0, max_supreme = 0;
strcpy (arg_buf, argument);
argument = &arg_buf[0];
smash_tilde (argument);
argument = one_argument (argument, arg1);
strcpy (arg2, argument);
if (IS_NPC (ch))
return;
if (ch->stance[6] < 200 || ch->stance[7] < 200 || ch->stance[8] < 200
|| ch->stance[9] < 200 || ch->stance[10] < 200)
{
send_to_char
("To set your own stance, you must be Grand Master in all traditional stances.\n\r",
ch);
return;
}
if ((ch->stance[11] > 0 && ch->stance[11] < 200)
|| (ch->stance[12] > 0 && ch->stance[12] < 200)
|| (ch->stance[13] > 0 && ch->stance[13] < 200)
|| (ch->stance[14] > 0 && ch->stance[14] < 200)
|| (ch->stance[15] > 0 && ch->stance[15] < 200))
{
send_to_char
("You must master your current superstance before working on another!\n\r",
ch);
return;
}
if (ch->stance[11] > 0)
{
selected++;
mincost = 250;
maxcost = 500;
}
if (ch->stance[12] > 0)
{
selected++;
mincost = 500;
maxcost = 750;
}
if (ch->stance[13] > 0)
{
selected++;
mincost = 750;
maxcost = 1000;
}
if (ch->stance[14] > 0)
{
selected++;
mincost = 1000;
maxcost = 1500;
}
if (ch->stance[15] > 0)
selected++;
if (selected >= 5)
{
send_to_char
("You have already mastered your five different stances!\n\r", ch);
return;
}
switch (selected)
{
default:
case QS_11:
max_lesser = 2;
max_greater = 0;
max_supreme = 0;
break;
case QS_12:
max_lesser = 2;
max_greater = 1;
max_supreme = 0;
break;
case QS_13:
max_lesser = 3;
max_greater = 2;
max_supreme = 1;
break;
case QS_14:
max_lesser = 4;
max_greater = 2;
max_supreme = 1;
break;
case QS_15:
max_lesser = 5;
max_greater = 3;
max_supreme = 2;
break;
}
if (IS_SET (ch->pcdata->qstats[selected], QS_HIT_LESSER))
lesser++;
if (IS_SET (ch->pcdata->qstats[selected], QS_DAM_LESSER))
lesser++;
if (IS_SET (ch->pcdata->qstats[selected], QS_ARM_LESSER))
lesser++;
if (IS_SET (ch->pcdata->qstats[selected], QS_POW_LESSER))
lesser++;
if (IS_SET (ch->pcdata->qstats[selected], QS_RES_LESSER))
lesser++;
if (IS_SET (ch->pcdata->qstats[selected], QS_HIT_GREATER))
greater++;
if (IS_SET (ch->pcdata->qstats[selected], QS_DAM_GREATER))
greater++;
if (IS_SET (ch->pcdata->qstats[selected], QS_ARM_GREATER))
greater++;
if (IS_SET (ch->pcdata->qstats[selected], QS_POW_GREATER))
greater++;
if (IS_SET (ch->pcdata->qstats[selected], QS_RES_GREATER))
greater++;
if (IS_SET (ch->pcdata->qstats[selected], QS_HIT_SUPREME))
supreme++;
if (IS_SET (ch->pcdata->qstats[selected], QS_DAM_SUPREME))
supreme++;
if (IS_SET (ch->pcdata->qstats[selected], QS_ARM_SUPREME))
supreme++;
if (IS_SET (ch->pcdata->qstats[selected], QS_POW_SUPREME))
supreme++;
if (IS_SET (ch->pcdata->qstats[selected], QS_RES_SUPREME))
supreme++;
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_PARRY))
supers++;
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_DODGE))
supers++;
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_SPEED))
supers++;
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_BYPASS))
supers++;
cost = (((lesser * 50) + (greater * 100) + (supreme * 200)
+ ((supers + supers) * 100))) * 10000;
mincost *= 10000;
maxcost *= 10000;
if (arg1[0] != '\0' && !str_cmp (arg1, "done"))
{
int stance = selected + 11;
if (cost < mincost || cost > maxcost)
{
sprintf (buf,
"Sorry, you must spend between %d and %d exp on your stance.\n\r",
mincost, maxcost);
send_to_char (buf, ch);
sprintf (buf,
"You currently have %d exp allocated to this stance.\n\r",
cost);
send_to_char (buf, ch);
return;
}
if (ch->exp < cost)
{
sprintf (buf,
"Sorry, you don't have the required %d exp to buy that stance.\n\r",
cost);
send_to_char (buf, ch);
return;
}
if (stance < 11 || stance > 15)
{
send_to_char ("Bug, please inform Corim.\n\r", ch);
return;
}
ch->exp -= cost;
free_string (ch->pcdata->stancework);
ch->pcdata->stancework = str_dup ("");
ch->stance[stance] = 1;
SET_BIT (ch->pcdata->qstats[selected], QS_DONE);
send_to_char ("Congratulations, you now have a new stance!\n\r", ch);
return;
}
if (arg1[0] != '\0' && !str_cmp (arg1, "clear"))
{
ch->pcdata->qstats[selected] = 0;
send_to_char ("Stance options cleared.\n\r", ch);
return;
}
if (arg1[0] == '\0')
{
send_to_char
("#r------------------------------------------------------------------------------\n\r",
ch);
send_to_char
(" #r-= #nSuper Stances #r=-\n\r", ch);
send_to_char
("#r------------------------------------------------------------------------------\n\r",
ch);
send_to_char
("#r[#nHIT#r] #7Improves your chance to hit and parry.\n\r", ch);
send_to_char
("#r[#nDAM#r] #7Improves the amount of damage you inflict.\n\r", ch);
send_to_char ("#r[#nARM#r] #7Reduces your chance of being hit.\n\r",
ch);
send_to_char
("#r[#nPOW#r] #7Increases your maximum damage (damage cap).\n\r", ch);
send_to_char
("#r[#nRES#r] #7Reduces the maximum damage of those hitting you.\n\r\n\r",
ch);
switch (selected)
{
default:
case 0:
send_to_char
("#7You may have two of the above powers, costing #n500000#7 exp each.\n\r",
ch);
break;
case 1:
send_to_char
("#7You may have two of the above powers, costing #n500000#7 exp each.\n\r",
ch);
send_to_char
("#7One of the above powers may be a #rGREATER#7 power, costing #n1000000#7 exp instead.\n\r",
ch);
break;
case 2:
send_to_char
("#7You may have three of the above powers, costing #n500000#7 exp each.\n\r",
ch);
send_to_char
("#7Two of the above powers may be a #rGREATER#7 power, costing #n1000000#7 exp instead.\n\r",
ch);
break;
case 3:
send_to_char
("#7You may have four of the above powers, costing #n500000#7 exp each.\n\r",
ch);
send_to_char
("#7Two of the above powers may be a #rGREATER#7 power, costing #n1000000#7 exp instead.\n\r",
ch);
send_to_char
("#7One of the above powers may be a #rSUPREME#7 power, costing #n2000000#7 exp instead.\n\r",
ch);
break;
case 4:
send_to_char
("#7You may have five of the above powers, costing #n500000#7 exp each.\n\r",
ch);
send_to_char
("#7Three of the above powers may be a #rGREATER#7 power, costing #n1000000#7 exp instead.\n\r",
ch);
send_to_char
("#7Two of the above powers may be a #rSUPREME#7 power, costing #n2000000#7 exp instead.\n\r",
ch);
break;
}
send_to_char
("#r------------------------------------------------------------------------------\n\r",
ch);
send_to_char
("#7The following abilities cost #n2000000#7, #n4000000#7, #n6000000#7, etc - each:\n\r",
ch);
send_to_char
("#r[#nPARRY#r] #7Improved parry ability. #r[#n DODGE#r] #7Improved dodge ability.\n\r",
ch);
send_to_char
("#r[#nSPEED#r] #7Improved combat speed. #r[#nBYPASS#r] #7Bypass above two powers.\n\r",
ch);
send_to_char
("#r------------------------------------------------------------------------------\n\r",
ch);
send_to_char ("#7Currently selected options #n: ", ch);
if (ch->pcdata->qstats[selected] == 0)
send_to_char ("#GNone. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_HIT_LESSER))
send_to_char ("#GHIT. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_HIT_GREATER))
send_to_char ("#GHIT #y(#RGreater#y)#G. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_HIT_SUPREME))
send_to_char ("#GHIT #y(#RSupreme#y)#G. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_DAM_LESSER))
send_to_char ("#GDAM. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_DAM_GREATER))
send_to_char ("#GDAM #y(#RGreater#y)#G. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_DAM_SUPREME))
send_to_char ("#GDAM #y(#RSupreme#y)#G. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_ARM_LESSER))
send_to_char ("#GARM. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_ARM_GREATER))
send_to_char ("#GARM #y(#RGreater#y)#G. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_ARM_SUPREME))
send_to_char ("#GARM #y(#RSupreme#y)#G. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_POW_LESSER))
send_to_char ("#GPOW. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_POW_GREATER))
send_to_char ("#GPOW #y(#RGreater#y)#G. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_POW_SUPREME))
send_to_char ("#GPOW #y(#RSupreme#y)#G. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_RES_LESSER))
send_to_char ("#GRES. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_RES_GREATER))
send_to_char ("#GRES #y(#RGreater#y)#G. ", ch);
else if (IS_SET (ch->pcdata->qstats[selected], QS_RES_SUPREME))
send_to_char ("#GRES #y(#RSupreme#y)#G. ", ch);
send_to_char ("\n\r", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_DODGE) ||
IS_SET (ch->pcdata->qstats[selected], QS_SUPER_PARRY) ||
IS_SET (ch->pcdata->qstats[selected], QS_SUPER_SPEED) ||
IS_SET (ch->pcdata->qstats[selected], QS_SUPER_BYPASS))
{
send_to_char ("#&Special Abilities #n: ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_DODGE))
send_to_char ("#GDODGE. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_PARRY))
send_to_char ("#GPARRY. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_SPEED))
send_to_char ("#GSPEED. ", ch);
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_BYPASS))
send_to_char ("#GBYPASS. ", ch);
send_to_char ("\n\r", ch);
}
send_to_char
("#r------------------------------------------------------------------------------\n\r",
ch);
if (selected == 0)
{
send_to_char ("#7 Syntax #n: #7setstance #n<#rpower#n>#7.\n\r", ch);
send_to_char
("#7 To undo choice #n: #7setstance #n<#rpower#n> #7clear.\n\r",
ch);
}
else
{
send_to_char
("#7 Syntax #n: #7setstance #n<#rpower#n> <#rlevel#n>#7.\n\r",
ch);
send_to_char
("#7 To undo choice #n: #7setstance #n<#rpower#n> #7clear.\n\r",
ch);
}
send_to_char
("#r------------------------------------------------------------------------------\n\r",
ch);
send_to_char
("#7 When you have finished, type #n: #7setstance done.\n\r", ch);
send_to_char ("#7 To restart type #n: #7setstance clear.\n\r", ch);
send_to_char
("#r------------------------------------------------------------------------------\n\r",
ch);
return;
}
if (!str_cmp (arg1, "parry"))
{
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_PARRY))
{
send_to_char ("PARRY ability removed.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], QS_SUPER_PARRY);
}
else
{
send_to_char ("PARRY ability set.\n\r", ch);
SET_BIT (ch->pcdata->qstats[selected], QS_SUPER_PARRY);
}
return;
}
if (!str_cmp (arg1, "dodge"))
{
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_DODGE))
{
send_to_char ("DODGE ability removed.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], QS_SUPER_DODGE);
}
else
{
send_to_char ("DODGE ability set.\n\r", ch);
SET_BIT (ch->pcdata->qstats[selected], QS_SUPER_DODGE);
}
return;
}
if (!str_cmp (arg1, "speed"))
{
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_SPEED))
{
send_to_char ("SPEED ability removed.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], QS_SUPER_SPEED);
}
else
{
send_to_char ("SPEED ability set.\n\r", ch);
SET_BIT (ch->pcdata->qstats[selected], QS_SUPER_SPEED);
}
return;
}
if (!str_cmp (arg1, "bypass"))
{
if (IS_SET (ch->pcdata->qstats[selected], QS_SUPER_BYPASS))
{
send_to_char ("BYPASS ability removed.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], QS_SUPER_BYPASS);
}
else
{
send_to_char ("BYPASS ability set.\n\r", ch);
SET_BIT (ch->pcdata->qstats[selected], QS_SUPER_BYPASS);
}
return;
}
if (!str_cmp (arg1, "hit"))
{
p_l = QS_HIT_LESSER;
p_g = QS_HIT_GREATER;
p_s = QS_HIT_SUPREME;
}
else if (!str_cmp (arg1, "dam"))
{
p_l = QS_DAM_LESSER;
p_g = QS_DAM_GREATER;
p_s = QS_DAM_SUPREME;
}
else if (!str_cmp (arg1, "arm"))
{
p_l = QS_ARM_LESSER;
p_g = QS_ARM_GREATER;
p_s = QS_ARM_SUPREME;
}
else if (!str_cmp (arg1, "pow"))
{
p_l = QS_POW_LESSER;
p_g = QS_POW_GREATER;
p_s = QS_POW_SUPREME;
}
else if (!str_cmp (arg1, "res"))
{
p_l = QS_RES_LESSER;
p_g = QS_RES_GREATER;
p_s = QS_RES_SUPREME;
}
else
{
do_setstance (ch, "");
return;
}
if (arg2[0] == '\0' || !str_cmp (arg2, "lesser"))
{
if (lesser >= max_lesser)
{
if (selected == 0)
send_to_char ("You may not have any more powers.\n\r", ch);
else
send_to_char ("You may not have any more lesser powers.\n\r", ch);
}
else
{
send_to_char ("Ok.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], p_g);
REMOVE_BIT (ch->pcdata->qstats[selected], p_s);
SET_BIT (ch->pcdata->qstats[selected], p_l);
}
return;
}
else if (selected > 0 && !str_cmp (arg2, "greater"))
{
if (greater >= max_greater)
send_to_char ("You may not have any more greater powers.\n\r", ch);
else
{
send_to_char ("Ok.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], p_l);
REMOVE_BIT (ch->pcdata->qstats[selected], p_s);
SET_BIT (ch->pcdata->qstats[selected], p_g);
}
return;
}
else if (selected > 2 && !str_cmp (arg2, "supreme"))
{
if (supreme >= max_supreme)
send_to_char ("You may not have any more supreme powers.\n\r", ch);
else
{
send_to_char ("Ok.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], p_l);
REMOVE_BIT (ch->pcdata->qstats[selected], p_g);
SET_BIT (ch->pcdata->qstats[selected], p_s);
}
return;
}
else if (!str_cmp (arg2, "clear"))
{
send_to_char ("Cleared.\n\r", ch);
REMOVE_BIT (ch->pcdata->qstats[selected], p_l);
REMOVE_BIT (ch->pcdata->qstats[selected], p_g);
REMOVE_BIT (ch->pcdata->qstats[selected], p_s);
return;
}
do_setstance (ch, "");
return;
}
void
do_autostance (CHAR_DATA * ch, char *argument)
{
char arg[MIL];
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!str_cmp (arg, "none"))
{
send_to_char ("You no longer autostance.\n\r", ch);
ch->pcdata->autostance = STANCE_NONE;
}
else if (!str_cmp (arg, "crane"))
{
send_to_char ("#yYou now autostance into the #0crane #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_CRANE;
}
else if (!str_cmp (arg, "crab"))
{
send_to_char ("#yYou now autostance into the #0crab #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_CRAB;
}
else if (!str_cmp (arg, "bull"))
{
send_to_char ("#yYou now autostance into the #0bull #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_BULL;
}
else if (!str_cmp (arg, "viper"))
{
send_to_char ("#yYou now autostance into the #0viper #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_VIPER;
}
else if (!str_cmp (arg, "mongoose"))
{
send_to_char
("#yYou now autostance into the #0mongoose #ystance.#n\n\r", ch);
ch->pcdata->autostance = STANCE_MONGOOSE;
}
else if (!str_cmp (arg, "mantis")
&& ch->stance[STANCE_CRANE] >= 200
&& ch->stance[STANCE_VIPER] >= 200)
{
send_to_char ("#yYou now autostance into the #0mantis #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_MANTIS;
}
else if (!str_cmp (arg, "monkey")
&& ch->stance[STANCE_CRANE] >= 200
&& ch->stance[STANCE_MONGOOSE] >= 200)
{
send_to_char ("#yYou now autostance into the #0monkey #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_MONKEY;
}
else if (!str_cmp (arg, "swallow")
&& ch->stance[STANCE_CRAB] >= 200
&& ch->stance[STANCE_MONGOOSE] >= 200)
{
send_to_char ("#yYou now autostance into the #0swallow #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_SWALLOW;
}
else if (!str_cmp (arg, "tiger")
&& ch->stance[STANCE_BULL] >= 200
&& ch->stance[STANCE_VIPER] >= 200)
{
send_to_char ("#yYou now autostance into the #0tiger #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_TIGER;
}
else if (!str_cmp (arg, "dragon")
&& ch->stance[STANCE_CRAB] >= 200
&& ch->stance[STANCE_BULL] >= 200)
{
send_to_char ("#yYou now autostance into the #0dragon #ystance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_DRAGON;
}
else if ((!str_cmp (arg, "ss1") || !str_cmp (arg, "super1"))
&& ch->stance[STANCE_MANTIS] >= 200
&& ch->stance[STANCE_DRAGON] >= 200
&& ch->stance[STANCE_TIGER] >= 200
&& ch->stance[STANCE_MONKEY] >= 200
&& ch->stance[STANCE_SWALLOW] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[0], QS_DONE))
{
do_autostance (ch, "abc");
return;
}
send_to_char ("#yYou now autostance your #C1st #ySuper stance.#y\n\r",
ch);
ch->pcdata->autostance = STANCE_SUPER1;
}
else if ((!str_cmp (arg, "ss2") || !str_cmp (arg, "super2"))
&& ch->stance[STANCE_SUPER1] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[1], QS_DONE))
{
do_autostance (ch, "abc");
return;
}
send_to_char ("#yYou now autostance your #C2nd #ySuper stance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_SUPER2;
}
else if ((!str_cmp (arg, "ss3") || !str_cmp (arg, "super3"))
&& ch->stance[STANCE_SUPER2] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[2], QS_DONE))
{
do_autostance (ch, "abc");
return;
}
send_to_char ("#yYou now autostance your #C3rd #ySuper stance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_SUPER3;
}
else if ((!str_cmp (arg, "ss4") || !str_cmp (arg, "super4"))
&& ch->stance[STANCE_SUPER3] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[3], QS_DONE))
{
do_autostance (ch, "abc");
return;
}
send_to_char ("#yYou now autostance your #C4th #ySuper stance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_SUPER4;
}
else if ((!str_cmp (arg, "ss5") || !str_cmp (arg, "super5"))
&& ch->stance[STANCE_SUPER4] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[4], QS_DONE))
{
do_autostance (ch, "abc");
return;
}
send_to_char ("#yYou now autostance your #C5th #ySuper stance.#n\n\r",
ch);
ch->pcdata->autostance = STANCE_SUPER5;
}
else
{
send_to_char ("Syntax is: autostance <style>.\n\r", ch);
send_to_char
("Autostance being one of: None, Viper, Crane, Crab, Mongoose, Bull.\n\r",
ch);
send_to_char
(" If you know them: Mantis, Dragon, Tiger, Monkey, Swallow.\n\r",
ch);
send_to_char
(" If you set them : Super1, Super2, Super3, Super4, Super5.\n\r",
ch);
return;
}
return;
}
void
do_stance (CHAR_DATA * ch, char *argument)
{
char arg[MIL];
char buf[MSL];
char buf2[MSL];
int selection;
bool got_adv = FALSE;
bool got_super = FALSE;
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (IS_SET (ch->mounted, IS_RIDING))
{
send_to_char ("Not while mounted.\n\r", ch);
return;
}
/*
if (IS_AFFECTED(ch, AFF_POLYMORPH) && !IS_VAMPAFF(ch, VAM_DISGUISED))
{
send_to_char("Not while polymorphed.\n\r",ch);
return;
}
*/
if (arg[0] == '\0')
{
if (ch->stance[0] == -1)
{
ch->stance[0] = 0;
send_to_char ("You drop into a fighting stance.\n\r", ch);
act ("$n drops into a fighting stance.", ch, NULL, NULL, TO_ROOM);
}
else
{
/* if (!IS_NPC(ch) && ch->stance[0] >= 11)
{
free_string(ch->pcdata->stancename);
ch->pcdata->stancename = str_dup( "" );
}*/
ch->stance[0] = -1;
send_to_char ("You relax from your fighting stance.\n\r", ch);
act ("$n relaxes from $s fighting stance.", ch, NULL, NULL,
TO_ROOM);
}
return;
}
if (ch->stance[0] > 0)
{
send_to_char
("You cannot change stances until you come up from the one you are currently in.\n\r",
ch);
return;
}
if (!str_cmp (arg, "none"))
{
selection = STANCE_NONE;
send_to_char ("You drop into a general fighting stance.\n\r", ch);
act ("$n drops into a general fighting stance.", ch, NULL, NULL,
TO_ROOM);
}
else if (!str_cmp (arg, "viper"))
{
selection = STANCE_VIPER;
send_to_char ("You arch your body into the viper fighting stance.\n\r",
ch);
act ("$n arches $s body into the viper fighting stance.", ch, NULL,
NULL, TO_ROOM);
}
else if (!str_cmp (arg, "crane"))
{
selection = STANCE_CRANE;
send_to_char ("You swing your body into the crane fighting stance.\n\r",
ch);
act ("$n swings $s body into the crane fighting stance.", ch, NULL,
NULL, TO_ROOM);
}
else if (!str_cmp (arg, "crab"))
{
selection = STANCE_CRAB;
send_to_char ("You squat down into the crab fighting stance.\n\r", ch);
act ("$n squats down into the crab fighting stance. ", ch, NULL, NULL,
TO_ROOM);
}
else if (!str_cmp (arg, "mongoose"))
{
selection = STANCE_MONGOOSE;
send_to_char ("You twist into the mongoose fighting stance.\n\r", ch);
act ("$n twists into the mongoose fighting stance. ", ch, NULL, NULL,
TO_ROOM);
}
else if (!str_cmp (arg, "bull"))
{
selection = STANCE_BULL;
send_to_char ("You hunch down into the bull fighting stance.\n\r", ch);
act ("$n hunches down into the bull fighting stance. ", ch, NULL, NULL,
TO_ROOM);
}
else
{
strcpy (buf, "Super stances :");
if (IS_SET (ch->pcdata->qstats[0], QS_DONE))
{
strcat (buf, " Super1");
got_super = TRUE;
}
if (IS_SET (ch->pcdata->qstats[1], QS_DONE))
{
strcat (buf, " Super2");
got_super = TRUE;
}
if (IS_SET (ch->pcdata->qstats[2], QS_DONE))
{
strcat (buf, " Super3");
got_super = TRUE;
}
if (IS_SET (ch->pcdata->qstats[3], QS_DONE))
{
strcat (buf, " Super4");
got_super = TRUE;
}
if (IS_SET (ch->pcdata->qstats[4], QS_DONE))
{
strcat (buf, " Super5");
got_super = TRUE;
}
strcpy (buf2, "Advanced stances:");
if (ch->stance[STANCE_CRANE] >= 200 && ch->stance[STANCE_VIPER] >= 200)
{
strcat (buf2, " Mantis");
got_adv = TRUE;
}
if (ch->stance[STANCE_BULL] >= 200 && ch->stance[STANCE_CRAB] >= 200)
{
strcat (buf2, " Dragon");
got_adv = TRUE;
}
if (ch->stance[STANCE_BULL] >= 200 && ch->stance[STANCE_VIPER] >= 200)
{
strcat (buf2, " Tiger");
got_adv = TRUE;
}
if (ch->stance[STANCE_CRANE] >= 200
&& ch->stance[STANCE_MONGOOSE] >= 200)
{
strcat (buf2, " Monkey");
got_adv = TRUE;
}
if (ch->stance[STANCE_CRAB] >= 200
&& ch->stance[STANCE_MONGOOSE] >= 200)
{
strcat (buf2, " Swallow");
got_adv = TRUE;
}
strcat (buf2, ".\n\r");
if (!str_cmp (arg, "mantis") && ch->stance[STANCE_CRANE] >= 200
&& ch->stance[STANCE_VIPER] >= 200)
{
selection = STANCE_MANTIS;
send_to_char
("You spin your body into the mantis fighting stance.\n\r", ch);
act ("$n spins $s body into the mantis fighting stance.", ch, NULL,
NULL, TO_ROOM);
}
else if (!str_cmp (arg, "dragon") && ch->stance[STANCE_BULL] >= 200
&& ch->stance[STANCE_CRAB] >= 200)
{
selection = STANCE_DRAGON;
send_to_char
("You coil your body into the dragon fighting stance.\n\r", ch);
act ("$n coils $s body into the dragon fighting stance.", ch, NULL,
NULL, TO_ROOM);
}
else if (!str_cmp (arg, "tiger") && ch->stance[STANCE_BULL] >= 200
&& ch->stance[STANCE_VIPER] >= 200)
{
selection = STANCE_TIGER;
send_to_char ("You lunge into the tiger fighting stance.\n\r", ch);
act ("$n lunges into the tiger fighting stance.", ch, NULL, NULL,
TO_ROOM);
}
else if (!str_cmp (arg, "monkey") && ch->stance[STANCE_CRANE] >= 200
&& ch->stance[STANCE_MONGOOSE] >= 200)
{
selection = STANCE_MONKEY;
send_to_char
("You rotate your body into the monkey fighting stance.\n\r", ch);
act ("$n rotates $s body into the monkey fighting stance.", ch,
NULL, NULL, TO_ROOM);
}
else if (!str_cmp (arg, "swallow") && ch->stance[STANCE_CRAB] >= 200
&& ch->stance[STANCE_MONGOOSE] >= 200)
{
selection = STANCE_SWALLOW;
send_to_char ("You slide into the swallow fighting stance.\n\r",
ch);
act ("$n slides into the swallow fighting stance.", ch, NULL, NULL,
TO_ROOM);
}
else if ((!str_cmp (arg, "ss1") || !str_cmp (arg, "super1"))
&& ch->stance[STANCE_MANTIS] >= 200
&& ch->stance[STANCE_DRAGON] >= 200
&& ch->stance[STANCE_TIGER] >= 200
&& ch->stance[STANCE_MONKEY] >= 200
&& ch->stance[STANCE_SWALLOW] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[0], QS_DONE))
{
do_stance (ch, "abc");
return;
}
selection = STANCE_SUPER1;
send_to_char ("You autodrop into the 1st Super stance.\n\r", ch);
act ("$n autodrops into the 1st Super stance.\n\r", ch, NULL, NULL,
TO_ROOM);
}
else if ((!str_cmp (arg, "ss2") || !str_cmp (arg, "super2"))
&& ch->stance[STANCE_SUPER1] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[1], QS_DONE))
{
do_stance (ch, "abc");
return;
}
selection = STANCE_SUPER2;
send_to_char ("You autodrop into the 2nd Super stance.\n\r", ch);
act ("$n autodrops into the 2nd Super stance.\n\r", ch, NULL, NULL,
TO_ROOM);
}
else if ((!str_cmp (arg, "ss3") || !str_cmp (arg, "super3"))
&& ch->stance[STANCE_SUPER2] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[2], QS_DONE))
{
do_stance (ch, "abc");
return;
}
selection = STANCE_SUPER3;
send_to_char ("You autodrop into the 3rd Super stance.\n\r", ch);
act ("$n autodrops into the 3rd Super stance.\n\r", ch, NULL, NULL,
TO_ROOM);
}
else if ((!str_cmp (arg, "ss4") || !str_cmp (arg, "super4"))
&& ch->stance[STANCE_SUPER3] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[3], QS_DONE))
{
do_stance (ch, "abc");
return;
}
selection = STANCE_SUPER4;
send_to_char ("You autodrop into the 4th Super stance.\n\r", ch);
act ("$n autodrops into the 4th Super stance.\n\r", ch, NULL, NULL,
TO_ROOM);
}
else if ((!str_cmp (arg, "ss5") || !str_cmp (arg, "super5"))
&& ch->stance[STANCE_SUPER4] >= 200)
{
if (!IS_SET (ch->pcdata->qstats[4], QS_DONE))
{
do_stance (ch, "abc");
return;
}
selection = STANCE_SUPER5;
send_to_char ("You autodrop into the 5th Super stance.\n\r", ch);
act ("$n autodrops into the 5th Super stance.\n\r", ch, NULL, NULL,
TO_ROOM);
}
else
{
send_to_char ("Syntax is: stance <style>.\n\r", ch);
send_to_char ("Basic stances: Viper Crane Crab Mongoose Bull.\n\r",
ch);
if (got_adv)
send_to_char (buf2, ch);
if (got_super)
send_to_char (buf, ch);
return;
}
}
ch->stance[0] = selection;
waiting (ch, 4);
return;
}
void
set_autostance (CHAR_DATA * ch)
{
int st;
char buf[MIL];
char buf2[MIL];
char stancename[10];
if (IS_NPC (ch))
return;
st = ch->pcdata->autostance;
if (st == STANCE_VIPER)
sprintf (stancename, "viper");
else if (st == STANCE_CRANE)
sprintf (stancename, "crane");
else if (st == STANCE_CRAB)
sprintf (stancename, "crab");
else if (st == STANCE_MONGOOSE)
sprintf (stancename, "mongoose");
else if (st == STANCE_BULL)
sprintf (stancename, "bull");
else if (st == STANCE_MANTIS)
sprintf (stancename, "mantis");
else if (st == STANCE_DRAGON)
sprintf (stancename, "dragon");
else if (st == STANCE_TIGER)
sprintf (stancename, "tiger");
else if (st == STANCE_MONKEY)
sprintf (stancename, "monkey");
else if (st == STANCE_SWALLOW)
sprintf (stancename, "swallow");
else if (st == STANCE_SUPER1)
sprintf (stancename, "ss1");
else if (st == STANCE_SUPER2)
sprintf (stancename, "ss2");
else if (st == STANCE_SUPER3)
sprintf (stancename, "ss3");
else if (st == STANCE_SUPER4)
sprintf (stancename, "ss4");
else if (st == STANCE_SUPER5)
sprintf (stancename, "ss5");
else
return;
if (ch->stance[0] < 1)
{
do_stance (ch, stancename);
}
}