kav_fight.c
demise/src/kav_fight.c · 163.2 KB
From the archive dodbackup-final.tar.gz
Download the archive « Back to the archive contents
/***************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Much time and thought has gone into this software and you are *
* benefitting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************/
/***************************************************************************
* God Wars Mud improvements copyright (C) 1994, 1995, 1996 by Richard *
* Woolcock. This mud is NOT to be copied in whole or in part, or to be *
* run without the permission of Richard Woolcock. Nobody else has *
* permission to authorise the use of this code. *
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
/*
* Local functions.
*/
void special_hurl args ((CHAR_DATA * ch, CHAR_DATA * victim));
void
improve_wpn (CHAR_DATA * ch, int dtype, bool right_hand)
{
OBJ_DATA *wield = NULL;
char bufskill[30];
char buf[MIL];
char weap[20];
int dice1;
int dice2;
int trapper;
int max_skl = 200;
int chance = 55;
bool got_weapon = FALSE;
dice1 = number_percent ();
dice2 = number_percent ();
if (IS_NPC (ch))
return;
if (IS_MONK (ch))
max_skl = 400;
if (IS_HL (ch))
max_skl = 500;
if (IS_WM (ch))
max_skl = 600;
if (IS_DRAC_WARRIOR (ch))
max_skl = 300;
if (IS_SET (mudconfig->world_affects, WORLD_DOUBLETRAIN))
chance -= 15;
if (IS_SET (mudconfig->world_affects, WORLD_HALFTRAIN))
chance += 15;
/*
if (right_hand) wield = get_eq_char( ch, WEAR_WIELD );
else wield = get_eq_char( ch, WEAR_HOLD );
*/
if (dtype == TYPE_HIT)
got_weapon = FALSE;
else if (right_hand)
{
if ((wield = get_eq_char (ch, WEAR_WIELD)) != NULL &&
wield->item_type == ITEM_WEAPON)
got_weapon = TRUE;
}
else
{
if ((wield = get_eq_char (ch, WEAR_HOLD)) != NULL &&
wield->item_type == ITEM_WEAPON)
got_weapon = TRUE;
}
if (!got_weapon)
wield = NULL;
if (!IS_MONK (ch) && wield == NULL && !IS_XX (ch, XX_RAKMONK))
{
dtype = TYPE_HIT;
}
else if (wield == NULL && (IS_MONK (ch) || IS_XX (ch, XX_RAKMONK)))
{
if (ch->handform == SLICEFORM)
{
dtype = TYPE_HIT + 1;
sprintf (weap, "slicing");
}
else if (ch->handform == STABFORM)
{
dtype = TYPE_HIT + 2;
sprintf (weap, "stabing");
}
else if (ch->handform == SLASHFORM)
{
dtype = TYPE_HIT + 3;
sprintf (weap, "slashing");
}
else if (ch->handform == WHIPFORM)
{
dtype = TYPE_HIT + 4;
sprintf (weap, "whiping");
}
else if (ch->handform == CLAWFORM)
{
dtype = TYPE_HIT + 5;
sprintf (weap, "clawing");
}
else if (ch->handform == BLASTFORM)
{
dtype = TYPE_HIT + 6;
sprintf (weap, "blasting");
}
else if (ch->handform == POUNDFORM)
{
dtype = TYPE_HIT + 7;
sprintf (weap, "pounding");
}
else if (ch->handform == CRUSHFORM)
{
dtype = TYPE_HIT + 8;
sprintf (weap, "crushing");
}
else if (ch->handform == GREPFORM)
{
dtype = TYPE_HIT + 9;
sprintf (weap, "greping");
}
else if (ch->handform == BITEFORM)
{
dtype = TYPE_HIT + 10;
sprintf (weap, "biting");
}
else if (ch->handform == PIERCEFORM)
{
dtype = TYPE_HIT + 11;
sprintf (weap, "piercing");
}
else if (ch->handform == SUCKFORM)
{
dtype = TYPE_HIT + 12;
sprintf (weap, "sucking");
}
else
{
dtype = TYPE_HIT;
sprintf (weap, "unarmed");
}
}
else if (dtype == TYPE_UNDEFINED)
{
dtype = TYPE_HIT;
if (wield != NULL && wield->item_type == ITEM_WEAPON)
dtype += wield->value[3];
}
if (IS_HL (ch) && dtype == 1001)
{
max_skl *= 2;
}
if (IS_MONK (ch) && dtype == 1000)
{
max_skl *= 2;
}
if (IS_KAHN (ch) && dtype == 1000)
{
max_skl *= 2;
}
if (ch->pcdata->wpntrain > 0)
{
max_skl += (10 * ch->pcdata->wpntrain);
}
if (dtype < 1000 || dtype > 1012)
return;
dtype -= 1000;
if (ch->wpn[dtype] > max_skl)
ch->wpn[dtype] = max_skl;
if (ch->wpn[dtype] >= max_skl)
{
ch->training[dtype] = 0;
return;
}
trapper = ch->wpn[dtype];
if ((dice1 > ch->training[dtype] && dice2 > ch->training[dtype]) ||
(dice1 >= chance || dice2 >= chance))
ch->training[dtype] += number_range (10, 18);
else
return;
if (ch->training[dtype] >= ch->wpn[dtype])
{
ch->wpn[dtype]++;
ch->training[dtype] = 0;
}
if (trapper == ch->wpn[dtype])
return;
if (ch->wpn[dtype] == 1)
sprintf (bufskill, "slightly skilled");
else if (ch->wpn[dtype] == 26)
sprintf (bufskill, "reasonable");
else if (ch->wpn[dtype] == 51)
sprintf (bufskill, "fairly competent");
else if (ch->wpn[dtype] == 76)
sprintf (bufskill, "highly skilled");
else if (ch->wpn[dtype] == 101)
sprintf (bufskill, "very dangerous");
else if (ch->wpn[dtype] == 126)
sprintf (bufskill, "extremely deadly");
else if (ch->wpn[dtype] == 151)
sprintf (bufskill, "an expert");
else if (ch->wpn[dtype] == 176)
sprintf (bufskill, "a master");
else if (ch->wpn[dtype] == 200)
sprintf (bufskill, "a grand master");
else if (ch->wpn[dtype] == 300)
sprintf (bufskill, "fantastically skilled");
else if (ch->wpn[dtype] == 400)
sprintf (bufskill, "supremely skilled");
else if (ch->wpn[dtype] == 500)
sprintf (bufskill, "a supreme master");
else if (ch->wpn[dtype] == 600)
sprintf (bufskill, "an ultimate master");
else if (ch->wpn[dtype] == 700)
sprintf (bufskill, "a high supreme master");
else if (ch->wpn[dtype] == 800)
sprintf (bufskill, "a high ultimate master");
else if (ch->wpn[dtype] == 1000)
sprintf (bufskill, "a legendary master");
else if (ch->wpn[dtype] == 1100)
sprintf (bufskill, "a complete master");
else if (ch->wpn[dtype] == 1200)
sprintf (bufskill, "a fabled master");
else if (ch->wpn[dtype] == 1300)
sprintf (bufskill, "skilled beyond measure");
else
return;
if (wield == NULL && ch->handform == 0 || dtype == 0)
sprintf (buf, "You are now %s at unarmed combat.\n\r", bufskill);
else
{
if (IS_MONK (ch) || IS_RAKSHASA (ch))
sprintf (buf, "You are now %s with %s weapons.\n\r", bufskill, weap);
else
sprintf (buf, "You are now %s with %s.\n\r", bufskill,
wield->short_descr);
}
ADD_COLOUR (ch, buf, WHITE);
send_to_char (buf, ch);
if (ch->wpn[dtype] == max_skl)
{
ch->exp += 1000000;
}
return;
}
void
improve_stance (CHAR_DATA * ch)
{
char buf[MIL];
char bufskill[25];
char stancename[10];
int dice1, dice2, stance, max, train;
bool trained = FALSE;
dice1 = number_percent ();
dice2 = number_range (1, 100);
if (IS_NPC (ch))
return;
switch (stance = ch->stance[0])
{
default:
return;
case 1:
case 2:
case 3:
case 4:
case 5:
max = 53;
break;
case 6:
case 7:
case 8:
case 9:
case 10:
max = 54;
break;
case 11:
case 12:
case 13:
case 14:
case 15:
max = 55;
break;
break;
}
train = stance + 12;
if (IS_SET (mudconfig->world_affects, WORLD_DOUBLETRAIN))
max -= 15;
if (IS_SET (mudconfig->world_affects, WORLD_HALFTRAIN))
max += 15;
/* Just in case of class changes, etc */
if (ch->stance[stance] >= 200)
{
ch->stance[stance] = 200;
ch->training[train] = 0;
return;
}
if ((dice1 > ch->training[train] && dice2 > ch->training[train]) ||
(dice1 >= max || dice2 >= max))
ch->training[train] += number_range (5, 10);
else
return;
if (ch->training[train] >= ch->stance[stance])
{
ch->stance[stance]++;
ch->training[train] = 0;
trained = TRUE;
}
if (!trained)
return;
if (ch->stance[stance] == 1)
sprintf (bufskill, "an apprentice of");
else if (ch->stance[stance] == 26)
sprintf (bufskill, "a trainee of");
else if (ch->stance[stance] == 51)
sprintf (bufskill, "a student of");
else if (ch->stance[stance] == 76)
sprintf (bufskill, "fairly experienced in");
else if (ch->stance[stance] == 101)
sprintf (bufskill, "well trained in");
else if (ch->stance[stance] == 126)
sprintf (bufskill, "highly skilled in");
else if (ch->stance[stance] == 151)
sprintf (bufskill, "an expert of");
else if (ch->stance[stance] == 176)
sprintf (bufskill, "a master of");
else if (ch->stance[stance] == 200)
sprintf (bufskill, "a grand master of");
else
return;
if (stance == STANCE_VIPER)
sprintf (stancename, "viper");
else if (stance == STANCE_CRANE)
sprintf (stancename, "crane");
else if (stance == STANCE_CRAB)
sprintf (stancename, "crab");
else if (stance == STANCE_MONGOOSE)
sprintf (stancename, "mongoose");
else if (stance == STANCE_BULL)
sprintf (stancename, "bull");
else if (stance == STANCE_MANTIS)
sprintf (stancename, "mantis");
else if (stance == STANCE_DRAGON)
sprintf (stancename, "dragon");
else if (stance == STANCE_TIGER)
sprintf (stancename, "tiger");
else if (stance == STANCE_MONKEY)
sprintf (stancename, "monkey");
else if (stance == STANCE_SWALLOW)
sprintf (stancename, "swallow");
else if (!IS_NPC (ch) && stance >= 11)
{
if (strlen (ch->pcdata->stancename) < 2)
return;
strcpy (stancename, ch->pcdata->stancename);
}
else
return;
sprintf (buf, "You are now %s the %s stance.\n\r", bufskill, stancename);
ADD_COLOUR (ch, buf, WHITE);
send_to_char (buf, ch);
if (ch->stance[stance] == 200)
{
if (stance >= 11)
ch->exp += 5000000;
else if (stance >= STANCE_MANTIS)
ch->exp += 2000000;
else
ch->exp += 1000000;
}
return;
}
void
do_alignment (CHAR_DATA * ch, char *argument)
{
char arg[MIL];
one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (IS_DEMON (ch) || IS_ANGELW (ch))
{
send_to_char ("You are unable to change your alignment.\n\r", ch);
return;
}
if (arg[0] == '\0')
{
send_to_char ("Please enter 'good', 'neutral', or 'evil'.\n\r", ch);
return;
}
if (!str_cmp (arg, "good"))
{
ch->alignment = 1000;
send_to_char ("Alignment is now angelic.\n\r", ch);
}
else if (!str_cmp (arg, "neutral"))
{
ch->alignment = 0;
send_to_char ("Alignment is now neutral.\n\r", ch);
}
else if (!str_cmp (arg, "evil"))
{
ch->alignment = -1000;
send_to_char ("Alignment is now satanic.\n\r", ch);
}
else
send_to_char ("Please enter 'good', 'neutral', or 'evil'.\n\r", ch);
return;
}
void
do_side (CHAR_DATA * ch, char *argument)
{
char buf[MIL];
char arg[MIL];
one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!IS_VAMPIRE (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (strlen (ch->side) > 1)
{
send_to_char ("But you have already chosen a sect!\n\r", ch);
return;
}
if (arg[0] == '\0')
{
send_to_char ("Please choose a sect: Camarilla, Sabbat, Anarch.\n\r",
ch);
return;
}
if (!str_cmp (arg, "anarch"))
{
if (strlen (ch->clan) > 1)
{
if (!str_cmp (ch->clan, "tzimisce"))
{
send_to_char
("Your kind are not welcome among the Anarchs.\n\r", ch);
return;
}
}
free_string (ch->side);
ch->side = str_dup ("Anarch");
send_to_char ("You are now an Anarch.\n\r", ch);
sprintf (buf, "#r%s#n is now an Anarch!", ch->name);
do_info (ch, buf);
return;
}
else if (!str_cmp (arg, "camarilla"))
{
if (strlen (ch->clan) > 1)
{
if (!str_cmp (ch->clan, "baali") || !str_cmp (ch->clan, "tzimisce"))
{
send_to_char ("Your kind are not welcome in the Camarilla.\n\r",
ch);
return;
}
if (!str_cmp (ch->clan, "lasombra"))
SET_BIT (ch->more, MORE_ANTITRIBU);
}
free_string (ch->side);
ch->side = str_dup ("Camarilla");
send_to_char ("You are now a member of the Camarilla.\n\r", ch);
sprintf (buf, "#r%s#n has sided with the Camarilla!", ch->name);
do_info (ch, buf);
return;
}
else if (!str_cmp (arg, "sabbat"))
{
if (strlen (ch->clan) > 1)
{
if (!str_cmp (ch->clan, "baali"))
{
send_to_char ("Your kind are not welcome in the Sabbat.\n\r",
ch);
return;
}
if (!str_cmp (ch->clan, "brujah") || !str_cmp (ch->clan, "gangrel")
|| !str_cmp (ch->clan, "malkavian")
|| !str_cmp (ch->clan, "nosferatu")
|| !str_cmp (ch->clan, "toreador")
|| !str_cmp (ch->clan, "tremere")
|| !str_cmp (ch->clan, "ventrue")
|| !str_cmp (ch->clan, "assamite"))
SET_BIT (ch->more, MORE_ANTITRIBU);
}
free_string (ch->side);
ch->side = str_dup ("Sabbat");
send_to_char ("You are now a member of the Sabbat.\n\r", ch);
sprintf (buf, "#r%s#n has sided with the Sabbat!", ch->name);
do_info (ch, buf);
return;
}
else
send_to_char ("Please choose a sect: Camarilla, Sabbat, Anarch.\n\r", ch);
return;
}
void
do_skill (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
char buf[MSL];
char buf2[MSL];
char buf3[MSL];
char buf4[MSL];
char bufskill[25];
char bufskill2[25];
char bufskill3[25];
char bufskill4[25];
char arg[MIL];
OBJ_DATA *wield;
OBJ_DATA *wield2;
OBJ_DATA *wield3;
OBJ_DATA *wield4;
int dtype;
int dtype2;
int dtype3;
int dtype4;
int con_skill;
one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (arg[0] == '\0')
sprintf (arg, ch->name);
if ((victim = get_char_room (ch, arg)) == NULL)
{
send_to_char ("They aren't here.\n\r", ch);
return;
}
/*
if (IS_NPC(victim))
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
*/
wield = get_eq_char (victim, WEAR_WIELD);
wield2 = get_eq_char (victim, WEAR_HOLD);
wield3 = get_eq_char (victim, WEAR_THIRD_HAND);
wield4 = get_eq_char (victim, WEAR_FOURTH_HAND);
dtype = TYPE_HIT;
dtype2 = TYPE_HIT;
dtype3 = TYPE_HIT;
dtype4 = TYPE_HIT;
if (wield != NULL && wield->item_type == ITEM_WEAPON)
dtype += wield->value[3];
if (wield2 != NULL && wield2->item_type == ITEM_WEAPON)
dtype2 += wield2->value[3];
if (wield3 != NULL && wield3->item_type == ITEM_WEAPON)
dtype3 += wield3->value[3];
if (wield4 != NULL && wield4->item_type == ITEM_WEAPON)
dtype4 += wield4->value[3];
dtype -= 1000;
dtype2 -= 1000;
dtype3 -= 1000;
dtype4 -= 1000;
if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_FAKE_CON) && victim != ch)
con_skill = victim->pcdata->fake_skill;
else
con_skill = victim->wpn[dtype];
if (con_skill <= 0)
sprintf (bufskill, "totally unskilled");
else if (con_skill <= 25)
sprintf (bufskill, "slightly skilled");
else if (con_skill <= 50)
sprintf (bufskill, "reasonable");
else if (con_skill <= 75)
sprintf (bufskill, "fairly competent");
else if (con_skill <= 100)
sprintf (bufskill, "highly skilled");
else if (con_skill <= 125)
sprintf (bufskill, "very dangerous");
else if (con_skill <= 150)
sprintf (bufskill, "extremely deadly");
else if (con_skill <= 175)
sprintf (bufskill, "an expert");
else if (con_skill <= 199)
sprintf (bufskill, "a master");
else if (con_skill == 200)
sprintf (bufskill, "a grand master");
else if (con_skill <= 1000)
sprintf (bufskill, "supremely skilled");
else
return;
if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_FAKE_CON) && victim != ch)
con_skill = victim->pcdata->fake_skill;
else
con_skill = victim->wpn[dtype2];
if (con_skill <= 0)
sprintf (bufskill2, "totally unskilled");
else if (con_skill <= 25)
sprintf (bufskill2, "slightly skilled");
else if (con_skill <= 50)
sprintf (bufskill2, "reasonable");
else if (con_skill <= 75)
sprintf (bufskill2, "fairly competent");
else if (con_skill <= 100)
sprintf (bufskill2, "highly skilled");
else if (con_skill <= 125)
sprintf (bufskill2, "very dangerous");
else if (con_skill <= 150)
sprintf (bufskill2, "extremely deadly");
else if (con_skill <= 175)
sprintf (bufskill2, "an expert");
else if (con_skill <= 199)
sprintf (bufskill2, "a master");
else if (con_skill == 200)
sprintf (bufskill2, "a grand master");
else if (con_skill <= 1000)
sprintf (bufskill2, "supremely skilled");
else
return;
if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_FAKE_CON) && victim != ch)
con_skill = victim->pcdata->fake_skill;
else
con_skill = victim->wpn[dtype3];
if (con_skill <= 0)
sprintf (bufskill3, "totally unskilled");
else if (con_skill <= 25)
sprintf (bufskill3, "slightly skilled");
else if (con_skill <= 50)
sprintf (bufskill3, "reasonable");
else if (con_skill <= 75)
sprintf (bufskill3, "fairly competent");
else if (con_skill <= 100)
sprintf (bufskill3, "highly skilled");
else if (con_skill <= 125)
sprintf (bufskill3, "very dangerous");
else if (con_skill <= 150)
sprintf (bufskill3, "extremely deadly");
else if (con_skill <= 175)
sprintf (bufskill3, "an expert");
else if (con_skill <= 199)
sprintf (bufskill3, "a master");
else if (con_skill == 200)
sprintf (bufskill3, "a grand master");
else if (con_skill <= 1000)
sprintf (bufskill3, "supremely skilled");
else
return;
if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_FAKE_CON) && victim != ch)
con_skill = victim->pcdata->fake_skill;
else
con_skill = victim->wpn[dtype4];
if (con_skill <= 0)
sprintf (bufskill4, "totally unskilled");
else if (con_skill <= 25)
sprintf (bufskill4, "slightly skilled");
else if (con_skill <= 50)
sprintf (bufskill4, "reasonable");
else if (con_skill <= 75)
sprintf (bufskill4, "fairly competent");
else if (con_skill <= 100)
sprintf (bufskill4, "highly skilled");
else if (con_skill <= 125)
sprintf (bufskill4, "very dangerous");
else if (con_skill <= 150)
sprintf (bufskill4, "extremely deadly");
else if (con_skill <= 175)
sprintf (bufskill4, "an expert");
else if (con_skill <= 199)
sprintf (bufskill4, "a master");
else if (con_skill == 200)
sprintf (bufskill4, "a grand master");
else if (con_skill <= 1000)
sprintf (bufskill4, "supremely skilled");
else
return;
if (ch == victim)
{
if (dtype == 0 && dtype2 == 0 && dtype3 == 0 && dtype4 == 0)
sprintf (buf, "You are %s at unarmed combat.", bufskill);
else
{
if (dtype != 0)
sprintf (buf, "You are %s with %s.", bufskill,
wield->short_descr);
if (dtype2 != 0)
sprintf (buf2, "You are %s with %s.", bufskill2,
wield2->short_descr);
if (dtype3 != 0)
sprintf (buf3, "You are %s with %s.", bufskill3,
wield3->short_descr);
if (dtype4 != 0)
sprintf (buf4, "You are %s with %s.", bufskill4,
wield4->short_descr);
}
}
else
{
if (dtype == 0 && dtype2 == 0 && dtype3 == 0 && dtype4 == 0)
sprintf (buf, "$N is %s at unarmed combat.", bufskill);
else
{
if (dtype != 0)
sprintf (buf, "$N is %s with %s.", bufskill, wield->short_descr);
if (dtype2 != 0)
sprintf (buf2, "$N is %s with %s.", bufskill2,
wield2->short_descr);
if (dtype3 != 0)
sprintf (buf3, "$N is %s with %s.", bufskill3,
wield3->short_descr);
if (dtype4 != 0)
sprintf (buf4, "$N is %s with %s.", bufskill4,
wield4->short_descr);
}
}
if (dtype != 0)
act (buf, ch, NULL, victim, TO_CHAR);
if (dtype2 != 0)
act (buf2, ch, NULL, victim, TO_CHAR);
if (dtype3 != 0)
act (buf3, ch, NULL, victim, TO_CHAR);
if (dtype4 != 0)
act (buf4, ch, NULL, victim, TO_CHAR);
skillstance (ch, victim);
return;
}
void
do_throw (CHAR_DATA * ch, char *argument)
{
ROOM_INDEX_DATA *location;
ROOM_INDEX_DATA *to_room;
EXIT_DATA *pexit;
CHAR_DATA *victim = NULL;
OBJ_DATA *obj;
char arg1[MIL];
char arg2[MIL];
char buf[MIL];
char revdoor[MIL];
int door;
argument = one_argument (argument, arg1);
argument = one_argument (argument, arg2);
if ((obj = get_eq_char (ch, WEAR_WIELD)) == NULL)
{
if ((obj = get_eq_char (ch, WEAR_HOLD)) == NULL)
{
send_to_char ("You are not holding anything to throw.\n\r", ch);
return;
}
}
if (arg1[0] == '\0')
{
send_to_char ("Which direction do you wish to throw?\n\r", ch);
return;
}
if (!str_cmp (arg1, "n") || !str_cmp (arg1, "north"))
{
door = 0;
sprintf (arg1, "north");
}
else if (!str_cmp (arg1, "e") || !str_cmp (arg1, "east"))
{
door = 1;
sprintf (arg1, "east");
}
else if (!str_cmp (arg1, "s") || !str_cmp (arg1, "south"))
{
door = 2;
sprintf (arg1, "south");
}
else if (!str_cmp (arg1, "w") || !str_cmp (arg1, "west"))
{
door = 3;
sprintf (arg1, "west");
}
else if (!str_cmp (arg1, "u") || !str_cmp (arg1, "up"))
{
door = 4;
sprintf (arg1, "up");
}
else if (!str_cmp (arg1, "d") || !str_cmp (arg1, "down"))
{
door = 5;
sprintf (arg1, "down");
}
else
{
send_to_char
("You can only throw north, south, east, west, up or down.\n\r", ch);
return;
}
if (!str_cmp (arg1, "north"))
{
door = 0;
sprintf (revdoor, "south");
}
else if (!str_cmp (arg1, "east"))
{
door = 1;
sprintf (revdoor, "west");
}
else if (!str_cmp (arg1, "south"))
{
door = 2;
sprintf (revdoor, "north");
}
else if (!str_cmp (arg1, "west"))
{
door = 3;
sprintf (revdoor, "east");
}
else if (!str_cmp (arg1, "up"))
{
door = 4;
sprintf (revdoor, "down");
}
else if (!str_cmp (arg1, "down"))
{
door = 5;
sprintf (revdoor, "up");
}
else
return;
location = ch->in_room;
sprintf (buf, "You hurl $p %s.", arg1);
act (buf, ch, obj, NULL, TO_CHAR);
sprintf (buf, "$n hurls $p %s.", arg1);
act (buf, ch, obj, NULL, TO_ROOM);
/* First room */
if ((pexit = ch->in_room->exit[door]) == NULL
|| (to_room = pexit->to_room) == NULL)
{
sprintf (buf, "$p bounces off the %s wall.", arg1);
act (buf, ch, obj, NULL, TO_ROOM);
act (buf, ch, obj, NULL, TO_CHAR);
obj_from_char (obj);
obj_to_room (obj, ch->in_room);
return;
}
pexit = ch->in_room->exit[door];
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (buf, "$p bounces off the %s door.", arg1);
act (buf, ch, obj, NULL, TO_ROOM);
act (buf, ch, obj, NULL, TO_CHAR);
obj_from_char (obj);
obj_to_room (obj, ch->in_room);
return;
}
char_from_room (ch);
char_to_room (ch, to_room);
if ((victim = get_char_room (ch, arg2)) != NULL)
{
if (!global_safe (ch, victim))
{
sprintf (buf,
"$p comes flying in from the %s and lands in $N's hands.",
revdoor);
act (buf, ch, obj, victim, TO_NOTVICT);
sprintf (buf,
"$p comes flying in from the %s and lands in your hands.",
revdoor);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, obj, victim, TO_VICT);
obj_from_char (obj);
obj_to_char (obj, victim);
char_from_room (ch);
char_to_room (ch, location);
return;
}
}
/* Second room */
if ((pexit = ch->in_room->exit[door]) == NULL
|| (to_room = pexit->to_room) == NULL)
{
sprintf (buf, "$p comes flying in from the %s and strikes %s wall.",
revdoor, arg1);
act (buf, ch, obj, NULL, TO_ROOM);
obj_from_char (obj);
obj_to_room (obj, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
pexit = ch->in_room->exit[door];
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (buf, "$p comes flying in from the %s and strikes the %s door.",
revdoor, arg1);
act (buf, ch, obj, NULL, TO_ROOM);
obj_from_char (obj);
obj_to_room (obj, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
sprintf (buf, "$p comes flying in from the %s and carries on %s.", revdoor,
arg1);
act (buf, ch, obj, NULL, TO_ROOM);
char_from_room (ch);
char_to_room (ch, to_room);
if ((victim = get_char_room (ch, arg2)) != NULL)
{
if (!global_safe (ch, victim))
{
sprintf (buf,
"$p comes flying in from the %s and lands in $N's hands.",
revdoor);
act (buf, ch, obj, victim, TO_NOTVICT);
sprintf (buf,
"$p comes flying in from the %s and lands in your hands.",
revdoor);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, obj, victim, TO_VICT);
obj_from_char (obj);
obj_to_char (obj, victim);
char_from_room (ch);
char_to_room (ch, location);
return;
}
}
/* Third room */
if ((pexit = ch->in_room->exit[door]) == NULL
|| (to_room = pexit->to_room) == NULL)
{
sprintf (buf, "$p comes flying in from the %s and strikes %s wall.",
revdoor, arg1);
act (buf, ch, obj, NULL, TO_ROOM);
obj_from_char (obj);
obj_to_room (obj, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
pexit = ch->in_room->exit[door];
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (buf, "$p comes flying in from the %s and strikes the %s door.",
revdoor, arg1);
act (buf, ch, obj, NULL, TO_ROOM);
obj_from_char (obj);
obj_to_room (obj, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
sprintf (buf, "$p comes flying in from the %s and carries on %s.", revdoor,
arg1);
act (buf, ch, obj, NULL, TO_ROOM);
char_from_room (ch);
char_to_room (ch, to_room);
if ((victim = get_char_room (ch, arg2)) != NULL)
{
if (!global_safe (ch, victim))
{
sprintf (buf,
"$p comes flying in from the %s and lands in $N's hands.",
revdoor);
act (buf, ch, obj, victim, TO_NOTVICT);
sprintf (buf,
"$p comes flying in from the %s and lands in your hands.",
revdoor);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, obj, victim, TO_VICT);
obj_from_char (obj);
obj_to_char (obj, victim);
char_from_room (ch);
char_to_room (ch, location);
return;
}
}
sprintf (buf, "$p comes flying in from the %s and drops at your feet.",
revdoor);
act (buf, ch, obj, NULL, TO_ROOM);
obj_from_char (obj);
obj_to_room (obj, ch->in_room);
/* Move them back */
char_from_room (ch);
char_to_room (ch, location);
do_autosave (ch, "");
if (victim != NULL && !IS_NPC (victim))
do_autosave (victim, "");
return;
}
void
do_shoot (CHAR_DATA * ch, char *argument)
{
ROOM_INDEX_DATA *location;
ROOM_INDEX_DATA *to_room;
EXIT_DATA *pexit;
CHAR_DATA *victim;
OBJ_DATA *obj;
OBJ_DATA *ammo;
char arg1[MIL];
char arg2[MIL];
char buf[MIL];
char revdoor[MIL];
int door;
bool missed;
int dam;
argument = one_argument (argument, arg1);
argument = one_argument (argument, arg2);
if ((obj = get_eq_char (ch, WEAR_WIELD)) == NULL
|| obj->item_type != ITEM_MISSILE)
{
if ((obj = get_eq_char (ch, WEAR_HOLD)) == NULL
|| obj->item_type != ITEM_MISSILE)
{
send_to_char ("You are not holding anything to shoot.\n\r", ch);
return;
}
}
if (obj->value[1] < 1)
{
send_to_char ("First you need to load it.\n\r", ch);
return;
}
if (arg1[0] == '\0')
{
send_to_char ("Please specify a direction to shoot.\n\r", ch);
return;
}
if (arg2[0] == '\0')
{
send_to_char ("Please specify a target to shoot at.\n\r", ch);
return;
}
if (!str_cmp (arg1, "n") || !str_cmp (arg1, "north"))
{
door = 0;
sprintf (arg1, "north");
}
else if (!str_cmp (arg1, "e") || !str_cmp (arg1, "east"))
{
door = 1;
sprintf (arg1, "east");
}
else if (!str_cmp (arg1, "s") || !str_cmp (arg1, "south"))
{
door = 2;
sprintf (arg1, "south");
}
else if (!str_cmp (arg1, "w") || !str_cmp (arg1, "west"))
{
door = 3;
sprintf (arg1, "west");
}
else if (!str_cmp (arg1, "u") || !str_cmp (arg1, "up"))
{
door = 4;
sprintf (arg1, "up");
}
else if (!str_cmp (arg1, "d") || !str_cmp (arg1, "down"))
{
door = 5;
sprintf (arg1, "down");
}
else
{
send_to_char
("You can only shoot north, south, east, west, up or down.\n\r", ch);
return;
}
if (!str_cmp (arg1, "north"))
{
door = 0;
sprintf (revdoor, "south");
}
else if (!str_cmp (arg1, "east"))
{
door = 1;
sprintf (revdoor, "west");
}
else if (!str_cmp (arg1, "south"))
{
door = 2;
sprintf (revdoor, "north");
}
else if (!str_cmp (arg1, "west"))
{
door = 3;
sprintf (revdoor, "east");
}
else if (!str_cmp (arg1, "up"))
{
door = 4;
sprintf (revdoor, "down");
}
else if (!str_cmp (arg1, "down"))
{
door = 5;
sprintf (revdoor, "up");
}
else
return;
if (get_obj_index (obj->value[0]) == NULL)
return;
location = ch->in_room;
ammo = create_object (get_obj_index (obj->value[0]), 0);
if (number_percent () <= ammo->value[0])
missed = FALSE;
else
missed = TRUE;
missed = FALSE;
obj->value[1] -= 1;
ammo->timer = 10;
sprintf (buf, "You point $p %s and shoot.", arg1);
act (buf, ch, obj, NULL, TO_CHAR);
sprintf (buf, "$n points $p %s and shoots.", arg1);
act (buf, ch, obj, NULL, TO_ROOM);
/* First room */
if ((pexit = ch->in_room->exit[door]) == NULL
|| (to_room = pexit->to_room) == NULL)
{
sprintf (buf, "$p bounces off the %s wall.", arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
act (buf, ch, ammo, NULL, TO_CHAR);
obj_to_room (ammo, ch->in_room);
return;
}
pexit = ch->in_room->exit[door];
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (buf, "$p bounces off the %s door.", arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
act (buf, ch, ammo, NULL, TO_CHAR);
obj_to_room (ammo, ch->in_room);
return;
}
char_from_room (ch);
char_to_room (ch, to_room);
dam = number_range (ammo->value[1], ammo->value[2]);
if ((victim = get_char_room (ch, arg2)) != NULL)
{
if (global_safe (ch, victim))
{
missed = TRUE;
}
if (missed)
{
sprintf (buf,
"$p flies in from the %s, just missing $N, and carrying on %s.",
revdoor, arg1);
act (buf, ch, ammo, victim, TO_NOTVICT);
sprintf (buf,
"$p flies in from the %s, just missing you, and carrying on %s.",
revdoor, arg1);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, ammo, victim, TO_VICT);
}
else
{
sprintf (buf, "$p comes flying in from the %s and strikes $N.",
revdoor);
act (buf, ch, ammo, victim, TO_NOTVICT);
sprintf (buf,
"$p comes flying in from the %s and strikes you. #r[#R%d#r]#n",
revdoor, dam);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, ammo, victim, TO_VICT);
obj_to_char (ammo, victim);
char_from_room (ch);
char_to_room (ch, location);
victim->hit -= dam;
update_pos (victim);
if (victim->position == POS_DEAD && !IS_HERO (victim))
{
send_to_char ("You have been KILLED!!\n\r", victim);
victim->form = 19;
raw_kill (victim, ch);
}
return;
}
}
/* Second room */
if ((pexit = ch->in_room->exit[door]) == NULL
|| (to_room = pexit->to_room) == NULL)
{
sprintf (buf, "$p comes flying in from the %s and strikes %s wall.",
revdoor, arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
obj_to_room (ammo, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
pexit = ch->in_room->exit[door];
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (buf, "$p comes flying in from the %s and strikes the %s door.",
revdoor, arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
obj_to_room (ammo, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
if (!missed)
{
sprintf (buf, "$p comes flying in from the %s and carries on %s.",
revdoor, arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
}
char_from_room (ch);
char_to_room (ch, to_room);
if ((victim = get_char_room (ch, arg2)) != NULL)
{
if (global_safe (ch, victim))
{
missed = TRUE;
}
if (missed)
{
sprintf (buf,
"$p flies in from the %s, just missing $N, and carrying on %s.",
revdoor, arg1);
act (buf, ch, ammo, victim, TO_NOTVICT);
sprintf (buf,
"$p flies in from the %s, just missing you, and carrying on %s.",
revdoor, arg1);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, ammo, victim, TO_VICT);
}
else
{
sprintf (buf, "$p comes flying in from the %s and strikes $N.",
revdoor);
act (buf, ch, ammo, victim, TO_NOTVICT);
sprintf (buf, "$p comes flying in from the %s and strikes you.",
revdoor);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, ammo, victim, TO_VICT);
obj_to_char (ammo, victim);
char_from_room (ch);
char_to_room (ch, location);
victim->hit -= number_range (ammo->value[1], ammo->value[2]);
update_pos (victim);
if (victim->position == POS_DEAD && !IS_HERO (victim))
{
send_to_char ("You have been KILLED!!\n\r", victim);
victim->form = 19;
raw_kill (victim, ch);
}
return;
}
}
/* Third room */
if ((pexit = ch->in_room->exit[door]) == NULL
|| (to_room = pexit->to_room) == NULL)
{
sprintf (buf, "$p comes flying in from the %s and strikes %s wall.",
revdoor, arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
obj_to_room (ammo, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
pexit = ch->in_room->exit[door];
if (IS_SET (pexit->exit_info, EX_CLOSED))
{
sprintf (buf, "$p comes flying in from the %s and strikes the %s door.",
revdoor, arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
obj_to_room (ammo, ch->in_room);
char_from_room (ch);
char_to_room (ch, location);
return;
}
if (!missed)
{
sprintf (buf, "$p comes flying in from the %s and carries on %s.",
revdoor, arg1);
act (buf, ch, ammo, NULL, TO_ROOM);
}
char_from_room (ch);
char_to_room (ch, to_room);
if ((victim = get_char_room (ch, arg2)) != NULL)
{
if (global_safe (ch, victim))
{
missed = TRUE;
}
if (missed)
{
sprintf (buf,
"$p flies in from the %s, just missing $N, and carrying on %s.",
revdoor, arg1);
act (buf, ch, ammo, victim, TO_NOTVICT);
sprintf (buf,
"$p flies in from the %s, just missing you, and carrying on %s.",
revdoor, arg1);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, ammo, victim, TO_VICT);
}
else
{
sprintf (buf, "$p comes flying in from the %s and strikes $N.",
revdoor);
act (buf, ch, ammo, victim, TO_NOTVICT);
sprintf (buf, "$p comes flying in from the %s and strikes you.",
revdoor);
if (victim != NULL && !IS_NPC (victim))
act (buf, ch, ammo, victim, TO_VICT);
obj_to_char (ammo, victim);
char_from_room (ch);
char_to_room (ch, location);
victim->hit -= number_range (ammo->value[1], ammo->value[2]);
update_pos (victim);
if (victim->position == POS_DEAD && !IS_HERO (victim))
{
send_to_char ("You have been KILLED!!\n\r", victim);
victim->form = 19;
raw_kill (victim, ch);
}
return;
}
}
sprintf (buf, "$p comes flying in from the %s and drops at your feet.",
revdoor);
act (buf, ch, ammo, NULL, TO_ROOM);
obj_to_room (ammo, ch->in_room);
/* Move them back */
char_from_room (ch);
char_to_room (ch, location);
return;
}
void
do_reload (CHAR_DATA * ch, char *argument)
{
OBJ_DATA *obj;
OBJ_DATA *obj2;
OBJ_DATA *ammo;
OBJ_DATA *missile;
obj = get_eq_char (ch, WEAR_WIELD);
obj2 = get_eq_char (ch, WEAR_HOLD);
if (obj == NULL || obj2 == NULL)
{
send_to_char
("You must hold the weapon to reload in one hand and the ammo in the other.\n\r",
ch);
return;
}
if (!(obj->item_type == ITEM_MISSILE && obj2->item_type == ITEM_AMMO)
&& !(obj2->item_type == ITEM_MISSILE && obj->item_type == ITEM_AMMO))
{
send_to_char
("You must hold the weapon to reload in one hand and the ammo in the other.\n\r",
ch);
return;
}
if (obj->item_type == ITEM_MISSILE)
{
missile = obj;
ammo = obj2;
}
else
{
missile = obj2;
ammo = obj;
}
if (missile->value[1] >= missile->value[2])
{
send_to_char ("It is already fully loaded.\n\r", ch);
return;
}
if (missile->value[3] != ammo->value[3])
{
send_to_char ("That weapon doesn't take that sort of ammo.\n\r", ch);
return;
}
if (missile->value[0] != 0 && missile->value[1] != 0 &&
missile->value[0] != ammo->pIndexData->vnum)
{
send_to_char ("You cannot mix ammo types.\n\r", ch);
return;
}
act ("You load $p into $P.", ch, ammo, missile, TO_CHAR);
act ("$n loads $p into $P.", ch, ammo, missile, TO_ROOM);
missile->value[1] += 1;
missile->value[0] = ammo->pIndexData->vnum;
obj_from_char (ammo);
extract_obj (ammo);
return;
}
void
do_unload (CHAR_DATA * ch, char *argument)
{
OBJ_DATA *missile;
OBJ_DATA *ammo;
if ((missile = get_eq_char (ch, WEAR_WIELD)) == NULL
|| missile->item_type != ITEM_MISSILE)
{
if ((missile = get_eq_char (ch, WEAR_HOLD)) == NULL
|| missile->item_type != ITEM_MISSILE)
{
send_to_char ("You are not holding anything to unload.\n\r", ch);
return;
}
}
if (missile->value[1] <= 0)
{
send_to_char ("But it is already empty!\n\r", ch);
return;
}
if (get_obj_index (missile->value[0]) == NULL)
return;
ammo = create_object (get_obj_index (missile->value[0]), 0);
act ("You remove $p from $P.", ch, ammo, missile, TO_CHAR);
act ("$n removes $p from $P.", ch, ammo, missile, TO_ROOM);
missile->value[1] -= 1;
obj_to_char (ammo, ch);
return;
}
void
do_fightstyle (CHAR_DATA * ch, char *argument)
{
char arg1[MIL];
char arg2[MIL];
char buf[MIL];
int selection;
int value;
argument = one_argument (argument, arg1);
argument = one_argument (argument, arg2);
if (IS_NPC (ch))
return;
if (!IS_MONK (ch))
{
do_huh (ch, "");
return;
}
if (arg1[0] == '\0' || arg2[0] == '\0')
{
send_to_char ("Syntax is: fightstyle <number> <style>.\n\r", ch);
send_to_char
("Style can be selected from the following (enter style in text form):\n\r",
ch);
send_to_char
("[ 1] Trip [ 2] Kick [ 3] Bash [ 4] Elbow [ 5] Knee\n\r",
ch);
send_to_char
("[ 6] Headbutt [ 7] Disarm [ 8] Bite [ 9] Dirt [10] Grapple\n\r",
ch);
send_to_char
("[11] Punch [12] Gouge [13] Rip [14] Stamp [15] Backfist\n\r",
ch);
send_to_char
("[16] Jumpkick [17] Spinkick [18] Hurl [19] Sweep [20] Charge\n\r",
ch);
sprintf (buf,
"Selected options: 1:[%d] 2:[%d] 3:[%d] 4:[%d] 5:[%d] 6:[%d] 7:[%d] 8:[%d].\n\r",
ch->cmbt[0], ch->cmbt[1], ch->cmbt[2], ch->cmbt[3],
ch->cmbt[4], ch->cmbt[5], ch->cmbt[6], ch->cmbt[7]);
send_to_char (buf, ch);
return;
}
value = is_number (arg1) ? atoi (arg1) : -1;
if (value < 1 || value > 8)
{
send_to_char ("Please enter a value between 1 and 8.\n\r", ch);
return;
}
if (!str_cmp (arg2, "clear"))
selection = 0;
else if (!str_cmp (arg2, "trip"))
{
if (!IS_FS (ch, FS_TRIP))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 1;
}
else if (!str_cmp (arg2, "kick"))
{
if (!IS_FS (ch, FS_KICK))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 2;
}
else if (!str_cmp (arg2, "bash"))
{
if (!IS_FS (ch, FS_BASH))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 3;
}
else if (!str_cmp (arg2, "elbow"))
{
if (!IS_FS (ch, FS_ELBOW))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 4;
}
else if (!str_cmp (arg2, "knee"))
{
if (!IS_FS (ch, FS_KNEE))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 5;
}
else if (!str_cmp (arg2, "headbutt"))
{
if (!IS_FS (ch, FS_HEADBUTT))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 6;
}
else if (!str_cmp (arg2, "disarm"))
{
if (!IS_FS (ch, FS_DISARM))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 7;
}
else if (!str_cmp (arg2, "bite"))
{
if (!IS_FS (ch, FS_BITE))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 8;
}
else if (!str_cmp (arg2, "dirt"))
{
if (!IS_FS (ch, FS_DIRT))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 9;
}
else if (!str_cmp (arg2, "grapple"))
{
if (!IS_FS (ch, FS_GRAPPLE))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 10;
}
else if (!str_cmp (arg2, "punch"))
{
if (!IS_FS (ch, FS_PUNCH))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 11;
}
else if (!str_cmp (arg2, "gouge"))
{
if (!IS_FS (ch, FS_GOUGE))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 12;
}
else if (!str_cmp (arg2, "rip"))
{
if (!IS_FS (ch, FS_RIP))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 13;
}
else if (!str_cmp (arg2, "stamp"))
{
if (!IS_FS (ch, FS_STAMP))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 14;
}
else if (!str_cmp (arg2, "backfist"))
{
if (!IS_FS (ch, FS_BACKFIST))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 15;
}
else if (!str_cmp (arg2, "jumpkick"))
{
if (!IS_FS (ch, FS_JUMPKICK))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 16;
}
else if (!str_cmp (arg2, "spinkick"))
{
if (!IS_FS (ch, FS_SPINKICK))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 17;
}
else if (!str_cmp (arg2, "hurl"))
{
if (!IS_FS (ch, FS_HURL))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 18;
}
else if (!str_cmp (arg2, "sweep"))
{
if (!IS_FS (ch, FS_SWEEP))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 19;
}
else if (!str_cmp (arg2, "charge"))
{
if (!IS_FS (ch, FS_CHARGE))
{
stc ("You dont know that fight move.\n\r", ch);
return;
}
selection = 20;
}
else
{
send_to_char ("Syntax is: fightstyle <number> <style>.\n\r", ch);
send_to_char
("Style can be selected from the following (enter style in text form):\n\r",
ch);
send_to_char
("[ 1] Trip [ 2] Kick [ 3] Bash [ 4] Elbow [ 5] Knee\n\r",
ch);
send_to_char
("[ 6] Headbutt [ 7] Disarm [ 8] Bite [ 9] Dirt [10] Grapple\n\r",
ch);
send_to_char
("[11] Punch [12] Gouge [13] Rip [14] Stamp [15] Backfist\n\r",
ch);
send_to_char
("[16] Jumpkick [17] Spinkick [18] Hurl [19] Sweep [20] Charge\n\r",
ch);
sprintf (buf,
"Selected options: 1:[%d] 2:[%d] 3:[%d] 4:[%d] 5:[%d] 6:[%d] 7:[%d] 8:[%d].\n\r",
ch->cmbt[0], ch->cmbt[1], ch->cmbt[2], ch->cmbt[3],
ch->cmbt[4], ch->cmbt[5], ch->cmbt[6], ch->cmbt[7]);
send_to_char (buf, ch);
return;
}
if ((value - 1) == 0 && selection != 0)
{
if (selection == ch->cmbt[1] || selection == ch->cmbt[2]
|| selection == ch->cmbt[3] || selection == ch->cmbt[4]
|| selection == ch->cmbt[5] || selection == ch->cmbt[6]
|| selection == ch->cmbt[7])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
else if ((value - 1) == 1 && selection != 0)
{
if (selection == ch->cmbt[0] || selection == ch->cmbt[2]
|| selection == ch->cmbt[3] || selection == ch->cmbt[4]
|| selection == ch->cmbt[5] || selection == ch->cmbt[6]
|| selection == ch->cmbt[7])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
else if ((value - 1) == 2 && selection != 0)
{
if (selection == ch->cmbt[1] || selection == ch->cmbt[0]
|| selection == ch->cmbt[3] || selection == ch->cmbt[4]
|| selection == ch->cmbt[5] || selection == ch->cmbt[6]
|| selection == ch->cmbt[7])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
else if ((value - 1) == 3 && selection != 0)
{
if (selection == ch->cmbt[1] || selection == ch->cmbt[2]
|| selection == ch->cmbt[0] || selection == ch->cmbt[4]
|| selection == ch->cmbt[5] || selection == ch->cmbt[6]
|| selection == ch->cmbt[7])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
else if ((value - 1) == 4 && selection != 0)
{
if (selection == ch->cmbt[1] || selection == ch->cmbt[2]
|| selection == ch->cmbt[3] || selection == ch->cmbt[0]
|| selection == ch->cmbt[5] || selection == ch->cmbt[6]
|| selection == ch->cmbt[7])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
else if ((value - 1) == 5 && selection != 0)
{
if (selection == ch->cmbt[1] || selection == ch->cmbt[2]
|| selection == ch->cmbt[3] || selection == ch->cmbt[4]
|| selection == ch->cmbt[0] || selection == ch->cmbt[6]
|| selection == ch->cmbt[7])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
else if ((value - 1) == 6 && selection != 0)
{
if (selection == ch->cmbt[1] || selection == ch->cmbt[2]
|| selection == ch->cmbt[3] || selection == ch->cmbt[4]
|| selection == ch->cmbt[5] || selection == ch->cmbt[0]
|| selection == ch->cmbt[7])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
else if ((value - 1) == 7 && selection != 0)
{
if (selection == ch->cmbt[1] || selection == ch->cmbt[2]
|| selection == ch->cmbt[3] || selection == ch->cmbt[4]
|| selection == ch->cmbt[5] || selection == ch->cmbt[6]
|| selection == ch->cmbt[0])
{
stc ("You already have that move in your fightstyle.\n\r", ch);
return;
}
}
if (ch->fighting != NULL)
waiting (ch, 8);
ch->cmbt[(value - 1)] = selection;
sprintf (buf, "Combat option %d now set to %s (%d).\n\r", value, arg2,
selection);
send_to_char (buf, ch);
return;
}
void
fightaction (CHAR_DATA * ch, CHAR_DATA * victim, int actype, int dtype,
int wpntype)
{
AFFECT_DATA af;
char buf[MIL];
OBJ_DATA *obj;
bool broke = FALSE;
if (IS_NPC (ch))
return;
if (actype < 1 || actype > 20)
return;
if (victim == NULL)
return;
/* Trip */
if (actype == 1)
{
if (number_percent () <= ch->wpn[0])
trip (ch, victim);
return;
}
else if (actype == 2)
{
do_mkick (ch, "");
return;
}
else if (actype == 3)
{
act ("You slam into $N, sending $M sprawling.", ch, NULL, victim,
TO_CHAR);
if (victim != NULL && !IS_NPC (victim))
act ("$n slams into you, sending you sprawling.", ch, NULL, victim,
TO_VICT);
act ("$n slams into $N, sending $M sprawling.", ch, NULL, victim,
TO_NOTVICT);
waiting (victim, 4);
return;
}
else if (actype == 4)
{
act ("You spin around and ram your elbow into $N's forehead.", ch, NULL,
victim, TO_CHAR);
if (victim != NULL && !IS_NPC (victim))
act ("$n spins around and rams his elbow into your forehead.", ch,
NULL, victim, TO_VICT);
act ("$n spins around and rams $s elbow into $N's face.", ch, NULL,
victim, TO_NOTVICT);
one_hit (ch, victim, gsn_elbow, wpntype, 0, FALSE);
return;
}
else if (actype == 5)
{
act ("You slam your knee into $N's stomach.", ch, NULL, victim,
TO_CHAR);
if (victim != NULL && !IS_NPC (victim))
act ("$n slams $s knee into your stomach.", ch, NULL, victim,
TO_VICT);
act ("$n slams $s knee into $N's stomach.", ch, NULL, victim,
TO_NOTVICT);
one_hit (ch, victim, gsn_knee, wpntype, 0, FALSE);
return;
}
else if (actype == 6)
{
one_hit (ch, victim, gsn_headbutt, wpntype, 0, FALSE);
return;
}
else if (actype == 7)
{
disarm (ch, victim);
return;
}
else if (actype == 8)
{
one_hit (ch, victim, (TYPE_HIT + 10), wpntype, 0, FALSE);
return;
}
else if (actype == 9)
{
act ("You kick a spray of dirt into $N's face.", ch, NULL, victim,
TO_CHAR);
if (victim != NULL && !IS_NPC (victim))
act ("$n kicks a spray of dirt into your face.", ch, NULL, victim,
TO_VICT);
act ("$n kicks a spray of dirt into $N's face.", ch, NULL, victim,
TO_NOTVICT);
if (IS_AFFECTED (victim, AFF_BLIND) || number_percent () < 25)
return;
af.type = 4;
af.location = APPLY_HITROLL;
af.modifier = -4;
af.duration = 1;
af.bitvector = AFF_BLIND;
affect_to_char (victim, &af);
act ("$n is blinded!", victim, NULL, NULL, TO_ROOM);
send_to_char ("You are blinded!\n\r", victim);
return;
}
else if (actype == 10)
{
act ("You grapple $N and forces $M to the ground.", ch, NULL, victim,
TO_CHAR);
if (victim != NULL && !IS_NPC (victim))
act ("$n grapple's you forcing you to the ground.", ch, NULL, victim,
TO_VICT);
act ("$n grapple's $N and forces $M to the ground.", ch, NULL, victim,
TO_NOTVICT);
waiting (victim, 4);
return;
}
else if (actype == 11)
{
act ("You punch $N in the face.", ch, NULL, victim, TO_CHAR);
if (victim != NULL && !IS_NPC (victim))
act ("$n punches you in the face.", ch, NULL, victim, TO_VICT);
act ("$n punches $N in the face.", ch, NULL, victim, TO_NOTVICT);
if (IS_NPC (victim) && victim->pIndexData->vnum == 3011)
{
if (number_percent () <= 25 && !IS_ARM_L (ch, LOST_ARM) &&
!IS_ARM_L (ch, LOST_HAND))
{
if (!IS_ARM_L (ch, LOST_FINGER_I)
&& !IS_ARM_L (ch, BROKEN_FINGER_I))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_I);
broke = TRUE;
}
if (!IS_ARM_L (ch, LOST_FINGER_M)
&& !IS_ARM_L (ch, BROKEN_FINGER_M))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_M);
broke = TRUE;
}
if (!IS_ARM_L (ch, LOST_FINGER_R)
&& !IS_ARM_L (ch, BROKEN_FINGER_R))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_R);
broke = TRUE;
}
if (!IS_ARM_L (ch, LOST_FINGER_L)
&& !IS_ARM_L (ch, BROKEN_FINGER_L))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_L);
broke = TRUE;
}
if (broke)
{
act
("The fingers on your left hand shatter under the impact of the blow!",
ch, NULL, NULL, TO_CHAR);
act
("The fingers on $n's left hand shatter under the impact of the blow! ",
ch, NULL, NULL, TO_ROOM);
}
}
else if (number_percent () <= 25 && !IS_ARM_R (ch, LOST_ARM)
&& !IS_ARM_R (ch, LOST_HAND))
{
if (!IS_ARM_R (ch, LOST_FINGER_I)
&& !IS_ARM_R (ch, BROKEN_FINGER_I))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_I);
broke = TRUE;
}
if (!IS_ARM_R (ch, LOST_FINGER_M)
&& !IS_ARM_R (ch, BROKEN_FINGER_M))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_M);
broke = TRUE;
}
if (!IS_ARM_R (ch, LOST_FINGER_R)
&& !IS_ARM_R (ch, BROKEN_FINGER_R))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_R);
broke = TRUE;
}
if (!IS_ARM_R (ch, LOST_FINGER_L)
&& !IS_ARM_R (ch, BROKEN_FINGER_L))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_L);
broke = TRUE;
}
if (broke)
{
act
("The fingers on your right hand shatter under the impact of the blow!",
ch, NULL, NULL, TO_CHAR);
act
("The fingers on $n's right hand shatter under the impact of the blow! ",
ch, NULL, NULL, TO_ROOM);
}
}
return;
}
else if (!IS_NPC (victim)
&&
((IS_WEREWOLF (victim)
&& get_tribe (victim, TRIBE_GET_OF_FENRIS) > 3)
|| (IS_VAMPIRE (victim)
&& get_disc (victim, DISC_FORTITUDE) >= 5)))
{
if (number_percent () < 51 && !IS_ARM_L (ch, LOST_ARM) &&
!IS_ARM_L (ch, LOST_HAND))
{
if (!IS_ARM_L (ch, LOST_FINGER_I)
&& !IS_ARM_L (ch, BROKEN_FINGER_I))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_I);
broke = TRUE;
}
if (!IS_ARM_L (ch, LOST_FINGER_M)
&& !IS_ARM_L (ch, BROKEN_FINGER_M))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_M);
broke = TRUE;
}
if (!IS_ARM_L (ch, LOST_FINGER_R)
&& !IS_ARM_L (ch, BROKEN_FINGER_R))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_R);
broke = TRUE;
}
if (!IS_ARM_L (ch, LOST_FINGER_L)
&& !IS_ARM_L (ch, BROKEN_FINGER_L))
{
SET_BIT (ch->loc_hp[LOC_ARM_L], BROKEN_FINGER_L);
broke = TRUE;
}
if (broke)
{
act
("The fingers on your left hand shatter under the impact of the blow!",
ch, NULL, NULL, TO_CHAR);
act
("The fingers on $n's left hand shatter under the impact of the blow! ",
ch, NULL, NULL, TO_ROOM);
}
}
else if (number_percent () <= 25 && !IS_ARM_R (ch, LOST_ARM) &&
!IS_ARM_R (ch, LOST_HAND))
{
if (!IS_ARM_R (ch, LOST_FINGER_I)
&& !IS_ARM_R (ch, BROKEN_FINGER_I))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_I);
broke = TRUE;
}
if (!IS_ARM_R (ch, LOST_FINGER_M)
&& !IS_ARM_R (ch, BROKEN_FINGER_M))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_M);
broke = TRUE;
}
if (!IS_ARM_R (ch, LOST_FINGER_R)
&& !IS_ARM_R (ch, BROKEN_FINGER_R))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_R);
broke = TRUE;
}
if (!IS_ARM_R (ch, LOST_FINGER_L)
&& !IS_ARM_R (ch, BROKEN_FINGER_L))
{
SET_BIT (ch->loc_hp[LOC_ARM_R], BROKEN_FINGER_L);
broke = TRUE;
}
if (broke)
{
act
("The fingers on your right hand shatter under the impact of the blow!",
ch, NULL, NULL, TO_CHAR);
act
("The fingers on $n's right hand shatter under the impact of the blow! ",
ch, NULL, NULL, TO_ROOM);
}
}
return;
}
else if (!IS_NPC (victim)
&& victim->pcdata->npowers[NPOWER_BUSHIDO] > 1)
{
act ("$N easily dodges your punch.", ch, NULL, victim, TO_CHAR);
act ("You easily dodge $n's punch.", ch, NULL, victim, TO_VICT);
act ("$N easily dodges $n's punch.", ch, NULL, victim, TO_NOTVICT);
if (number_percent () <= 50 && !IS_ARM_L (ch, LOST_ARM)
&& !limbsafe (victim, ch))
{
if (!IS_ARM_L (ch, BROKEN_ARM))
{
SET_BIT (ch->loc_hp[2], BROKEN_ARM);
broke = TRUE;
}
if (broke)
{
act
("$N grabs your left wrist and with a palm strike to your elbow, snaps your arm like a twig!",
ch, NULL, victim, TO_CHAR);
act
("$N grabs $n's left wrist and with a palm strike to $s elbow, snaps $s arm like a twig!",
ch, NULL, victim, TO_NOTVICT);
act
("You grab $n's left wrist and with a palm strike to $s elbow, snap $s arm like a twig!",
ch, NULL, victim, TO_VICT);
if ((obj = get_eq_char (ch, WEAR_HOLD)) != NULL)
take_item (ch, obj);
}
}
else if (!IS_ARM_R (ch, LOST_ARM) && !limbsafe (victim, ch))
{
if (!IS_ARM_R (ch, BROKEN_ARM))
{
SET_BIT (ch->loc_hp[3], BROKEN_ARM);
broke = TRUE;
}
if (broke)
{
act
("$N grabs your right wrist and with a palm strike to your elbow, snaps your arm like a twig!",
ch, NULL, victim, TO_CHAR);
act
("$N grabs $n's right wrist and with a palm strike to $s elbow, snaps $s arm like a twig!",
ch, NULL, victim, TO_NOTVICT);
act
("You grab $n's right wrist and with a palm strike to $s elbow, snap $s arm like a twig!",
ch, NULL, victim, TO_VICT);
if ((obj = get_eq_char (ch, WEAR_WIELD)) != NULL)
take_item (ch, obj);
}
}
return;
}
else
{
one_hit (ch, victim, gsn_punch, wpntype, 0, FALSE);
stop_fighting (ch, TRUE);
victim->position = POS_STUNNED;
return;
}
}
else if (actype == 12)
{
act ("You gouge your fingers into $N's eyes.", ch, NULL, victim,
TO_CHAR);
if (victim != NULL && !IS_NPC (victim))
act ("$n gouges $s fingers into your eyes.", ch, NULL, victim,
TO_VICT);
act ("$n gouges $s fingers into $N's eyes.", ch, NULL, victim,
TO_NOTVICT);
if (IS_AFFECTED (victim, AFF_BLIND) || number_percent () < 75)
{
one_hit (ch, victim, dtype, wpntype, 0, FALSE);
return;
}
af.type = 4;
af.location = APPLY_HITROLL;
af.modifier = -4;
af.duration = 1;
af.bitvector = AFF_BLIND;
affect_to_char (victim, &af);
act ("$n is blinded!", victim, NULL, NULL, TO_ROOM);
send_to_char ("You are blinded!\n\r", victim);
return;
}
else if (actype == 13)
{
int critical = number_range (1, 4);
if (limbsafe (ch, victim))
return;
if (critical == 1)
{
if (IS_ARM_L (victim, LOST_ARM))
return;
SET_BIT (victim->loc_hp[2], LOST_ARM);
SET_BIT (victim->loc_hp[6], BLEEDING_ARM_L);
if (IS_BLEEDING (victim, BLEEDING_HAND_L))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_HAND_L);
act
("You dodge $N's attack, grab $S arm and rip it from it's socket.",
ch, NULL, victim, TO_CHAR);
if (!IS_NPC (victim) && victim != NULL)
act
("$n dodges your attack, grabs your arm and rips it from its socket.",
ch, NULL, victim, TO_VICT);
act
("$n dodges $N's attack, grabs $N's arm and rips it from its socket.",
ch, NULL, victim, TO_NOTVICT);
make_part (victim, "arm");
if (IS_ARM_L (victim, LOST_ARM) && IS_ARM_R (victim, LOST_ARM))
{
if ((obj = get_eq_char (victim, WEAR_ARMS)) != NULL)
take_item (victim, obj);
}
if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_HANDS)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_WRIST_L)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_FINGER_L)) != NULL)
take_item (victim, obj);
return;
}
else if (critical == 2)
{
if (IS_ARM_R (victim, LOST_ARM))
return;
SET_BIT (victim->loc_hp[3], LOST_ARM);
SET_BIT (victim->loc_hp[6], BLEEDING_ARM_R);
if (IS_BLEEDING (victim, BLEEDING_HAND_R))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_HAND_R);
act
("You dodge $N's attack, grab $S arm and rip it from it's socket.",
ch, NULL, victim, TO_CHAR);
if (!IS_NPC (victim) && victim != NULL)
act
("$n dodges your attack, grabs your arm and rips it from its socket.",
ch, NULL, victim, TO_VICT);
act
("$n dodges $N's attack, grabs $N's arm and rips it from its socket.",
ch, NULL, victim, TO_NOTVICT);
make_part (victim, "arm");
if (IS_ARM_L (victim, LOST_ARM) && IS_ARM_R (victim, LOST_ARM))
{
if ((obj = get_eq_char (victim, WEAR_ARMS)) != NULL)
take_item (victim, obj);
}
if ((obj = get_eq_char (victim, WEAR_WIELD)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_HANDS)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_WRIST_R)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_FINGER_R)) != NULL)
take_item (victim, obj);
return;
}
else if (critical == 3)
{
if (IS_LEG_L (victim, LOST_LEG))
return;
SET_BIT (victim->loc_hp[4], LOST_LEG);
SET_BIT (victim->loc_hp[6], BLEEDING_LEG_L);
if (IS_BLEEDING (victim, BLEEDING_FOOT_L))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_FOOT_L);
act
("You duck under $N's attack, grab $S leg and rip it from it's socket.",
ch, NULL, victim, TO_CHAR);
if (!IS_NPC (victim) && victim != NULL)
act
("$n duck's under your attack, grabs your leg and rips it from its socket.",
ch, NULL, victim, TO_VICT);
act
("$n duck's under $N's attack, grabs $N's leg and rips it from its socket.",
ch, NULL, victim, TO_NOTVICT);
make_part (victim, "leg");
if (IS_LEG_L (victim, LOST_LEG) && IS_LEG_R (victim, LOST_LEG))
{
if ((obj = get_eq_char (victim, WEAR_LEGS)) != NULL)
take_item (victim, obj);
}
if ((obj = get_eq_char (victim, WEAR_FEET)) != NULL)
take_item (victim, obj);
}
else if (critical == 4)
{
if (IS_LEG_R (victim, LOST_LEG))
return;
SET_BIT (victim->loc_hp[5], LOST_LEG);
SET_BIT (victim->loc_hp[6], BLEEDING_LEG_R);
if (IS_BLEEDING (victim, BLEEDING_FOOT_R))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_FOOT_R);
act
("You duck under $N's attack, grab $S leg and rip it from it's socket.",
ch, NULL, victim, TO_CHAR);
if (!IS_NPC (victim) && victim != NULL)
act
("$n duck's under your attack, grabs your leg and rips it from its socket.",
ch, NULL, victim, TO_VICT);
act
("$n duck's under $N's attack, grabs $N's leg and rips it from its socket.",
ch, NULL, victim, TO_NOTVICT);
make_part (victim, "leg");
if (IS_LEG_L (victim, LOST_LEG) && IS_LEG_R (victim, LOST_LEG))
{
if ((obj = get_eq_char (victim, WEAR_LEGS)) != NULL)
take_item (victim, obj);
}
if ((obj = get_eq_char (victim, WEAR_FEET)) != NULL)
take_item (victim, obj);
}
return;
}
else if (actype == 14)
{
if (victim->move < 1)
return;
act ("You leap in the air and stamp on $N's feet.", ch, NULL, victim,
TO_CHAR);
if (!IS_NPC (victim) && victim != NULL)
act ("$n leaps in the air and stamps on your feet.", ch, NULL, victim,
TO_VICT);
act ("$n leaps in the air and stamps on $N's feet.", ch, NULL, victim,
TO_NOTVICT);
victim->move -= number_range (250, 500);
if (victim->move < 0)
victim->move = 0;
return;
}
else if (actype == 15)
{
one_hit (ch, victim, gsn_backfist, wpntype, 0, FALSE);
return;
}
else if (actype == 16)
{
one_hit (ch, victim, gsn_jumpkick, wpntype, 0, FALSE);
return;
}
else if (actype == 17)
{
one_hit (ch, victim, gsn_spinkick, wpntype, 0, FALSE);
return;
}
else if (actype == 18)
{
char direction[MIL];
int rev_dir = 0;
int door;
int dam = 0;
ROOM_INDEX_DATA *to_room;
EXIT_DATA *pexit;
EXIT_DATA *pexit_rev;
door = number_range (0, 3);
if (!IS_NPC (victim) && IS_WEREWOLF (victim)
&& get_tribe (victim, TRIBE_GET_OF_FENRIS) > 3)
{
send_to_char ("You are unable to get their feet of the ground.\n\r",
ch);
return;
}
if (!IS_NPC (victim) && IS_NINJA (victim)
&& victim->pcdata->npowers[NPOWER_BUSHIDO] > 0)
{
send_to_char ("You are unable to get their feet of the ground.\n\r",
ch);
return;
}
if (door == 0)
{
sprintf (direction, "north");
rev_dir = 2;
}
if (door == 1)
{
sprintf (direction, "east");
rev_dir = 3;
}
if (door == 2)
{
sprintf (direction, "south");
rev_dir = 0;
}
if (door == 3)
{
sprintf (direction, "west");
rev_dir = 1;
}
if ((pexit = ch->in_room->exit[door]) == NULL
|| (to_room = pexit->to_room) == NULL)
{
sprintf (buf, "$n hurls $N into the %s wall.", direction);
act (buf, ch, NULL, victim, TO_NOTVICT);
sprintf (buf, "You hurl $N into the %s wall.", direction);
act (buf, ch, NULL, victim, TO_CHAR);
sprintf (buf, "$n hurls you into the %s wall.", direction);
if (!IS_NPC (victim) && victim != NULL)
act (buf, ch, NULL, victim, TO_VICT);
dam = number_range (ch->level, (ch->level * 4));
victim->hit = victim->hit - dam;
update_pos (victim);
if (IS_NPC (victim) && !IS_NPC (ch))
ch->mkill = ch->mkill + 1;
if (!IS_NPC (victim) && IS_NPC (ch))
victim->mdeath = victim->mdeath + 1;
if (victim->position == POS_DEAD && IS_NPC (victim)) /*Fix1 */
{
victim->form = 7;
raw_kill (victim, ch);
return;
}
return;
}
pexit = victim->in_room->exit[door];
if (IS_SET (pexit->exit_info, EX_CLOSED) &&
!IS_AFFECTED (victim, AFF_PASS_DOOR) &&
!IS_AFFECTED (victim, AFF_ETHEREAL))
{
if (IS_SET (pexit->exit_info, EX_LOCKED))
REMOVE_BIT (pexit->exit_info, EX_LOCKED);
if (IS_SET (pexit->exit_info, EX_CLOSED))
REMOVE_BIT (pexit->exit_info, EX_CLOSED);
sprintf (buf, "$n hoists $N in the air and hurls $M %s.",
direction);
act (buf, ch, NULL, victim, TO_NOTVICT);
sprintf (buf, "You hoist $N in the air and hurl $M %s.", direction);
act (buf, ch, NULL, victim, TO_CHAR);
sprintf (buf, "$n hurls you %s, smashing you through the %s.",
direction, pexit->keyword);
if (!IS_NPC (victim) && victim != NULL)
act (buf, ch, NULL, victim, TO_VICT);
sprintf (buf,
"There is a loud crash as $n smashes through the $d.");
act (buf, victim, NULL, pexit->keyword, TO_ROOM);
if ((to_room = pexit->to_room) != NULL
&& (pexit_rev = to_room->exit[rev_dir]) != NULL
&& pexit_rev->to_room == ch->in_room
&& pexit_rev->keyword != NULL)
{
if (IS_SET (pexit_rev->exit_info, EX_LOCKED))
REMOVE_BIT (pexit_rev->exit_info, EX_LOCKED);
if (IS_SET (pexit_rev->exit_info, EX_CLOSED))
REMOVE_BIT (pexit_rev->exit_info, EX_CLOSED);
if (door == 0)
sprintf (direction, "south");
if (door == 1)
sprintf (direction, "west");
if (door == 2)
sprintf (direction, "north");
if (door == 3)
sprintf (direction, "east");
char_from_room (victim);
char_to_room (victim, to_room);
sprintf (buf, "$n comes smashing in through the %s $d.",
direction);
act (buf, victim, NULL, pexit->keyword, TO_ROOM);
dam = number_range (ch->level, (ch->level * 6));
victim->hit = victim->hit - dam;
update_pos (victim);
if (IS_NPC (victim) && !IS_NPC (ch))
ch->mkill = ch->mkill + 1;
if (!IS_NPC (victim) && IS_NPC (ch))
victim->mdeath = victim->mdeath + 1;
if (victim->position == POS_DEAD && IS_NPC (victim)) /*fix1 */
{
victim->form = 7;
raw_kill (victim, ch);
return;
}
}
}
else
{
sprintf (buf, "$n hurls $N %s.", direction);
act (buf, ch, NULL, victim, TO_NOTVICT);
sprintf (buf, "You hurl $N %s.", direction);
act (buf, ch, NULL, victim, TO_CHAR);
sprintf (buf, "$n hurls you %s.", direction);
if (!IS_NPC (victim) && victim != NULL)
act (buf, ch, NULL, victim, TO_VICT);
if (door == 0)
sprintf (direction, "south");
if (door == 1)
sprintf (direction, "west");
if (door == 2)
sprintf (direction, "north");
if (door == 3)
sprintf (direction, "east");
char_from_room (victim);
char_to_room (victim, to_room);
sprintf (buf, "$n comes flying in from the %s.", direction);
act (buf, victim, NULL, NULL, TO_ROOM);
dam = number_range (ch->level, (ch->level * 2));
victim->hit = victim->hit - dam;
update_pos (victim);
if (IS_NPC (victim) && !IS_NPC (ch))
ch->mkill = ch->mkill + 1;
if (!IS_NPC (victim) && IS_NPC (ch))
victim->mdeath = victim->mdeath + 1;
if (victim->position == POS_DEAD && IS_NPC (victim)) /*fix1 */
{
victim->form = 7;
raw_kill (victim, ch);
return;
}
}
return;
}
else if (actype == 19)
{
one_hit (ch, victim, gsn_monksweep, wpntype, 0, FALSE);
return;
}
else if (actype == 20)
{
act ("You charge into $N, knocking $M from his feet.", ch, NULL, victim,
TO_CHAR);
if (!IS_NPC (victim) && victim != NULL)
act ("$n charges into you, knocking you off your feet.", ch, NULL,
victim, TO_VICT);
act ("$n charges into $N, knocking $M off $S feet.", ch, NULL, victim,
TO_NOTVICT);
waiting (victim, 4);
return;
}
else
return;
return;
}
void
critical_hit (CHAR_DATA * ch, CHAR_DATA * victim, int dt, int dam)
{
OBJ_DATA *obj;
OBJ_DATA *damaged;
char buf[MSL];
char buf2[20];
int dtype;
int critical = 0;
int wpn = 0;
int wpn2 = 0;
int count;
int count2;
int tough = 0;
bool vorpal = FALSE;
dtype = dt - 1000;
/*
if (dtype < 0 || dtype > 12) return;
if (IS_NPC(ch)) critical += (ch->level * 0.2);
if (!IS_NPC(ch)) critical += (ch->wpn[dtype] * 0.1);
if (IS_NPC(victim)) critical -= (victim->level * 0.2);
*/
if (dtype < 0 || dtype > 12)
return;
if (IS_NPC (ch))
critical += ((ch->level + 1) / 5);
if (!IS_NPC (ch))
critical += ((ch->wpn[dtype] + 1) / 10);
if (IS_NPC (victim))
critical -= ((victim->level + 1) / 5);
if (!IS_NPC (victim))
{
obj = get_eq_char (victim, WEAR_WIELD);
dtype = TYPE_HIT;
if (obj != NULL && obj->item_type == ITEM_WEAPON)
dtype += obj->value[3];
wpn = dtype - 1000;
if (wpn < 0 || wpn > 12)
wpn = 0;
obj = get_eq_char (victim, WEAR_HOLD);
dtype = TYPE_HIT;
if (obj != NULL && obj->item_type == ITEM_WEAPON)
dtype += obj->value[3];
wpn2 = dtype - 1000;
if (wpn2 < 0 || wpn2 > 12)
wpn2 = 0;
if (victim->wpn[wpn] > victim->wpn[wpn2])
critical -= ((victim->wpn[wpn] + 1) / 10);
else
critical -= ((victim->wpn[wpn2] + 1) / 10);
}
if (IS_ITEMAFF (ch, ITEMA_VORPAL))
{
vorpal = TRUE;
}
if (!IS_NPC (ch) && IS_WEREWOLF (ch)
&& get_tribe (ch, TRIBE_RED_TALONS) > 4)
{
if (get_eq_char (victim, WEAR_WIELD) == NULL
&& get_eq_char (victim, WEAR_HOLD) == NULL)
{
vorpal = TRUE;
}
}
if (IS_NPC (victim) && victim->pIndexData->vnum == 3011)
return;
if (critical < 1)
critical = 1;
else if (critical > 5)
critical = 5;
if (number_percent () > critical)
return;
critical = number_range (1, 28);
if (critical == 1)
{
if (IS_HEAD (victim, LOST_EYE_L) && IS_HEAD (victim, LOST_EYE_R))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from losing an eye.", victim,
damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from losing an eye.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_FACE)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevents you from losing an eye.", victim, damaged, NULL,
TO_CHAR);
act ("$p prevents $n from losing an eye.", victim, damaged, NULL,
TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_HEAD (victim, LOST_EYE_L) && number_percent () < 50)
SET_BIT (victim->loc_hp[0], LOST_EYE_L);
else if (!IS_HEAD (victim, LOST_EYE_R))
SET_BIT (victim->loc_hp[0], LOST_EYE_R);
else if (!IS_HEAD (victim, LOST_EYE_L))
SET_BIT (victim->loc_hp[0], LOST_EYE_L);
else
return;
act ("Your skillful blow takes out $N's eye!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow takes out $N's eye!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow takes out your eye!", ch, NULL, victim,
TO_VICT);
make_part (victim, "eyeball");
return;
}
else if (critical == 2)
{
if (IS_HEAD (victim, LOST_EAR_L) && IS_HEAD (victim, LOST_EAR_R))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from losing an ear.", victim,
damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from losing an ear.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_HEAD)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevents you from losing an ear.", victim, damaged, NULL,
TO_CHAR);
act ("$p prevents $n from losing an ear.", victim, damaged, NULL,
TO_ROOM);
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if (dam - damaged->toughness < 0)
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_HEAD (victim, LOST_EAR_L) && number_percent () < 50)
SET_BIT (victim->loc_hp[0], LOST_EAR_L);
else if (!IS_HEAD (victim, LOST_EAR_R))
SET_BIT (victim->loc_hp[0], LOST_EAR_R);
else if (!IS_HEAD (victim, LOST_EAR_L))
SET_BIT (victim->loc_hp[0], LOST_EAR_L);
else
return;
act ("Your skillful blow cuts off $N's ear!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow cuts off $N's ear!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow cuts off your ear!", ch, NULL, victim,
TO_VICT);
make_part (victim, "ear");
return;
}
else if (critical == 3)
{
if (IS_HEAD (victim, LOST_NOSE))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from losing your nose.", victim,
damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from losing $s nose.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_FACE)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevents you from losing your nose.", victim, damaged,
NULL, TO_CHAR);
act ("$p prevents $n from losing $s nose.", victim, damaged, NULL,
TO_ROOM);
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if (dam - damaged->toughness < 0)
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
SET_BIT (victim->loc_hp[0], LOST_NOSE);
act ("Your skillful blow cuts off $N's nose!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow cuts off $N's nose!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow cuts off your nose!", ch, NULL, victim,
TO_VICT);
make_part (victim, "nose");
return;
}
else if (critical == 4)
{
if (IS_HEAD (victim, LOST_NOSE) || IS_HEAD (victim, BROKEN_NOSE))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from breaking your nose.", victim,
damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from breaking $s nose.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_FACE)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevents you from breaking your nose.", victim, damaged,
NULL, TO_CHAR);
act ("$p prevents $n from breaking $s nose.", victim, damaged, NULL,
TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (!IS_HEAD (victim, LOST_NOSE) && !IS_HEAD (victim, BROKEN_NOSE))
SET_BIT (victim->loc_hp[0], BROKEN_NOSE);
else
return;
act ("Your skillful blow breaks $N's nose!", ch, NULL, victim, TO_CHAR);
act ("$n's skillful blow breaks $N's nose!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow breaks your nose!", ch, NULL, victim,
TO_VICT);
return;
}
else if (critical == 5)
{
if (IS_HEAD (victim, BROKEN_JAW))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from breaking your jaw.", victim,
damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from breaking $s jaw.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_FACE)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevents you from breaking your jaw.", victim, damaged,
NULL, TO_CHAR);
act ("$p prevents $n from breaking $s jaw.", victim, damaged, NULL,
TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (!IS_HEAD (victim, BROKEN_JAW))
SET_BIT (victim->loc_hp[0], BROKEN_JAW);
else
return;
act ("Your skillful blow breaks $N's jaw!", ch, NULL, victim, TO_CHAR);
act ("$n's skillful blow breaks $N's jaw!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow breaks your jaw!", ch, NULL, victim,
TO_VICT);
return;
}
else if (critical == 6)
{
if (IS_ARM_L (victim, LOST_ARM))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from losing your left arm.",
victim, damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from losing $s left arm.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_ARMS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevent you from losing your left arm.", victim, damaged,
NULL, TO_CHAR);
act ("$p prevent $n from losing $s left arm.", victim, damaged,
NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_ARM_L (victim, LOST_ARM))
SET_BIT (victim->loc_hp[2], LOST_ARM);
else
return;
if (!IS_BLEEDING (victim, BLEEDING_ARM_L))
SET_BIT (victim->loc_hp[6], BLEEDING_ARM_L);
if (IS_BLEEDING (victim, BLEEDING_HAND_L))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_HAND_L);
act ("Your skillful blow cuts off $N's left arm!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow cuts off $N's left arm!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow cuts off your left arm!", ch, NULL, victim,
TO_VICT);
make_part (victim, "arm");
if (IS_ARM_L (victim, LOST_ARM) && IS_ARM_R (victim, LOST_ARM))
{
if ((obj = get_eq_char (victim, WEAR_ARMS)) != NULL)
take_item (victim, obj);
}
if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_HANDS)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_WRIST_L)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_FINGER_L)) != NULL)
take_item (victim, obj);
if (!is_undying (victim) && number_percent () > 50)
{
act ("You have struck $N a mortal wound.", ch, NULL, victim,
TO_CHAR);
act ("$n has struck $N a mortal wound.", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n has struck you a mortal wound.", ch, NULL, victim,
TO_VICT);
demon_gain (ch, victim);
group_gain (ch, victim);
SET_BIT (victim->extra, EXTRA_DYING);
victim->form = 20;
}
return;
}
else if (critical == 7)
{
if (IS_ARM_R (victim, LOST_ARM))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from losing your right arm.",
victim, damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from losing $s right arm.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_ARMS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevent you from losing your right arm.", victim, damaged,
NULL, TO_CHAR);
act ("$p prevent $n from losing $s right arm.", victim, damaged,
NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_ARM_R (victim, LOST_ARM))
SET_BIT (victim->loc_hp[3], LOST_ARM);
else
return;
if (!IS_BLEEDING (victim, BLEEDING_ARM_R))
SET_BIT (victim->loc_hp[6], BLEEDING_ARM_R);
if (IS_BLEEDING (victim, BLEEDING_HAND_R))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_HAND_R);
act ("Your skillful blow cuts off $N's right arm!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow cuts off $N's right arm!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow cuts off your right arm!", ch, NULL, victim,
TO_VICT);
make_part (victim, "arm");
if (IS_ARM_L (victim, LOST_ARM) && IS_ARM_R (victim, LOST_ARM))
{
if ((obj = get_eq_char (victim, WEAR_ARMS)) != NULL)
take_item (victim, obj);
}
if ((obj = get_eq_char (victim, WEAR_WIELD)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_HANDS)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_WRIST_R)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_FINGER_R)) != NULL)
take_item (victim, obj);
if (!is_undying (victim) && number_percent () > 50)
{
act ("You have struck $N a mortal wound.", ch, NULL, victim,
TO_CHAR);
act ("$n has struck $N a mortal wound.", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n has struck you a mortal wound.", ch, NULL, victim,
TO_VICT);
demon_gain (ch, victim);
group_gain (ch, victim);
SET_BIT (victim->extra, EXTRA_DYING);
victim->form = 20;
}
return;
}
else if (critical == 8)
{
if (IS_ARM_L (victim, LOST_ARM) || IS_ARM_L (victim, BROKEN_ARM))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from breaking your left arm.",
victim, damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from breaking $s left arm.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_ARMS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevent you from breaking your left arm.", victim, damaged,
NULL, TO_CHAR);
act ("$p prevent $n from breaking $s left arm.", victim, damaged,
NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_ARM_L (victim, BROKEN_ARM) && !IS_ARM_L (victim, LOST_ARM))
SET_BIT (victim->loc_hp[2], BROKEN_ARM);
else
return;
act ("Your skillful blow breaks $N's left arm!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow breaks $N's left arm!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow breaks your left arm!", ch, NULL, victim,
TO_VICT);
if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
take_item (victim, obj);
return;
}
else if (critical == 9)
{
if (IS_ARM_R (victim, LOST_ARM) || IS_ARM_R (victim, BROKEN_ARM))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from breaking your right arm.",
victim, damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from breaking $s right arm.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_ARMS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevent you from breaking your right arm.", victim,
damaged, NULL, TO_CHAR);
act ("$p prevent $n from breaking $s right arm.", victim, damaged,
NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_ARM_R (victim, BROKEN_ARM) && !IS_ARM_R (victim, LOST_ARM))
SET_BIT (victim->loc_hp[3], BROKEN_ARM);
else
return;
act ("Your skillful blow breaks $N's right arm!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow breaks $N's right arm!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow breaks your right arm!", ch, NULL, victim,
TO_VICT);
if ((obj = get_eq_char (victim, WEAR_WIELD)) != NULL)
take_item (victim, obj);
return;
}
else if (critical == 10)
{
if (IS_ARM_L (victim, LOST_HAND) || IS_ARM_L (victim, LOST_ARM))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from losing your left hand.",
victim, damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from losing $s left hand.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_HANDS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevent you from losing your left hand.", victim, damaged,
NULL, TO_CHAR);
act ("$p prevent $n from losing $s left hand.", victim, damaged,
NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_ARM_L (victim, LOST_HAND) && !IS_ARM_L (victim, LOST_ARM))
SET_BIT (victim->loc_hp[2], LOST_HAND);
else
return;
if (IS_BLEEDING (victim, BLEEDING_ARM_L))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_ARM_L);
if (!IS_BLEEDING (victim, BLEEDING_HAND_L))
SET_BIT (victim->loc_hp[6], BLEEDING_HAND_L);
act ("Your skillful blow cuts off $N's left hand!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow cuts off $N's left hand!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow cuts off your left hand!", ch, NULL, victim,
TO_VICT);
make_part (victim, "hand");
if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_HANDS)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_WRIST_L)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_FINGER_L)) != NULL)
take_item (victim, obj);
if (!is_undying (victim) && number_percent () > 75)
{
act ("You have struck $N a mortal wound.", ch, NULL, victim,
TO_CHAR);
act ("$n has struck $N a mortal wound.", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n has struck you a mortal wound.", ch, NULL, victim,
TO_VICT);
demon_gain (ch, victim);
group_gain (ch, victim);
SET_BIT (victim->extra, EXTRA_DYING);
victim->form = 20;
}
return;
}
else if (critical == 11)
{
if (IS_ARM_R (victim, LOST_HAND) || IS_ARM_R (victim, LOST_ARM))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act ("Your hard skin prevents you from losing your right hand.",
victim, damaged, NULL, TO_CHAR);
act ("$n hard skin prevents $m from losing $s right hand.", victim,
damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_HANDS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevent you from losing your right hand.", victim,
damaged, NULL, TO_CHAR);
act ("$p prevent $n from losing $s right hand.", victim, damaged,
NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
if (!IS_ARM_R (victim, LOST_HAND) && !IS_ARM_R (victim, LOST_ARM))
SET_BIT (victim->loc_hp[3], LOST_HAND);
else
return;
if (IS_BLEEDING (victim, BLEEDING_ARM_R))
REMOVE_BIT (victim->loc_hp[6], BLEEDING_ARM_R);
if (!IS_BLEEDING (victim, BLEEDING_HAND_R))
SET_BIT (victim->loc_hp[6], BLEEDING_HAND_R);
act ("Your skillful blow cuts off $N's right hand!", ch, NULL, victim,
TO_CHAR);
act ("$n's skillful blow cuts off $N's right hand!", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n's skillful blow cuts off your right hand!", ch, NULL, victim,
TO_VICT);
make_part (victim, "hand");
if ((obj = get_eq_char (victim, WEAR_WIELD)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_HANDS)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_WRIST_R)) != NULL)
take_item (victim, obj);
if ((obj = get_eq_char (victim, WEAR_FINGER_R)) != NULL)
take_item (victim, obj);
if (!is_undying (victim) && number_percent () > 75)
{
act ("You have struck $N a mortal wound.", ch, NULL, victim,
TO_CHAR);
act ("$n has struck $N a mortal wound.", ch, NULL, victim,
TO_NOTVICT);
if (!IS_NPC (victim) && victim != NULL)
act ("$n has struck you a mortal wound.", ch, NULL, victim,
TO_VICT);
demon_gain (ch, victim);
group_gain (ch, victim);
SET_BIT (victim->extra, EXTRA_DYING);
victim->form = 20;
}
return;
}
else if (critical == 12)
{
if (IS_ARM_L (victim, LOST_ARM))
return;
if (IS_ARM_L (victim, LOST_HAND))
return;
if (IS_ARM_L (victim, LOST_THUMB) && IS_ARM_L (victim, LOST_FINGER_I) &&
IS_ARM_L (victim, LOST_FINGER_M) && IS_ARM_L (victim, LOST_FINGER_R)
&& IS_ARM_L (victim, LOST_FINGER_L))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act
("Your hard skin prevents you from losing some fingers from your left hand.",
victim, damaged, NULL, TO_CHAR);
act
("$n hard skin prevents $m from losing some fingers from $s left hand.",
victim, damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_HANDS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act
("$p prevent you from losing some fingers from your left hand.",
victim, damaged, NULL, TO_CHAR);
act ("$p prevent $n from losing some fingers from $s left hand.",
victim, damaged, NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
count = 0;
count2 = 0;
if (!IS_ARM_L (victim, LOST_THUMB) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], LOST_THUMB);
count2 += 1;
make_part (victim, "thumb");
}
if (!IS_ARM_L (victim, LOST_FINGER_I) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], LOST_FINGER_I);
count += 1;
make_part (victim, "index");
}
if (!IS_ARM_L (victim, LOST_FINGER_M) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], LOST_FINGER_M);
count += 1;
make_part (victim, "middle");
}
if (!IS_ARM_L (victim, LOST_FINGER_R) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], LOST_FINGER_R);
count += 1;
make_part (victim, "ring");
if ((obj = get_eq_char (victim, WEAR_FINGER_L)) != NULL)
take_item (victim, obj);
}
if (!IS_ARM_L (victim, LOST_FINGER_L) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], LOST_FINGER_L);
count += 1;
make_part (victim, "little");
}
if (count == 1)
sprintf (buf2, "finger");
else
sprintf (buf2, "fingers");
if (count > 0 && count2 > 0)
{
sprintf (buf,
"Your skillful blow cuts off %d %s and the thumb from $N's left hand.",
count, buf2);
act (buf, ch, NULL, victim, TO_CHAR);
sprintf (buf,
"$n's skillful blow cuts off %d %s and the thumb from $N's left hand.",
count, buf2);
act (buf, ch, NULL, victim, TO_NOTVICT);
sprintf (buf,
"$n's skillful blow cuts off %d %s and the thumb from your left hand.",
count, buf2);
if (!IS_NPC (victim) && victim != NULL)
act (buf, ch, NULL, victim, TO_VICT);
if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
take_item (victim, obj);
return;
}
else if (count > 0)
{
sprintf (buf,
"Your skillful blow cuts off %d %s from $N's left hand.",
count, buf2);
act (buf, ch, NULL, victim, TO_CHAR);
sprintf (buf,
"$n's skillful blow cuts off %d %s from $N's left hand.",
count, buf2);
act (buf, ch, NULL, victim, TO_NOTVICT);
sprintf (buf,
"$n's skillful blow cuts off %d %s from your left hand.",
count, buf2);
if (!IS_NPC (victim) && victim != NULL)
act (buf, ch, NULL, victim, TO_VICT);
if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
take_item (victim, obj);
return;
}
else if (count2 > 0)
{
sprintf (buf,
"Your skillful blow cuts off the thumb from $N's left hand.");
act (buf, ch, NULL, victim, TO_CHAR);
sprintf (buf,
"$n's skillful blow cuts off the thumb from $N's left hand.");
act (buf, ch, NULL, victim, TO_NOTVICT);
sprintf (buf,
"$n's skillful blow cuts off the thumb from your left hand.");
if (!IS_NPC (victim) && victim != NULL)
act (buf, ch, NULL, victim, TO_VICT);
if ((obj = get_eq_char (victim, WEAR_HOLD)) != NULL)
take_item (victim, obj);
return;
}
return;
}
else if (critical == 13)
{
if (IS_ARM_L (victim, LOST_ARM))
return;
if (IS_ARM_L (victim, LOST_HAND))
return;
if ((IS_ARM_L (victim, LOST_THUMB) || IS_ARM_L (victim, BROKEN_THUMB))
&& (IS_ARM_L (victim, LOST_FINGER_I)
|| IS_ARM_L (victim, BROKEN_FINGER_I))
&& (IS_ARM_L (victim, LOST_FINGER_M)
|| IS_ARM_L (victim, BROKEN_FINGER_M))
&& (IS_ARM_L (victim, LOST_FINGER_R)
|| IS_ARM_L (victim, BROKEN_FINGER_R))
&& (IS_ARM_L (victim, LOST_FINGER_L)
|| IS_ARM_L (victim, BROKEN_FINGER_L)))
return;
if (IS_KENSAI (victim)
&& number_percent () <= (victim->pcdata->kensaitough / 10)
&& !vorpal)
{
act
("Your hard skin prevents you from breaking some fingers on your left hand.",
victim, damaged, NULL, TO_CHAR);
act
("$n hard skin prevents $m from breaking some fingers on $s left hand.",
victim, damaged, NULL, TO_ROOM);
return;
}
if ((damaged = get_eq_char (victim, WEAR_HANDS)) != NULL &&
damaged->toughness > 0 && !vorpal)
{
act ("$p prevent you from breaking some fingers on your left hand.",
victim, damaged, NULL, TO_CHAR);
act ("$p prevent $n from breaking some fingers on $s left hand.",
victim, damaged, NULL, TO_ROOM);
if (dam - damaged->toughness < 0)
return;
if (IS_SET (damaged->quest, QUEST_RELIC)
|| IS_SET (damaged->quest, QUEST_ARTIFACT))
return;
if ((dam - damaged->toughness > damaged->resistance))
damaged->condition -= damaged->resistance;
else
damaged->condition -= (dam - damaged->toughness);
if (damaged->condition < 1)
{
break_obj (victim, damaged);
}
return;
}
if (limbsafe (ch, victim))
return;
count = 0;
count2 = 0;
if (IS_ARM_L (victim, LOST_ARM))
return;
if (IS_ARM_L (victim, LOST_HAND))
return;
if (!IS_ARM_L (victim, BROKEN_THUMB) && !IS_ARM_L (victim, LOST_THUMB)
&& number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], BROKEN_THUMB);
count2 += 1;
}
if (!IS_ARM_L (victim, BROKEN_FINGER_I)
&& !IS_ARM_L (victim, LOST_FINGER_I) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], BROKEN_FINGER_I);
count += 1;
}
if (!IS_ARM_L (victim, BROKEN_FINGER_M)
&& !IS_ARM_L (victim, LOST_FINGER_M) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], BROKEN_FINGER_M);
count += 1;
}
if (!IS_ARM_L (victim, BROKEN_FINGER_R)
&& !IS_ARM_L (victim, LOST_FINGER_R) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], BROKEN_FINGER_R);
count += 1;
}
if (!IS_ARM_L (victim, BROKEN_FINGER_L)
&& !IS_ARM_L (victim, LOST_FINGER_L) && number_percent () < 25)
{
SET_BIT (victim->loc_hp[2], BROKEN_FINGER_L);
count += 1;
}
if (count == 1)
sprintf (buf2, "finger");
else
sprintf (buf2, "fingers");
if (count > 0 && count2 > 0)
{
sprintf (buf,
"Your skillful breaks %d %s and the thumb on $N's left hand.",
count, buf2);
act (buf, ch, NULL, victim, TO_CHAR);
sprintf (buf,
"$n's skillful blow breaks %d %s and the thumb on $N's left hand.",
count, buf2);
aShowing the first 100 KB of 163.2 KB. Download the archive for the full file.