monk3.c

demise/src/monk3.c · 13.0 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_blinding (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char arg[MIL];
  char buf[MSL];

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

  if (!IS_MONK (ch) && !IS_ELF (ch))
    {
      stc ("Huh?\n\r", ch);
      return;
    }
  if (IS_MONK (ch))
    {
      if (ch->monkab[SPIRIT] < 1)
	{
	  stc ("Your spirit is far too weak.\n\r", ch);
	  stc
	    ("You need a level one mastery of the Spirit to use Blinding Agony.\n\r",
	     ch);
	  return;
	}
    }
  if (IS_ELF (ch))
    {
      if (ch->pcdata->wisdoms[ELF_FIRE] < 4)
	{
	  stc ("Your Fire is far too weak.\n\r", ch);
	  stc
	    ("You need a level four mastery of Fire to use Blinding Agony.\n\r",
	     ch);
	  return;
	}
    }

  if (arg[0] == '\0')
    {
      stc ("Who do you wish to use Blinding Agony on?\n\r", ch);
      return;
    }

  if (ch->move < 200)
    {
      stc ("You are far too exhausted to use Blinding Agony.\n\r", ch);
      stc ("Try getting 200 Vitality.\n\r", ch);
      return;
    }

  if ((victim = get_char_room (ch, arg)) == NULL)
    {
      stc ("They are not here.\n\r", ch);
      return;
    }

  if (victim->fight_timer > 0)
    return act ("$N's is to agitated for you to aim properly.", ch, NULL,
		victim, TO_CHAR);

  if (is_safe (ch, victim))
    return;

  ch->fight_timer = 30;
  victim->fight_timer = 30;
  waiting (ch, 12);

  if (IS_AFFECTED (victim, AFF_TOTALBLIND))
    {
      act ("You hurl a ball of blinding light at $N.", ch, NULL, victim,
	   TO_CHAR);
      act ("$n hurls a ball of blinding light at you.", ch, NULL, victim,
	   TO_VICT);
      act ("$n hurls a ball of blinding light at $N.", ch, NULL, victim,
	   TO_NOTVICT);
      stc ("Nothing happens.\n\r", ch);
      ch->move -= 100;
      return;
    }

  else
    {
      act ("You hurl a ball of blinding light at $N.", ch, NULL, victim,
	   TO_CHAR);
      act ("$n hurls a ball of blinding light at you.", ch, NULL, victim,
	   TO_VICT);
      act ("$n hurls a ball of blinding light at $N.", ch, NULL, victim,
	   TO_NOTVICT);
      SET_BIT (victim->affected_by, AFF_TOTALBLIND);
      victim->blindtimer = 10;
      ch->move -= 200;
      stc ("The searing heat of the ball blinds you.\n\r", victim);
      return;
    }

  return;

}

void
do_handform (CHAR_DATA * ch, char *argument)
{
  char arg[MIL];
  char buf[MSL];

  argument = one_argument (argument, arg);


  if (IS_NPC (ch))
    return;

  if (!IS_MONK (ch) && !IS_XX (ch, XX_RAKMONK))
    return stc ("Huh?\n\r", ch);

  if (IS_SHINOBI (ch))
    {
      stc ("You can not attain the mental state to transform your hands.\n\r",
	   ch);
      return;
    }

  if (arg[0] == '\0')
    {
      stc
	("What form do you wish to change your hands to ?\n\rSlice, Stab, Slash, Whip, Claw, Blast, Pound, Crush, Grep, Bite, Pierce, Suck or None.\n\r",
	 ch);
      return;
    }

  if (!str_cmp (arg, "slice"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, SLICEFORM);
    }
  else if (!str_cmp (arg, "stab"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, STABFORM);
    }
  else if (!str_cmp (arg, "slash"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, SLASHFORM);
    }
  else if (!str_cmp (arg, "whip"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, WHIPFORM);
    }
  else if (!str_cmp (arg, "claw"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, CLAWFORM);
    }
  else if (!str_cmp (arg, "blast"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, BLASTFORM);
    }
  else if (!str_cmp (arg, "pound"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, POUNDFORM);
    }
  else if (!str_cmp (arg, "crush"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, CRUSHFORM);
    }
  else if (!str_cmp (arg, "grep"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, GREPFORM);
    }
  else if (!str_cmp (arg, "bite"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, BITEFORM);
    }
  else if (!str_cmp (arg, "pierce"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, PIERCEFORM);
    }
  else if (!str_cmp (arg, "suck"))
    {
      ch->handform = 0;
      SET_BIT (ch->handform, SUCKFORM);
    }
  else if (!str_cmp (arg, "none"))
    {
      ch->handform = 0;
      stc ("Your hands assume their normal form.\n\r", ch);
      act ("$n hands assume their normal form.", ch, NULL, NULL, TO_ROOM);
      return;
    }
  else
    {
      stc
	("What form do you wish to change your hands to ?\n\rSlice, Stab, Slash, Whip, Claw, Blast, Pound, Crush, Grep, Bite, Pierce, Suck or None.\n\r",
	 ch);
      return;
    }

  sprintf (buf, "Your hand's take on the form of %sing weapons.\n\r", arg);
  stc (buf, ch);
  sprintf (buf, "$n hand's takes on the form of %sing weapons.", arg);
  act (buf, ch, NULL, NULL, TO_ROOM);
  return;

}

