cor_brids.c

demise/src/cor_brids.c · 11.5 KB

From the archive dodbackup-final.tar.gz

Download the archive   « Back to the archive contents

/*****************************************************************************************************
*                                                                                                    *
*                                                                                                    *
*                                                                                                    *
*                     Hybrid Powers for different classes for Dreams of Demise                       *
*                                                                                                    *
*                                                                                                    *
*                                                                                                    *
*                                   Coded by Corim aka Infinity                                      *
*                                       aka Gunnar Trulsrud                                          *
*                                                                                                    *
*                                                                                                    *
*                                                                                                    *
*****************************************************************************************************/



#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 "merc.h"




void
do_shadowblaze (CHAR_DATA * ch, char *argument)
{

  if (IS_NPC (ch))
    return;

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

  if (get_disc (ch, DISC_QUIETUS) < 10)
    {
      stc ("You require level 10 Quietus to use Shadow Blaze.\n\r", ch);
      return;
    }

  if (IS_XX (ch, XX_SHADOWBLAZE))
    {
      stc
	("The blazing shadow magic that is constantly arching across your body fades away.\n\r",
	 ch);
      act
	("The blazing shadow magic that is constantly arching across $n's body fades away.\n\r",
	 ch, NULL, NULL, TO_ROOM);
      REMOVE_BIT (ch->xxbits, XX_SHADOWBLAZE);
      return;
    }

  stc
    ("Blazing shadow magic starts pulsating and arching across your body.\n\r",
     ch);
  act
    ("Blazing shadow magic starts pulsating and arching across $n's body.\n\r",
     ch, NULL, NULL, TO_ROOM);
  SET_BIT (ch->xxbits, XX_SHADOWBLAZE);
  return;
}

void
do_holytouch (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  char arg[MIL];
  int number = 0;
  OBJ_DATA *obj;

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

      if (get_tribe (ch, TRIBE_CHILDREN_OF_GAIA) < 6)
	{
	  send_to_char
	    ("You require level 6 Children of Gaia to imbue an item with the Holy Touch.\n\r",
	     ch);
	  return;
	}
    }

  if (arg[0] == '\0')
    {
      stc ("What item do you wish to bestow holy power onto?\n\r", ch);
      return;
    }

  if (!(obj = get_obj_carry (ch, arg)))
    {
      send_to_char ("You don't have that.\n\r", ch);
      return;
    }

  if (obj->chobj != NULL)
    {
      send_to_char ("Somehow the object seems to resist gaia's touch.\n\r",
		    ch);
      return;
    }

  if (IS_SET (obj->extra_flags, ITEM_VANISH))
    {
      stc ("Not on Illusions.\n\r", ch);
      return;
    }

  if (IS_SET (obj->weapflags, WEAPON_GAIAINQ))
    {
      stc ("This item is already imbued with Holy power.\n\r", ch);
      return;
    }

  if (IS_SET (obj->spectype, SITEM_MASTERY))
    {
      act ("$p is a mastery item.", ch, obj, NULL, TO_CHAR);
      return;
    }

  if (IS_SET (obj->quest, QUEST_ARTIFACT))
    {
      act ("$p is an artifact.", ch, obj, NULL, TO_CHAR);
      return;
    }

  if (obj->item_type != ITEM_ARMOR)
    {
      send_to_char ("You can only bestow the holy power onto armor.\n\r", ch);
      return;
    }

  if (obj->questowner == NULL || strlen (obj->questowner) < 2 ||
      str_cmp (obj->questowner, ch->name))
    {
      stc ("Only on items that belong to you.\n\r", ch);
      return;
    }

  if (ch->pcdata->power[POWER_CURRENT] < 5000)
    {
      sprintf
	(buf,
	 "You need 5000 %s power points to bestow holy power onto that item\n\r",
	 get_class (ch));
      stc (buf, ch);
      return;
    }

  if (ch->pcdata->crystal < 5)
    {
      send_to_char ("You don't have the required 5 power crystals\n\r", ch);
      return;
    }

  ch->pcdata->power[POWER_CURRENT] -= 5000;
  ch->pcdata->crystal -= 5;

  if (!IS_CREATOR (ch))
    {
      number = get_tribe (ch, TRIBE_CHILDREN_OF_GAIA);
    }
  else
    {
      number = 10;
    }

  number *= number_fuzzy (2);
  number /= 2;

  SET_BIT (obj->weapflags, WEAPON_GAIAINQ);
  add_affect (obj, APPLY_DAMCAP, number);
  SET_BIT (obj->spectype, SITEM_MESSAGE);
  free_string (obj->chpoweruse);
  obj->chpoweruse =
    str_dup ("$p glows with holy light healing a few of your minor wounds.");
  free_string (obj->victpoweruse);
  obj->victpoweruse =
    str_dup ("$p glows with holy light healing a few of $n minor wounds.");

  act ("You bestow holy power onto $p.", ch, obj, NULL, TO_CHAR);
  act ("$n bestows holy power onto $p.", ch, obj, NULL, TO_ROOM);
  return;
}

