newwolf.c
demise/src/newwolf.c · 16.5 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 <unistd.h> /* unlink() */
#include <signal.h>
#include "merc.h"
void
do_rage (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (!IS_NEWWW (ch))
{
do_huh (ch, "");
return;
}
if (!IS_WOLFBIT (ch, WW_BEASTED))
{
SET_BIT (ch->pcdata->wolfbits, WW_BEASTED);
SET_BIT (ch->affected_by, AFF_POLYMORPH);
SET_BIT (ch->vampaff, VAM_DISGUISED);
if (!IS_SET (ch->vampaff, VAM_CLAWS))
SET_BIT (ch->vampaff, VAM_CLAWS);
if (!IS_VAMPAFF (ch, VAM_FANGS))
{
send_to_char ("A pair of long fangs extend from your mouth.\n\r",
ch);
act ("A pair of long fangs extend from $n's mouth.", ch, NULL, NULL,
TO_ROOM);
SET_BIT (ch->vampaff, VAM_FANGS);
}
if (!IS_SET (ch->vampaff, VAM_NIGHTSIGHT))
{
send_to_char ("Your eyes start glowing fiery red.\n\r", ch);
act ("$n's eyes start glowing fiery red.", ch, NULL, NULL, TO_ROOM);
SET_BIT (ch->vampaff, VAM_NIGHTSIGHT);
}
if (!IS_MOD (ch, MOD_TAIL))
SET_BIT (ch->pcdata->bodymods, MOD_TAIL);
stc ("You throw back your head and howl with rage!\n\r", ch);
act ("$n throws back $s head and howls with rage!", ch, NULL, NULL,
TO_ROOM);
send_to_char ("Razor sharp talons extend from your fingers.\n\r", ch);
act ("Razor sharp talons extend from $n's fingers.", ch, NULL, NULL,
TO_ROOM);
free_string (ch->morph);
ch->morph = str_dup (get_form (ch));
}
else
{
REMOVE_BIT (ch->pcdata->wolfbits, WW_BEASTED);
REMOVE_BIT (ch->affected_by, AFF_POLYMORPH);
REMOVE_BIT (ch->vampaff, VAM_DISGUISED);
if (IS_SET (ch->vampaff, VAM_CLAWS))
REMOVE_BIT (ch->vampaff, VAM_CLAWS);
if (IS_VAMPAFF (ch, VAM_FANGS) && !IS_POLYAFF (ch, POLY_ZULO))
{
send_to_char ("Your fangs slide back into your mouth.\n\r", ch);
act ("$n's fangs slide back into $s mouth.", ch, NULL, NULL,
TO_ROOM);
REMOVE_BIT (ch->vampaff, VAM_FANGS);
}
if (IS_VAMPAFF (ch, VAM_NIGHTSIGHT))
{
send_to_char ("The red glow in your eyes fades.\n\r", ch);
act ("The red glow in $n's eyes fades.", ch, NULL, NULL, TO_ROOM);
REMOVE_BIT (ch->vampaff, VAM_NIGHTSIGHT);
}
if (IS_MOD (ch, MOD_TAIL))
REMOVE_BIT (ch->pcdata->bodymods, MOD_TAIL);
send_to_char ("Your talons slide back into your fingers.\n\r", ch);
act ("$n's talons slide back into $s fingers.", ch, NULL, NULL,
TO_ROOM);
stc ("You take a deep breath and calm your inner beast.\n\r", ch);
act ("$n takes a deep breath and calms $s inner beast.", ch, NULL, NULL,
TO_ROOM);
ch->morph = str_dup ("");
return;
}
return;
}
void
do_qualities (CHAR_DATA * ch, char *argument)
{
char arg[MIL];
char arg2[MIL];
char buf[MSL];
argument = one_argument (argument, arg);
argument = one_argument (argument, arg2);
int max = 10;
if (arg[0] == '\0')
{
ban (ch);
sprintf (buf, "Quality Points Left: %d\n\r",
get_tribe (ch, QUAL_QPOINTS));
stc (buf, ch);
ban (ch);
stc ("\n\r", ch);
sprintf (buf, "Celerity: %d Power: %d\n\r",
get_tribe (ch, QUAL_CELERITY), get_tribe (ch, QUAL_POWER));
stc (buf, ch);
sprintf (buf, "Nature: %d Beast: %d\n\r",
get_tribe (ch, QUAL_NATURE), get_tribe (ch, QUAL_BEAST));
stc (buf, ch);
ban (ch);
}
else if (!str_cmp (arg, "Celerity"))
{
if (!str_cmp (arg2, "improve"))
{
if (get_tribe (ch, QUAL_CELERITY) >= max)
{
stc ("Your already at max Celerity\n\r", ch);
return;
}
if (get_tribe (ch, QUAL_QPOINTS) <= 0)
{
stc ("You dont have enough Quality points left\n\r", ch);
return;
}
ch->pcdata->tribes[QUAL_QPOINTS]--;
ch->pcdata->tribes[QUAL_CELERITY]++;
stc ("You gain one point of Celerity\n\r", ch);
return;
}
else
{
sprintf (buf, "You have trained celerity to level %d.\n\r",
ch->pcdata->tribes[QUAL_CELERITY]);
stc (buf, ch);
}
}
else if (!str_cmp (arg, "Power"))
{
if (!str_cmp (arg2, "improve"))
{
if (get_tribe (ch, QUAL_POWER) >= max)
{
stc ("Your already at max power.\n\r", ch);
return;
}
if (get_tribe (ch, QUAL_QPOINTS) <= 0)
{
stc ("You dont have enough Quality points left\n\r", ch);
return;
}
ch->pcdata->tribes[QUAL_QPOINTS]--;
ch->pcdata->tribes[QUAL_POWER]++;
stc ("You gain one point of Power.\n\r", ch);
return;
}
else
{
sprintf (buf, "You have trained Power to level %d.\n\r",
ch->pcdata->tribes[QUAL_POWER]);
stc (buf, ch);
}
}
else if (!str_cmp (arg, "nature"))
{
if (!str_cmp (arg2, "improve"))
{
if (get_tribe (ch, QUAL_NATURE) >= max)
{
stc ("Your already at max nature.\n\r", ch);
return;
}
if (get_tribe (ch, QUAL_QPOINTS) <= 0)
{
stc ("You dont have enough Quality points left.\n\r", ch);
return;
}
ch->pcdata->tribes[QUAL_QPOINTS]--;
ch->pcdata->tribes[QUAL_NATURE]++;
stc ("You gain one point of Nature.\n\r", ch);
return;
}
else
{
sprintf (buf, "You have trained Nature to level %d.\n\r",
ch->pcdata->tribes[QUAL_NATURE]);
stc (buf, ch);
}
}
else if (!str_cmp (arg, "beast"))
{
if (!str_cmp (arg2, "improve"))
{
if (get_tribe (ch, QUAL_BEAST) >= max)
{
stc ("Your already at max beast.\n\r", ch);
return;
}
if (get_tribe (ch, QUAL_QPOINTS) <= 0)
{
stc ("You dont have enough Quality points left.\n\r", ch);
return;
}
ch->pcdata->tribes[QUAL_QPOINTS]--;
ch->pcdata->tribes[QUAL_BEAST]++;
stc ("You gain one point of beast.\n\r", ch);
return;
}
else
{
sprintf (buf, "You have trained Beast to level %d.\n\r",
ch->pcdata->tribes[QUAL_BEAST]);
stc (buf, ch);
}
}
else
{
do_qualities (ch, "");
return;
}
return;
}
void send_powers args ((CHAR_DATA * ch, int tribe));
void
do_lore (CHAR_DATA * ch, char *argument)
{
char arg[MIL];
char arg2[MIL];
char buf[MSL];
argument = one_argument (argument, arg);
argument = one_argument (argument, arg2);
int max = 5;
if (arg[0] == '\0')
{
ban (ch);
stc ("\n\r", ch);
sprintf (buf, "Celerity: %d Power: %d\n\r",
get_tribe (ch, TRIBE_CELERITY), get_tribe (ch, TRIBE_POWER));
stc (buf, ch);
sprintf (buf, "Nature: %d\n\r", get_tribe (ch, TRIBE_NATURE));
stc (buf, ch);
ban (ch);
}
else if (!str_cmp (arg, "Celerity"))
{
if (!str_cmp (arg2, "improve"))
{
if (get_tribe (ch, TRIBE_CELERITY) >= max)
{
stc ("Your already at max Celerity\n\r", ch);
return;
}
ch->pcdata->tribes[TRIBE_CELERITY]++;
stc ("You gain one point of Celerity\n\r", ch);
return;
}
else
{
send_powers (ch, TRIBE_CELERITY);
return;
}
}
else if (!str_cmp (arg, "Power"))
{
if (!str_cmp (arg2, "improve"))
{
if (get_tribe (ch, TRIBE_POWER) >= max)
{
stc ("Your already at max power.\n\r", ch);
return;
}
ch->pcdata->tribes[TRIBE_POWER]++;
stc ("You gain one point of Power.\n\r", ch);
return;
}
else
{
send_powers (ch, TRIBE_POWER);
return;
}
}
else if (!str_cmp (arg, "nature"))
{
if (!str_cmp (arg2, "improve"))
{
if (get_tribe (ch, TRIBE_NATURE) >= max)
{
stc ("Your already at max nature.\n\r", ch);
return;
}
ch->pcdata->tribes[TRIBE_NATURE]++;
stc ("You gain one point of Nature.\n\r", ch);
return;
}
else
{
send_powers (ch, TRIBE_NATURE);
return;
}
}
/* else if (!str_cmp (arg, "beast"))
{
if (!str_cmp (arg2, "improve")) {
if (get_tribe (ch, TRIBE_BEAST) >= max) {
stc ("Your already at max beast.\n\r", ch);
return;
}
ch->pcdata->tribes[TRIBE_BEAST]++;
stc ("You gain one point of beast.\n\r", ch);
return;
}
else {
send_powers (ch, TRIBE_BEAST);
return;
}
}*/
else
{
do_lore (ch, "");
return;
}
return;
}
void
send_powers (CHAR_DATA * ch, int tribe)
{
char buf[MSL];
switch (tribe)
{
default:
stc ("bug, notify linksys.\n\r", ch);
break;
case TRIBE_CELERITY:
stc ("Celerity tribe:\n\r", ch);
if (get_tribe (ch, TRIBE_CELERITY) > 0)
stc ("1: Quickness: gives an auto attack.\n\r", ch);
else
stc ("You know none of the celerity lore\n\r", ch);
if (get_tribe (ch, TRIBE_CELERITY) > 1)
stc
("2: Minor Leap: if in the same room as someone, leap on them to do damage.\n\r",
ch);
if (get_tribe (ch, TRIBE_CELERITY) > 2)
stc ("3: Fury: strikes oponent several times.\n\r", ch);
if (get_tribe (ch, TRIBE_CELERITY) > 3)
stc ("4: flinch: Lowers Damcap of oponent.\n\r", ch);
if (get_tribe (ch, TRIBE_CELERITY) > 4)
stc
("5: Block: Cuts off oponent when they try to flee, counter attack.\n\r",
ch);
break;
case TRIBE_POWER:
stc ("Power tribe:\n\r", ch);
if (get_tribe (ch, TRIBE_POWER) > 0)
stc ("1: Slash: Damage attack.\n\r", ch);
else
stc ("You know none of the power lore\n\r", ch);
if (get_tribe (ch, TRIBE_POWER) > 1)
stc ("2: Shred: Strips off eq.\n\r", ch);
if (get_tribe (ch, TRIBE_POWER) > 2)
stc ("3: Strength: Improves damcap.\n\r", ch);
if (get_tribe (ch, TRIBE_POWER) > 3)
stc ("4: Rend: Damage attack.\n\r", ch);
if (get_tribe (ch, TRIBE_POWER) > 4)
stc ("5: Savage Rush: Increases damroll/damcap greatly.\n\r", ch);
break;
case TRIBE_NATURE:
if (get_tribe (ch, TRIBE_NATURE) > 0)
stc ("1: camoflauge: renders the werewolf invisible.\n\r", ch);
else
stc ("You know none of the nature lore.\n\r", ch);
if (get_tribe (ch, TRIBE_NATURE) > 1)
stc ("2: Earthquake: room attack.\n\r", ch);
if (get_tribe (ch, TRIBE_NATURE) > 2)
stc ("3: Earthwalk: Travel Power.\n\r", ch);
if (get_tribe (ch, TRIBE_NATURE) > 3)
stc ("4: Gaia's Armor: Grants the werewolf an AC bonus\n\r", ch);
if (get_tribe (ch, TRIBE_NATURE) > 4)
stc
("5: Senses: Grants all the heighten/nightsight/umbral abilities\n\r",
ch);
break;
case TRIBE_BEAST:
sprintf (buf, "You have level %d in beast.\n\r",
ch->pcdata->tribes[TRIBE_BEAST]);
stc (buf, ch);
break;
}
return;
}
void
do_slash (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
char arg[MIL];
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!IS_NEWWW (ch))
{
do_huh (ch, "");
return;
}
if ((victim = ch->fighting) == NULL)
{
if ((victim = get_char_room (ch, arg)) == NULL)
{
stc ("Slash whom?\n\r", ch);
return;
}
}
if (victim == NULL)
return;
if (is_safe (ch, victim))
return;
int dam;
char buf[MSL];
dam = 700;
dam *= get_tribe (ch, QUAL_POWER);
hurt_person (ch, victim, dam, 0);
sprintf (buf, "$n's slash attack strikes you for %d damage!", dam);
act (buf, ch, NULL, victim, TO_VICT);
sprintf (buf, "Your slash attack strikes $N for %d damage!", dam);
act (buf, ch, NULL, victim, TO_CHAR);
waiting (ch, 8);
return;
}
void
do_fury (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
char arg[MIL];
int i;
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!IS_NEWWW (ch))
{
do_huh (ch, "");
return;
}
if ((victim = get_char_room (ch, arg)) == NULL)
{
if ((victim = ch->fighting) == NULL)
{
stc ("Slash whom?\n\r", ch);
return;
}
}
if (victim == ch)
{
stc ("Not on yourself!\n\r", ch);
return;
}
more_hit (ch, victim, gsn_furyst, DAM_CHAOS, get_tribe (ch, QUAL_CELERITY), FALSE);
// for (i = 0; i < get_tribe (ch, QUAL_CELERITY); i++)
// {
//hurt_person (ch, victim,
//dam_message (ch, victim, FALSE, dam, gsn_furyst);
//several_hit (ch, victim, ddam, udam, 0, damtype,
// int max, bool agg, bool sancted, bool capped)
// }
waiting (ch, 8);
return;
}
int
calc_newwwdam (CHAR_DATA * ch, int dam)
{
switch (get_tribe (ch, TRIBE_BEAST))
{
default:
break;
case BEAST_CELRIS:
if (get_tribe (ch, QUAL_BEAST) == 1)
dam -= 3000;
if (get_tribe (ch, QUAL_BEAST) == 2)
dam -= 2000;
if (get_tribe (ch, QUAL_BEAST) == 3)
dam -= 1500;
if (get_tribe (ch, QUAL_BEAST) == 4)
dam -= 1300;
if (get_tribe (ch, QUAL_BEAST) == 5)
dam -= 1300;
if (get_tribe (ch, QUAL_BEAST) == 6)
dam -= 1200;
if (get_tribe (ch, QUAL_BEAST) >= 7)
dam -= 1000;
break;
case BEAST_LUPIN:
break;
case BEAST_LYKAN:
if (get_tribe (ch, QUAL_BEAST) == 2)
dam += 200;
if (get_tribe (ch, QUAL_BEAST) == 3)
dam += 300;
if (get_tribe (ch, QUAL_BEAST) == 4)
dam += 350;
if (get_tribe (ch, QUAL_BEAST) == 5)
dam += 500;
if (get_tribe (ch, QUAL_BEAST) == 6)
dam += 600;
if (get_tribe (ch, QUAL_BEAST) == 7)
dam += 700;
if (get_tribe (ch, QUAL_BEAST) == 8)
dam += 750;
if (get_tribe (ch, QUAL_BEAST) == 9)
dam += 800;
if (get_tribe (ch, QUAL_BEAST) == 10)
dam += 1000;
break;
}
return dam;
}
void
do_setbeast (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (!IS_NEWWW (ch))
return;
char arg[MSL];
argument = one_argument (argument, arg);
if (!str_cmp (arg, "celris"))
ch->pcdata->tribes[TRIBE_BEAST] = BEAST_CELRIS;
else if (!str_cmp (arg, "lupin"))
ch->pcdata->tribes[TRIBE_BEAST] = BEAST_LUPIN;
else if (!str_cmp (arg, "lykan"))
ch->pcdata->tribes[TRIBE_BEAST] = BEAST_LYKAN;
else
{
stc ("Invalid choice!\n\r", ch);
stc ("Valid choices are:\n\r", ch);
stc ("Celeris\n\r", ch);
stc ("Lupin\n\r", ch);
stc ("Lykan\n\r", ch);
return;
}
stc ("Beast set.\n\r", ch);
return;
}
int
calc_newwwhrdr (CHAR_DATA * ch, int hrdr)
{
switch (get_tribe (ch, TRIBE_BEAST))
{
default:
break;
case BEAST_CELRIS:
if (get_tribe (ch, QUAL_BEAST) == 1)
hrdr -= 2000;
if (get_tribe (ch, QUAL_BEAST) == 2)
hrdr -= 1500;
if (get_tribe (ch, QUAL_BEAST) == 3)
hrdr -= 1500;
if (get_tribe (ch, QUAL_BEAST) >= 4)
hrdr -= 1000;
break;
case BEAST_LUPIN:
if (get_tribe (ch, QUAL_BEAST) == 1)
hrdr += 100;
if (get_tribe (ch, QUAL_BEAST) == 2)
hrdr += 100;
if (get_tribe (ch, QUAL_BEAST) == 3)
hrdr += 150;
if (get_tribe (ch, QUAL_BEAST) == 4)
hrdr += 150;
if (get_tribe (ch, QUAL_BEAST) == 5)
hrdr += 250;
if (get_tribe (ch, QUAL_BEAST) == 6)
hrdr += 300;
if (get_tribe (ch, QUAL_BEAST) == 7)
hrdr += 300;
if (get_tribe (ch, QUAL_BEAST) == 8)
hrdr += 350;
if (get_tribe (ch, QUAL_BEAST) == 9)
hrdr += 350;
if (get_tribe (ch, QUAL_BEAST) == 10)
hrdr += 350;
break;
case BEAST_LYKAN:
if (get_tribe (ch, QUAL_BEAST) == 1)
hrdr += 200;
if (get_tribe (ch, QUAL_BEAST) == 2)
hrdr += 200;
if (get_tribe (ch, QUAL_BEAST) == 3)
hrdr += 300;
if (get_tribe (ch, QUAL_BEAST) == 4)
hrdr += 300;
if (get_tribe (ch, QUAL_BEAST) == 5)
hrdr += 300;
if (get_tribe (ch, QUAL_BEAST) == 6)
hrdr += 350;
if (get_tribe (ch, QUAL_BEAST) == 7)
hrdr += 350;
if (get_tribe (ch, QUAL_BEAST) == 8)
hrdr += 400;
if (get_tribe (ch, QUAL_BEAST) == 9)
hrdr += 400;
if (get_tribe (ch, QUAL_BEAST) == 10)
hrdr += 500;
break;
}
return hrdr;
}
void do_shred (CHAR_DATA *ch, char *argument)
{
if (IS_NPC (ch))
return;
if (!IS_NEWWW (ch))
{
do_huh (ch, "");
return;
}
CHAR_DATA *victim;
OBJ_DATA *obj;
char arg[MIL];
argument = one_argument (argument, arg);
if ((victim = get_char_room (ch, arg)) == NULL) {
stc ("who do you want to shred?\n\r", ch);
return;
}
int rand = number_range (1, 5);
switch (rand) {
case 1:
if ((obj = get_eq_char (victim, WEAR_BODY)) != NULL)
take_item (victim, obj);
break;
case 2:
if ((obj = get_eq_char (victim, WEAR_HEAD)) != NULL)
take_item (victim, obj);
break;
case 3:
if ((obj = get_eq_char (victim, WEAR_WAIST)) != NULL)
take_item (victim, obj);
break;
case 4:
if ((obj = get_eq_char (victim, WEAR_ABOUT)) != NULL)
take_item (victim, obj);
break;
case 5:
if ((obj = get_eq_char (victim, WEAR_FACE)) != NULL)
take_item (victim, obj);
break;
default:
break;
}
act ("You shred $N's armor off.",ch, NULL, victim, TO_CHAR);
act ("$n shreds your armor off.",ch, NULL, victim, TO_VICT);
act ("$n shreds $N's armor off.",ch, NULL, victim, TO_ROOM);
return;
}