void
do_dokuyaku (CHAR_DATA * ch, char *argument)
{
  int dam = 0;
  char buf[MSL];
  CHAR_DATA *victim;
  bool foot = FALSE;
  int max, i;

  if ((victim = ch->fighting) == NULL)
    {
      send_to_char ("You aren't fighting anyone.\n\r", ch);
      return;
    }

  dam = number_range (1, 4);

  dam = find_dam (ch, victim, dam, foot);


  if (ch->chi[CURRENT] == 0)
    {

      send_to_char ("Your 'Mighty' Dokuyaku fisses and dies.\n\r", ch);
      damage (ch, victim, dam, gsn_palmstrike, DAM_NORMAL, FALSE, TRUE, TRUE);
      if (victim == NULL || victim->position == POS_DEAD || dam < 1)
	return;
      if (victim->position == POS_FIGHTING)
	stop_fighting (victim, TRUE);
      victim->position = POS_STUNNED;
    }
  else if (ch->chi[CURRENT] > 0)
    {
      sprintf (buf,
	       "#CYour chi energy's channels into your attack as your palm strikes $N's forhead.#n");
      act (buf, ch, NULL, victim, TO_CHAR);
      sprintf (buf,
	       "#C$n chi energy's channels into $s attack as $s palm strikes your forhead.#n");
      act (buf, ch, NULL, victim, TO_VICT);
      sprintf (buf,
	       "#C$n chi energy's channels into $s attack as $s palm strikes $N's forhead with a sickening crack.#n");
      act (buf, ch, NULL, victim, TO_NOTVICT);

      damage (ch, victim, dam, gsn_palmstrike, DAM_NORMAL, FALSE, TRUE, TRUE);

      max = ch->chi[CURRENT] / 2;

      if (max < 1)
	max = 1;

      for (i = 0; i < max; i++)
	{
	  damage (ch, victim, dam, gsn_chistrike, DAM_MAGIC, FALSE, TRUE,
		  TRUE);
	}

      if (IS_COR (ch, COR_RIBBONS))
	{
	  int max2, ii;

	  max2 = number_range (1, ch->chi[CURRENT]);

	  for (ii = 0; ii < max; ii++)
	    {
	      damage (ch, victim, dam, gsn_chi_ribbon, DAM_LIGHT, FALSE, TRUE,
		      TRUE);
	    }
	}


      if (ch->chi[CURRENT] >= 6 && !IS_NPC (victim))
	{
	  char sex[MSL];

	  if (ch->sex == 1)
	    sprintf (sex, "his");
	  else if (ch->sex == 2)
	    sprintf (sex, "her");
	  else
	    sprintf (sex, "it's");

	  if (number_percent () >= 50)
	    {
	      if (victim->hit <=
		  (victim->max_hit / ((victim->lstatus + 1) / 2)))
		{
		  sprintf (buf, "#C$n's dark chi tears you apart.#n");
		  act (buf, ch, NULL, victim, TO_VICT);
		  sprintf (buf, "#CYour dark chi tears $N apart.#n");
		  act (buf, ch, NULL, victim, TO_CHAR);
		  sprintf (buf, "#C$n's dark chi tears $N apart.#n");
		  act (buf, ch, NULL, victim, TO_NOTVICT);
		  sprintf (buf,
			   "#C%s#c tears #C%s#c apart with %s dark chi#n",
			   ch->name, victim->name, sex);
		  if (inarena (ch))
		    {
		      hurt_person (ch, victim, victim->hit, 0);
		    }
		  else
		    if (IS_SET (mudconfig->world_affects, WORLD_ARMAGEDDON))
		    {
		      sprintf (buf,
			       "%s has destroyed %s and receives %d credits!",
			       ch->name, victim->name, mudconfig->bounty);
		      armageddoninfo (buf);
		      if (mudconfig->pkcounter > 0)
			{
			  mudconfig->pkcounter--;
			  if (mudconfig->pkcounter > 0)
			    {
			      sprintf (buf,
				       "%d more death%s and Armageddon will deactivate.",
				       mudconfig->pkcounter,
				       mudconfig->pkcounter == 1 ? "" : "s");
			      armageddoninfo (buf);
			    }
			}
		      sprintf (log_buf,
			       "%s destroyed by %s at %d. [DURING ARMAGEDDON]",
			       victim->name, ch->name, victim->in_room->vnum);
		      log_string (log_buf);
		      char_from_room (victim);
		      char_to_room (victim, get_room_index (ROOM_VNUM_ALTAR));
		      do_mclear (victim, "self");
		      do_restore (ch, "self");
		      do_restore (victim, "self");
		      do_stand (victim, "");
		      victim->safetimer += 60;
		      victim->fight_timer = 0;
		      ch->pcdata->quest += mudconfig->bounty;
		      if (mudconfig->pkcounter == 0)
			{
			  ch->fight_timer = 0;
			  deactivate_armageddon ();
			}
		      REMOVE_BIT (victim->immune, IMM_STAKE);
		      REMOVE_BIT (victim->extra, TIED_UP);
		      REMOVE_BIT (victim->extra, GAGGED);
		      REMOVE_BIT (victim->extra, BLINDFOLDED);
		      REMOVE_BIT (victim->extra, EXTRA_NO_ACTION);
		      REMOVE_BIT (victim->more, MORE_FLAMES);
		      victim->pcdata->demonic = 0;
		      victim->pcdata->atm = 0;
		      victim->legendeq = 0;
		      victim->itemaffect = 0;
		      victim->affected_by = 0;
		      victim->armor = 100;
		      victim->position = POS_STANDING;
		      victim->hit = 1;
		      victim->mana = UMAX (1, victim->mana);
		      victim->move = UMAX (1, victim->move);
		      victim->hitroll = 0;
		      victim->damroll = 0;
		      victim->saving_throw = 0;
		      victim->carry_weight = 0;
		      victim->carry_number = 0;
		      victim->polyaff = 0;
		      do_call (victim, "all");
		      do_wear (victim, "all");
		      return;
		    }

		  else
		    {
		      if ((victim->race == 0 && ch->race > 0)
			  || ch->race - victim->race > 10)
			{
			  paradox (ch);
			  return;
			}
		      else
			{
			  int bonus = 0;

			  ch->race++;
			  victim->race--;
			  if (victim->exp > 0)
			    {
			      bonus = victim->exp / 4;
			      victim->exp -= bonus;
			      ch->exp += bonus;
			    }
			}
		      do_info (ch, buf);
		      if (victim->bounty > 0)
			{
			  sprintf (buf,
				   "#C%s#c receives the %d credit%s bounty from #C%s's#c head!",
				   ch->name, victim->bounty,
				   victim->bounty > 1 ? "s" : "",
				   victim->name);
			  do_info (ch, buf);
			  ch->pcdata->quest += victim->bounty;
			  victim->bounty = 0;
			}
		      killperson (ch, victim);
		    }
		}
	    }
	}
      return;


    }


  return;
}

