lander.c

demise/src/lander.c · 13.0 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 "merc.h"

void
do_hlgain (CHAR_DATA * ch, char *argument)
{
  int newgain = 0;
  int gainnum = number_range (1, 22);
  int hlpowers = 0;
  char power[MSL];

  if (IS_NPC (ch))
    return;

  if (!IS_HIGHLANDER (ch))
    return;

  if (IS_SET (ch->quickening, QUICKENING_STRENGTH))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_CHAOS))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_SENSE))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_WALKING))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_ILLUSION))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_BODY))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_SPEED))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_MIND))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_COMBAT))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_AFFAIRS))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_FLAME))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_MAGIC))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_REGEN))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_EXP))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_BERSERK))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_LIGHTNINGSTRIKE))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_LIMB))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_STRONGKICK))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_COLDKICK))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_SPEEDKICK))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_FIREAURA))
    hlpowers++;
  if (IS_SET (ch->quickening, QUICKENING_TRIPLE))
    hlpowers++;

  if (ch->quickcount != hlpowers)
    ch->quickcount = hlpowers;

  if (ch->quickcount >= 22)
    {
      send_to_char
	("You have already obtained as many powers as possible.\n\r", ch);
      return;
    }

  if (gainnum == 1)
    {
      newgain = QUICKENING_STRENGTH;
      sprintf (power,
	       "#wYour enhanced strength makes you do more damage in combat.#n\n\r");
    }
  else if (gainnum == 2)
    {
      newgain = QUICKENING_CHAOS;
      sprintf (power, "#wYou can summon a shield of chaos.#n\n\r");
    }
  else if (gainnum == 3)
    {
      newgain = QUICKENING_SENSE;
      sprintf (power, "#wYou can use shield, scry, and feelaura.#n\n\r");
    }
  else if (gainnum == 4)
    {
      newgain = QUICKENING_WALKING;
      sprintf (power, "#wYou can timewalk to mobs and players.#n\n\r");
    }
  else if (gainnum == 5)
    {
      newgain = QUICKENING_ILLUSION;
      sprintf (power,
	       "#wYou can form illusions of yourself and others.#n\n\r");
    }
  else if (gainnum == 6)
    {
      newgain = QUICKENING_BODY;
      sprintf (power, "#wYou take less damage in combat.#n\n\r");
    }
  else if (gainnum == 7)
    {
      newgain = QUICKENING_SPEED;
      sprintf (power,
	       "#wYour enhanced speed makes you hit more in combat.#n\n\r");
    }
  else if (gainnum == 8)
    {
      newgain = QUICKENING_MIND;
      sprintf (power,
	       "#wYou have iron concentration making you immune to the effects of pain.#n\n\r");
    }
  else if (gainnum == 9)
    {
      newgain = QUICKENING_COMBAT;
      sprintf (power, "#wYou have enhanced parry and dodge.#n\n\r");
    }
  else if (gainnum == 10)
    {
      newgain = QUICKENING_AFFAIRS;
      sprintf (power,
	       "#wYour immortal affairs stop people from fleeing#n.\n\r");
    }
  else if (gainnum == 11)
    {
      newgain = QUICKENING_FLAME;
      sprintf (power, "#wYou can counter your opponents in combat.#n\n\r");
    }
  else if (gainnum == 12)
    {
      newgain = QUICKENING_MAGIC;
      sprintf (power, "#wThe gods hides you from global attacks.#n\n\r");
    }
  else if (gainnum == 13)
    {
      newgain = QUICKENING_REGEN;
      sprintf (power, "#wYou regen faster then normal out of combat.#n\n\r");
    }
  else if (gainnum == 14)
    {
      newgain = QUICKENING_EXP;
      sprintf (power,
	       "#wThe gods grant you 20 percent more experience for killing monsters.#n");
    }
  else if (gainnum == 15)
    {
      newgain = QUICKENING_BERSERK;
      sprintf (power,
	       "#wYour mastery over the art of battle grants you a better berserk.#n\n\r");
    }
  else if (gainnum == 16)
    {
      newgain = QUICKENING_LIGHTNINGSTRIKE;
      sprintf (power,
	       "#wYou can launch devastating lightning slash follow up attacks.#n\n\r");
    }
  else if (gainnum == 17)
    {
      newgain = QUICKENING_LIMB;
      sprintf (power, "#wYour limbs regrow twice as fast.#n\n\r");
    }
  else if (gainnum == 18)
    {
      newgain = QUICKENING_STRONGKICK;
      sprintf (power,
	       "#wYour legs are exceptionaly strong, making you kick harder.#n\n\r");
    }
  else if (gainnum == 19)
    {
      newgain = QUICKENING_COLDKICK;
      sprintf (power,
	       "#wYour feet are surrounded by a cold blue nimbus, freezing everything you kick.#n\n\r");
    }
  else if (gainnum == 20)
    {
      newgain = QUICKENING_SPEEDKICK;
      sprintf (power, "#wYour kicks are lightning quick.#n\n\r");
    }
  else if (gainnum == 21)
    {
      newgain = QUICKENING_FIREAURA;
      sprintf (power, "#wYou are surrounded by an aura of flame.#n\n\r");
    }
  else if (gainnum == 22)
    {
      newgain = QUICKENING_TRIPLE;
      sprintf (power,
	       "#wYour prowess in battle have improved, letting you strike several times with each attack.#n\n\r");
    }
  if (IS_SET (ch->quickening, newgain))
    {
      do_hlgain (ch, "");
      return;
    }

  SET_BIT (ch->quickening, newgain);
  ch->quickcount += 1;
  send_to_char ("You got a new power!\n\r", ch);
  stc (power, ch);
  save_char_obj (ch);
  if (newgain == QUICKENING_COLDKICK)
    {
      stc ("A blue nimbus suddenly envelops your feet.\n\r", ch);
      act ("A blue nimbus suddenly envelops $n's feet.", ch, NULL, NULL,
	   TO_ROOM);
    }
  return;
}


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

  one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

  if (!IS_HL (ch))
    {
      send_to_char ("Huh?\n\r", ch);
      return;
    }
  if (!IS_SET (ch->quickening, QUICKENING_WALKING))
    {
      send_to_char ("You do not have this skill!\n\r", ch);
      return;
    }

  if (ch->fight_timer > 0)
    {
      send_to_char ("Not until your fight timer expires.\n\r", ch);
      return;
    }

  if (arg[0] == '\0')
    {
      send_to_char ("Time walk to who?\n\r", ch);
      return;
    }
  if (ch->position == POS_FIGHTING)
    {
      send_to_char ("No way! You are fighting.\n\r", ch);
      return;
    }
  if ((victim = get_char_world (ch, arg)) == NULL)
    {
      send_to_char ("Nobody by that name.\n\r", ch);
      return;
    }
  if (is_inarena (victim))
    return;
  if (is_inarena (ch))
    return;
  if (travelsafe (ch, victim))
    return;

  if (victim->in_room == NULL || victim->in_room == ch->in_room)
    {
      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_IMMUNE (victim, IMM_SUMMON) && !IS_NPC (victim))
    {
      send_to_char ("They do not wish to be walked to.\n\r", ch);
      return;
    }

  if (ch == victim)
    {
      send_to_char ("Not on yourself!\n\r", ch);
      return;
    }

  act ("You walk through a time rift", ch, NULL, NULL, TO_CHAR);
  act ("$n walks through a time rift.", ch, NULL, NULL, TO_ROOM);
  char_from_room (ch);
  char_to_room (ch, get_room_index (victim->in_room->vnum));
  act ("You land in front of $N", ch, NULL, victim, TO_CHAR);
  act ("$n lands in front of $N.", ch, NULL, victim, TO_ROOM);
  do_look (ch, "auto");
  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_hlpowers (CHAR_DATA * ch, char *argument)
{

  if (IS_NPC (ch))
    return;
  if (!IS_HIGHLANDER (ch))
    {
      stc ("Huh?\n\r", ch);
      return;
    }

  stc (" #y               Highlander Powers#n\n\r", ch);
  stc ("#g------------------------------------------------------#n\n\r", ch);
  if (IS_SET (ch->quickening, QUICKENING_STRENGTH))
    {
      stc
	("#wYour enhanced strength makes you do more damage in combat.#n\n\r",
	 ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_CHAOS))
    {
      stc ("#wYou can summon a shield of chaos.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_SENSE))
    {
      stc ("#wYou can use shield, scry, and feelaura.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_WALKING))
    {
      stc ("#wYou can timewalk to mobs and players.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_ILLUSION))
    {
      stc ("#wYou can form illusions of yourself and others.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_BODY))
    {
      stc ("#wYou take less damage in combat.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_FLAME))
    {
      stc ("#wYou can counter your opponents in combat.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_MIND))
    {
      stc
	("#wYou have iron concentration making you immune to the effects of pain.#n\n\r",
	 ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_COMBAT))
    {
      stc ("#wYou have enhanced parry and dodge.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_AFFAIRS))
    {
      stc ("#wYour immortal affairs stop people from fleeing#n.\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_SPEED))
    {
      stc ("#wYour enhanced speed makes you hit more in combat.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_MAGIC))
    {
      stc ("#wThe gods hides you from global attacks.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_REGEN))
    {
      stc ("#wYou regen faster then normal out of combat.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_EXP))
    {
      stc
	("#wThe gods grant you 20 percent more experience for killing monsters.#n\n\r",
	 ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_BERSERK))
    {
      stc
	("#wYour mastery over the art of battle grants you a better berserk.#n\n\r",
	 ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_LIGHTNINGSTRIKE))
    {
      stc
	("#wYou can launch devastating lightning slash follow up attacks.#n\n\r",
	 ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_LIMB))
    {
      stc ("#wYour limbs regrow twice as fast.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_STRONGKICK))
    {
      stc
	("#wYour legs are exceptionaly strong, making you kick harder.#n\n\r",
	 ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_SPEEDKICK))
    {
      stc ("#wYour kicks are lightning quick.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_COLDKICK))
    {
      stc
	("#wYour feet are surrounded by a cold blue nimbus, freezing everything you kick.#n\n\r",
	 ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_FIREAURA))
    {
      stc ("#wYou are surrounded by an aura of fire.#n\n\r", ch);
    }
  if (IS_SET (ch->quickening, QUICKENING_TRIPLE))
    {
      stc
	("#wYour prowess in battle have improved, letting you strike several times with each attack.#n\n\r",
	 ch);
    }

  if (ch->quickcount == 0)
    {
      stc ("#wYou do not have any quickening powers.#n\n\r", ch);
    }
  stc ("#g------------------------------------------------------#n\n\r", ch);

  return;
}


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

  if (!IS_HIGHLANDER (ch))
    {
      stc ("Huh ?\n\r", ch);
      return;
    }

  if (!IS_SET (ch->quickening, QUICKENING_FLAME))
    {
      stc ("Huh ?\n\r", ch);
      return;
    }

  if (IS_SET (ch->xbits, X_SHIELD_FLAMES))
    {
      stc ("You stop countering your opponents.\n\r", ch);
      REMOVE_BIT (ch->xbits, X_SHIELD_FLAMES);
      return;
    }

  stc ("You start countering you opponenets attacks\n\r", ch);
  SET_BIT (ch->xbits, X_SHIELD_FLAMES);
  return;
}

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


  if (!IS_CREATOR (ch))
    {
      if (!IS_HIGHLANDER (ch) && !IS_BETRAYER (ch))
	{
	  stc ("Huh!?\n\r", ch);
	  return;
	}

      if (IS_HIGHLANDER (ch))
	{
	  if (IS_HIGHLANDER (ch)
	      && !IS_SET (ch->quickening, QUICKENING_CHAOS))
	    {
	      stc ("Huh!\n\r", ch);
	      return;
	    }
	}
    }

  if (IS_SET (ch->itemaffect, ITEMA_CHAOSSHIELD))
    {
      REMOVE_BIT (ch->itemaffect, ITEMA_CHAOSSHIELD);
      stc ("The swirling shield of chaos around you fades.\n\r", ch);
      act ("The swirling shield of chaos around $n fades.", ch, NULL, NULL,
	   TO_ROOM);
      return;
    }



  SET_BIT (ch->itemaffect, ITEMA_CHAOSSHIELD);
  send_to_char ("You are surrounded by a swirling shield of chaos.\n\r", ch);
  act ("$n is surrounded by a swirling shield of chaos.", ch, NULL, NULL,
       TO_ROOM);
  return;

}

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


  return;
}

Site Stats

Snippets: 1791
Codebases: 571