monk.c
demise/src/monk.c · 8.8 KB
From the archive dodbackup-final.tar.gz
Download the archive « Back to the archive contents
/***************************************************************************
* God Wars Mud originally written by KaVir aka Richard Woolcock. *
* Changes done to the code done by Sage aka Walter Howard, this mud is *
* for the public, however if you run this code it means you agree *
* to the license.low, license.gw, and license.merc have fun. :) *
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
void
do_guide (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
char arg[MIL];
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!IS_MONK (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (arg[0] == '\0')
{
send_to_char ("Guide whom?\n\r", ch);
return;
}
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;
}
if (IS_IMMORTAL (victim))
{
send_to_char ("Not on Immortals's.\n\r", ch);
return;
}
if (ch == victim)
{
send_to_char ("You cannot guide yourself.\n\r", ch);
return;
}
if (IS_MONK (victim))
{
send_to_char ("They are already guided.\n\r", ch);
return;
}
if (victim->level != LEVEL_AVATAR && !IS_IMMORTAL (victim))
{
send_to_char ("You can only guide avatars.\n\r", ch);
return;
}
if (victim->class != 0)
{
stc ("They are already classed.\n\r", ch);
return;
}
if (!IS_IMMUNE (victim, IMM_VAMPIRE))
{
send_to_char ("You cannot guide an unwilling person.\n\r", ch);
return;
}
if (ch->exp < 50000)
{
send_to_char
("You cannot afford the 50000 exp required to guide them.\n\r", ch);
return;
}
if (victim->exp < 50000)
{
send_to_char
("They cannot afford the 50000 exp required to be guided from you.\n\r",
ch);
return;
}
ch->exp -= 50000;
victim->exp -= 50000;
act ("You guide $N in the ways of god.", ch, NULL, victim, TO_CHAR);
act ("$n guide $N in the ways of god.", ch, NULL, victim, TO_NOTVICT);
act ("$n guide you in the way of god.", ch, NULL, victim, TO_VICT);
send_to_char ("You are now a monk.\n\r", victim);
free_string (victim->lord);
victim->lord = str_dup (ch->name);
victim->class = CLASS_MONK;
save_char_obj (ch);
save_char_obj (victim);
return;
}
void
do_ribbon (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
if (!IS_SAINT (ch))
{
do_huh (ch, "");
return;
}
if (ch->monkab[HOLY] < 4)
{
stc ("You dont have this power yet.\n\r", ch);
return;
}
if (IS_COR (ch, COR_RIBBONS))
{
stc ("Your chi ribbons slowly fade away.\n\r", ch);
act ("$n's glowing ribbons slowly fade away.", ch, NULL, NULL, TO_ROOM);
REMOVE_BIT (ch->corbits, COR_RIBBONS);
return;
}
SET_BIT (ch->corbits, COR_RIBBONS);
stc ("You focus briefly, forming glowing ribbons out of your chi.\n\r", ch);
act ("$n focuses briefly, forming glowing ribbons around $m.\n\r", ch, NULL,
NULL, TO_ROOM);
return;
}
void
do_flaminghands (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (!IS_MONK (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (ch->monkab[BODY] < 5)
{
send_to_char ("You have not learned this ability yet.\n\r", ch);
return;
}
if (IS_MORE (ch, MORE_HAND_FLAME))
{
REMOVE_BIT (ch->more, MORE_HAND_FLAME);
send_to_char ("Your hands are no longer engulfed by flames.\n\r", ch);
act ("$n's hands are no longer engulfed by flames.\n\r", ch, NULL, NULL,
TO_ROOM);
return;
}
if (!IS_MORE (ch, MORE_HAND_FLAME))
{
SET_BIT (ch->more, MORE_HAND_FLAME);
send_to_char ("Your hands are engulfed by flames!\n\r", ch);
act ("$n's hands are engulfed by flames!\n\r", ch, NULL, NULL, TO_ROOM);
return;
}
}
void
do_adamantium (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (!IS_MONK (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (ch->monkab[BODY] < 1)
{
send_to_char ("You have not learned this ability yet.\n\r", ch);
return;
}
if (IS_VAMPAFF (ch, VAM_CLAWS))
{
REMOVE_BIT (ch->vampaff, VAM_CLAWS);
send_to_char ("Your hands resume their normal toughness.\n\r", ch);
act ("$n's hands resume their normal toughness.\n\r", ch, NULL, NULL,
TO_ROOM);
return;
}
if (!IS_VAMPAFF (ch, VAM_CLAWS))
{
SET_BIT (ch->vampaff, VAM_CLAWS);
send_to_char ("Your hands turn as hard as adamantium!\n\r", ch);
act ("$n's hands turn as hard as adamantium!\n\r", ch, NULL, NULL,
TO_ROOM);
return;
}
}
void
do_celestial (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
char buf[MSL];
char arg[MIL];
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!IS_MONK (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (ch->monkab[SPIRIT] < 4)
{
send_to_char
("You must obtain level 4 in Spirit to use Celestial Path.\n\r", ch);
return;
}
if (arg[0] == '\0')
{
send_to_char ("Open a celestial path to who?\n\r", ch);
return;
}
if ((victim = get_char_world (ch, arg)) == NULL)
{
send_to_char ("They aren't here.\n\r", ch);
return;
}
if (has_fighttimer (ch))
return;
if (is_inarena (victim))
return;
if (is_inarena (ch))
return;
if (travelsafe (ch, victim))
return;
if (IS_SET (victim->evenmore, EM_JAILED))
{
send_to_char ("What??? You wish to go to jail too?\n\r", ch);
return;
}
if (!IS_NPC (victim) && !IS_IMMUNE (victim, IMM_SUMMON))
{
send_to_char ("There summon is off!\n\r", ch);
return;
}
if (ch == victim)
{
send_to_char ("But you're already at yourself!\n\r", ch);
return;
}
if (victim->in_room == NULL || victim->in_room == ch->in_room)
{
send_to_char ("Nothing happens.\n\r", ch);
return;
}
if (victim->in_room->vnum == ch->in_room->vnum)
{
send_to_char ("But you're already there!\n\r", ch);
return;
}
char_from_room (ch);
char_to_room (ch, victim->in_room);
if (IS_NPC (victim))
{
sprintf (buf, "You concentrate and open a Celestial path to %s!\n\r",
victim->short_descr);
send_to_char (buf, ch);
}
if (!IS_NPC (victim))
{
sprintf (buf, "You concentrate and open a Celestial path to %s!\n\r",
victim->name);
send_to_char (buf, ch);
}
act ("$n appears before you through a Celestial portal!\n\r", ch, NULL,
NULL, TO_ROOM);
do_look (ch, "auto");
return;
}
void
do_godsheal (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
char arg[MIL];
int min = 0;
int max = 0;
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!IS_MONK (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (ch->monkab[SPIRIT] < 5)
{
stc ("You dont have this power yet.\n\r", ch);
return;
}
if (ch->mana < 1100)
{
send_to_char ("You don't have enough magic energy to use heal.\n\r",
ch);
return;
}
if (arg[0] == '\0')
{
victim = ch;
}
else if ((victim = get_char_room (ch, arg)) == NULL)
{
stc ("There is noone here matching that description.\n\r", ch);
return;
}
if (victim->fighting != NULL || has_fighttimer (ch))
{
min = victim->max_hit / 11;
max = victim->max_hit / 9;
send_to_char ("You are surrounded in a glowing halo of energy.\n\r",
victim);
act ("$n is surrounded by a glowing halo, and looks very relaxed.\n\r",
victim, NULL, NULL, TO_ROOM);
victim->hit += number_range (min, max);
victim->agg -= number_range (3, 9);
if (victim->hit > victim->max_hit)
victim->hit = victim->max_hit;
if (victim->agg < 0)
victim->agg = 0;
ch->mana -= 1000;
waiting (ch, 24);
update_pos (victim);
return;
}
if (victim->fighting == NULL)
{
min = victim->max_hit / 8;
max = victim->max_hit / 5;
send_to_char ("You feel a mighty force lay his hands on you.\n\r", ch);
act ("$n is surrounded by a glowing halo, and looks very relaxed.\n\r",
victim, NULL, NULL, TO_ROOM);
victim->hit += number_range (min, max);
victim->agg -= number_range (5, 15);
if (victim->hit > victim->max_hit)
victim->hit = victim->max_hit;
if (victim->agg < 0)
victim->agg = 0;
ch->mana -= 1000;
waiting (ch, 8);
update_pos (victim);
return;
}
}