void
do_earthshield (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  int stat = 0, stat2 = 0;

  if (IS_NPC (ch))
    return;

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

  if (get_tribe (ch, TRIBE_CHILDREN_OF_GAIA) < 7)
    {
      stc
	("You require level 7 Children of Gaia to create the Earth Shield.\n\r",
	 ch);
      return;
    }

  if (IS_XX (ch, XX_EARTHSHIELD))
    {
      if (IS_XX (ch, XX_BROKENSHIELD))
	{
	  stc ("You banish your broken #gEa#Gr#gth#n Shield.\n\r", ch);
	  act ("$n's broken #gEa#Gr#gth#n Shield fades away.", ch, NULL, NULL,
	       TO_ROOM);
	  REMOVE_BIT (ch->xxbits, XX_BROKENSHIELD);
	}
      else
	{
	  stc ("You banish your #gEa#Gr#gth#n Shield.\n\r", ch);
	  act ("$n's #gEa#Gr#gth#n Shield fades away.", ch, NULL, NULL,
	       TO_ROOM);
	}
      REMOVE_BIT (ch->xxbits, XX_EARTHSHIELD);
      return;
    }

  stat = ch->max_hit;
  stat *= 60;
  stat /= 100;

  stat2 = ch->max_hit;
  stat2 *= 30;
  stat2 /= 100;

  if (ch->hit <= stat2)
    {
      stc ("You lack the strength to summon a #gEa#Gr#gth#n Shield.\n\r", ch);
      return;
    }

  else if (ch->hit <= stat)
    {
      stc
	("You summon a broken #gEa#Gr#gth#n Shield to protect you from harm.\n\r",
	 ch);
      act
	("$n summons a broken #gEa#Gr#gth#n Shield to protect $m from harm.\n\r",
	 ch, NULL, NULL, TO_ROOM);
      SET_BIT (ch->xxbits, XX_BROKENSHIELD);
      SET_BIT (ch->xxbits, XX_EARTHSHIELD);
      return;
    }
  else
    {
      stc ("You summon an #gEa#Gr#gth#n Shield to protect you from harm.\n\r",
	   ch);
      act ("$n summons an #gEa#Gr#gth#n Shield to protect $m from harm.\n\r",
	   ch, NULL, NULL, TO_ROOM);
      SET_BIT (ch->xxbits, XX_EARTHSHIELD);
      return;
    }
  return;
}