void
do_msummon (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  CHAR_DATA *mount;
  char arg[MIL];
  char buf[MSL];


  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

  if ((victim = get_char_world (ch, arg)) == NULL
      || victim == ch
      || victim->in_room == NULL || ch->in_room == NULL || IS_NPC (victim))
    {
      send_to_char ("Nothing happens.\n\r", ch);
      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_IMMORTAL (victim))
    {
      stc ("The spell failed.\n\r", ch);
      sprintf (buf, "%s just tried to summon you.\n\r", ch->name);
      stc (buf, victim);
      return;
    }
  if (victim->fight_timer > 0)
    {
      stc ("Nothing happens.\n\r", ch);
      return;
    }
  if (is_inarena (victim))
    return;
  if (is_inarena (ch))
    return;

  act ("$n disappears suddenly.", victim, NULL, NULL, TO_ROOM);
  char_from_room (victim);
  char_to_room (victim, ch->in_room);
  act ("$n arrives suddenly.", victim, NULL, NULL, TO_ROOM);
  act ("$N has brought you here!", victim, NULL, ch, TO_CHAR);
  do_look (victim, "auto");
  if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
    {
      guardian_message (victim);
      if (IS_SAINT (ch))
	{
	  act ("$n just had $s cherub bring you here.", ch, NULL, victim,
	       TO_VICT);
	  ch->gangtime = 0;
	  free_string (ch->scryperp);
	  ch->scryperp = str_dup ("");
	}
      else
	act ("$n just Summoned you.", ch, NULL, victim, TO_VICT);
    }
  if ((mount = victim->mount) == NULL)
    return;
  char_from_room (mount);
  char_to_room (mount, get_room_index (victim->in_room->vnum));
  do_look (mount, "auto");
  return;
}

void
do_bring (CHAR_DATA * ch, char *argument)
{
  if (IS_NPC (ch))
    return;

  if (!IS_SAINT (ch))
    {
      do_huh (ch, "");
      return;
    }

  if (ch->monkab[HOLY] < 2)
    {
      stc ("You dont have that power yet.\n\r", ch);
      return;
    }

  if (ch->gangtime < 1)
    {
      stc ("Noone has scryed you recently.\n\r", ch);
      return;
    }

  if (strlen (ch->scryperp) < 3)
    {
      stc ("For some reason you just stumbled on a bug, tell Corim.\n\r", ch);
      ch->gangtime = 0;
      return;
    }

  do_msummon (ch, ch->scryperp);
  return;
}

Site Stats

Snippets: 1791
Codebases: 571