void
do_wrathofgaia (CHAR_DATA * ch, char *argument)
{
  char arg[MIL];
  char buf[MSL];
  int dam = 0, max = 0, stat = 0, cost = 0;
  int dam2 = 0, race = 0;
  CHAR_DATA *victim;

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

      if (get_tribe (ch, TRIBE_CHILDREN_OF_GAIA) < 10)
	{
	  stc
	    ("You require level 10 Children of Gaia to call on the Wrath of Gaia.\n\r",
	     ch);
	  return;
	}
    }

  race = ch->race;
  if (race < 1)
    race = 1;

  stat = ch->mana / 10000;
  if (stat < 1)
    stat = 1;

  dam = number_range (400, 850);
  dam *= stat;

  if (dam > 8000)
    {
      dam = 7500 + number_range (166, 999);
    }

  dam2 = number_range (250, 450);
  dam2 *= race;

  if (dam2 > 3000)
    {
      dam2 = 2500 + number_range (166, 799);
    }

  max = number_fuzzy (ch->pcdata->rank);
  if (max < 1)
    max = 1;

  cost = 5000;
  cost *= max;

  if (IS_ITEMAFF (ch, ITEMA_PEACE))
    do_majesty (ch, "");

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Whom shall face the Wrath of Gaia?\n\r", ch);
      return;
    }

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

  if (ch->mana < cost)
    {
      act
	("You do not have the Mystical Power to call down the Wrath of Gaia upon $N.",
	 ch, NULL, victim, TO_CHAR);
      if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
	{
	  guardian_message (victim);
	  act ("$n just failed to call down the Wrath of Gaia upon you.", ch,
	       NULL, victim, TO_VICT);
	}
      return;
    }


  if (is_safe (ch, victim))
    {
      if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
	{
	  guardian_message (victim);
	  act ("$n just failed to call down the Wrath of Gaia upon you.", ch,
	       NULL, victim, TO_VICT);
	}
      return;
    }

  if (ch == victim)
    {
      send_to_char ("Now that would be just plain stupid.\n\r", ch);
      return;
    }

  act ("A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM);
  if (IS_NPC (ch))
    sprintf (buf, "Face the Wrath of Gaia %s!",
	     capitalize (victim->short_descr));
  else
    sprintf (buf, "Face the Wrath of Gaia %s!", capitalize (victim->name));
  do_say (ch, buf);
  act
    ("#7A huge beam of light strikes $N from above.#n\n\r#7Then a geyser of flames erupts from the ground under $N's feet, engulfing $M in purifying fire.#n",
     ch, NULL, victim, TO_CHAR);
  act
    ("#7A huge beam of light strikes you from above.#n\n\r#7Then a geyser of flames erupts from the ground under your feet, engulfing you in purifying fire.#n",
     ch, NULL, victim, TO_VICT);
  act
    ("#7A huge beam of light strikes $N from above.#n\n\r#7Then a geyser of flames erupts from the ground under $N's feet, engulfing $M in purifying fire.#n",
     ch, NULL, victim, TO_NOTVICT);
  damage (ch, victim, dam, gsn_lightbeam, DAM_LIGHT, TRUE, FALSE, FALSE);
  sev_hit (ch, victim, dam2, gsn_gaiaflame, DAM_FIRE, max, TRUE, TRUE, FALSE);
  ch->mana -= cost;
  waiting (ch, 12);
  return;
}

void
do_soulblast (CHAR_DATA * ch, char *argument)
{
  char arg[MIL];
  CHAR_DATA *victim;
  int dam, souls, stat;
  argument = one_argument (argument, arg);
  if (!IS_NEPHANDI (ch) && !IS_LINKSYS (ch))
    {
      stc ("Huh?\n\r", ch);
      return;
    }
  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }
//dam = ch->damcap[DAM_CAP];
  stat = ch->max_hit / 1000;
  dam += stat;

  dam += number_range (1, 999);

  if (dam > 4000)
    dam = 3000 + number_range (199, 1399);

  if (IS_NPC (victim))
    dam *= 3;
  else
    dam *= 1.2;
  dam = 8000;
  souls = ch->pcdata->soulblast;
  damage (ch, victim, dam, gsn_soulblast, DAM_FIRE, TRUE, FALSE, FALSE);
  if (souls >= 6)
    damage (ch, victim, dam, gsn_soulblast, DAM_FIRE, TRUE, FALSE, FALSE);
  if (souls >= 9)
    damage (ch, victim, dam, gsn_soulblast, DAM_FIRE, TRUE, FALSE, FALSE);
  if (souls >= 12)
    damage (ch, victim, dam, gsn_soulblast, DAM_FIRE, TRUE, FALSE, FALSE);
  if (souls >= 15)
    damage (ch, victim, dam, gsn_soulblast, DAM_FIRE, TRUE, FALSE, FALSE);
  if (souls >= 17)
    damage (ch, victim, dam, gsn_soulblast, DAM_FIRE, TRUE, FALSE, FALSE);
  if (souls >= 21)
    damage (ch, victim, dam, gsn_soulblast, DAM_FIRE, TRUE, FALSE, FALSE);
  waiting (ch, 8);
  return;
}

Site Stats

Snippets: 1791
Codebases: 571