newstuff.c

demise/src/newstuff.c · 28.5 KB

From the archive dodbackup-final.tar.gz

Download the archive   « Back to the archive contents

/***************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this Merc Diku Mud, you must comply with   *
 *  both the original Diku license in 'license.doc' as well the Merc       *
 *  license in 'license.txt'.  In particular, you may not remove either of *
 *  these copyright notices.                                               *
 *                                                                         *
 *  Much time and thought has gone into this software and you are          *
 *  benefitting.  We hope that you share your changes too.  What goes      *
 *  around, comes around.                                                  *
 ***************************************************************************/

/***************************************************************************
 *  God Wars Mud improvements copyright (C) 1994, 1995, 1996 by Richard    *
 *  Woolcock.  This mud is NOT to be copied in whole or in part, or to be  *
 *  run without the permission of Richard Woolcock.  Nobody else has       *
 *  permission to authorise the use of this code.                          *
 ***************************************************************************/

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

int is_allocated_assist = 0;
ASSIST_DATA *global_assist;
void send_to_immortals args ((char *stosend));

//void  activate_armageddon   args (( void ));
//void  armageddoninfo        args (( char *argument ));

/*
 * Ok, some of, or most stuff in here aint mine, but it just is stuff
 * that is needed, ok?? :)
 */

void
pop_off_list (ASSIST_DATA * alist, char *popname)
{
  ASSIST_DATA *current;

  if (!is_allocated_assist)
    {
      return;
    }

  for (current = alist; current != NULL; current = current->next)
    {
      if (current->name == NULL || current->name[0] == '\0')
	continue;

      if (!str_cmp (current->name, popname))
	{
	  if (current->prev != NULL)
	    current->prev->next = current->next;
	  if (current->next != NULL)
	    current->next->prev = current->prev;
	  free_string (current->name);
	  free_string (current->problem);
	  free (current);
	  return;
	}
    }
}

int
is_on_list (ASSIST_DATA * alist, char *chname)
{
  ASSIST_DATA *current;

  if (!is_allocated_assist)
    return 0;
  if (alist == NULL)
    return 0;

  for (current = alist; current != NULL; current = current->next)
    {
      if (current->name == NULL || current->name[0] == '\0')
	continue;

      if (!str_cmp (current->name, chname))
	{
	  return 1;
	}
    }
  return 0;
}

ASSIST_DATA *
push_on_list (ASSIST_DATA * alist, char *pushname, char *problem)
{
  ASSIST_DATA *start, *current;

  if (pushname == NULL || problem == NULL || pushname[0] == '\0'
      || problem[0] == '\0')
    {
      return alist;
    }

  if (!is_allocated_assist)
    {
      alist = (ASSIST_DATA *) malloc (sizeof (ASSIST_DATA));
      alist->next = NULL;
      alist->prev = NULL;
      alist->name = str_dup ("");
      alist->problem = str_dup ("");
      is_allocated_assist = 1;
    }
  current = alist;
  start = alist;

  while (current->next != NULL)
    current = current->next;

  current->next = (ASSIST_DATA *) malloc (sizeof (ASSIST_DATA));
  current->next->prev = current;
  current->next->next = NULL;
  current->next->name = str_dup (pushname);
  current->next->problem = str_dup (problem);

  return start;
}

void
do_request (CHAR_DATA * ch, char *argument)
{
  char buf[MIL];

  if (IS_NPC (ch))
    return;
  if (IS_IMMORTAL (ch))
    {
      send_to_char
	("This is for Mortals to request help from Immortals.... why are you typing it ?.\r\n",
	 ch);
      return;
    }

  if (argument[0] == '\0')
    {
      send_to_char
	("What would you like immortal assistance with?\r\nType request <brief description of problem>.\r\n",
	 ch);
      return;
    }

  if (is_on_list (global_assist, ch->name))
    {
      send_to_char
	("But you have already submitted a request for immortal assistance!\r\n",
	 ch);
      return;
    }

  global_assist = push_on_list (global_assist, ch->name, argument);
  send_to_char
    ("Okay, your request for immortal assistance has been submitted.\r\n",
     ch);
  send_to_char
    ("An immortal should be with you to respond to your request briefly.\r\n",
     ch);

  sprintf (buf, "#y[#nHelp Request from %s - %s#y]#n\r\n", ch->name,
	   argument);
  send_to_immortals (buf);
}

void
send_to_immortals (char *str_to_send)
{
  DESCRIPTOR_DATA *dstart;

  if (str_to_send == NULL || str_to_send[0] == '\0')
    return;

  for (dstart = descriptor_list; dstart != NULL; dstart = dstart->next)
    {
      if (dstart->connected == CON_PLAYING)
	{
	  if (IS_IMMORTAL (dstart->character))
	    {
	      send_to_char (str_to_send, dstart->character);
	    }
	}
    }
}

void
do_service (CHAR_DATA * ch, char *argument)
{
  char arg[MIL];

  if (IS_NPC (ch))
    return;
  if (!IS_IMMORTAL (ch))
    return;

  argument = one_argument (argument, arg);

  if (arg == NULL || arg[0] == '\0')
    {
      send_to_char ("Who do you wish to remove from the queue?\r\n", ch);
      return;
    }
  if (!is_on_list (global_assist, arg))
    {
      send_to_char ("But they never requested immortal assistance!\r\n", ch);
      return;
    }
  else
    {
      pop_off_list (global_assist, arg);
      send_to_char ("Okay, you have removed them from the assist queue.\r\n",
		    ch);
    }
}

void
do_clearlist (CHAR_DATA * ch, char *argument)
{
  ASSIST_DATA *current;

  if (IS_NPC (ch))
    return;
  if (ch->level < 12)
    {
      send_to_char ("Only an implementor may destroy the assist queue.\r\n",
		    ch);
      return;
    }

  if (!is_allocated_assist)
    {
      send_to_char ("There is no assist queue to clear.\r\n", ch);
      return;
    }

  current = global_assist->next;
  while (current != NULL)
    {
      ASSIST_DATA *tmp;
      tmp = current->next;
      free_string (current->name);
      free_string (current->problem);
      free (current);
      current = tmp;
    }
  global_assist->next = NULL;
  send_to_char ("Immortal assistance queue destroyed.\r\n", ch);
  return;
}

void
do_viewalist (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  int counter = 0;
  ASSIST_DATA *current;

  if (IS_NPC (ch))
    return;
  if (!IS_IMMORTAL (ch))
    return;

  if (!is_allocated_assist)
    {
      sprintf (buf, "Rank   Player Name     Problem Description \r\n");
      send_to_char (buf, ch);
      return;
      sprintf (buf, "---- --------------- -----------------------\r\n");
      send_to_char (buf, ch);
      return;
    }
  if (global_assist == NULL)
    {
      send_to_char ("Hrmmmm... more bug...\r\n", ch);
      return;
    }

  sprintf (buf, "Rank       Player Name     Problem Description  \r\n");
  send_to_char (buf, ch);
  sprintf (buf, "----     --------------- -----------------------\r\n");
  send_to_char (buf, ch);
  for (current = global_assist->next; current != NULL;
       current = current->next)
    {
      sprintf (buf, "[%-2d]     %-15s [%s]\r\n", ++counter, current->name,
	       current->problem);
      send_to_char (buf, ch);
    }
}

void
do_delete (CHAR_DATA * ch, char *argument)
{
  char strsave[MIL];
  char strsave1[MIL];
  char strsave2[MIL];
  char strsave3[MIL];
  char strsave4[MIL];
  char strsave5[MIL];
  char arg[MIL];
  char buf[MSL];
  char *pArg;


  if (IS_NPC (ch))
    return;
  {
    pArg = arg;
    while (*argument == ' ')
      argument++;
    while (*argument != '\0')
      {
	if (*argument == ' ')
	  {
	    argument++;
	    break;
	  }
	*pArg++ = *argument++;
      }
    *pArg = '\0';
  }

  if (IS_IMMORTAL (ch))
    {
      stc ("You are an imm... you can't delete yourself.\n\r", ch);
      return;
    }

  if (arg[0] == '\0')
    {
      send_to_char ("Syntax: delete [password]\n\r", ch);
      send_to_char
	("   If you self delete, you will #RNOT#n get a reimburse\n\r", ch);
      send_to_char ("   Use this command very carefully.\n\r", ch);
      sprintf (buf, "%s is contemplating deletion.", ch->name);
      log_string (buf);
      return;
    }
  if (strcmp (crypt (arg, ch->pcdata->pwd), ch->pcdata->pwd))
    {
      send_to_char ("Wrong Password, wait 10 seconds.\n\r", ch);
      waiting (ch, 40);
      sprintf (buf, "%s tried to delete with the wrong pwd.", ch->name);
      log_string (buf);
      return;
    }
  clantable[clannum (ch)].members--;
  classtable[class_number (ch)].classed--;
  sprintf (buf, "#C%s#c has comitted selfdeletion!", ch->name);
  do_info (ch, buf);
  sprintf (strsave, "%s%s.plr", PLAYER_DIR, capitalize (ch->name));
  sprintf (strsave1, "%s%s.plr", BACKUP_DIR1, capitalize (ch->name));
  sprintf (strsave2, "%s%s.plr", BACKUP_DIR2, capitalize (ch->name));
  sprintf (strsave3, "%s%s.plr", BACKUP_DIR3, capitalize (ch->name));
  sprintf (strsave4, "%s%s.plr", BACKUP_DIR4, capitalize (ch->name));
  sprintf (strsave5, "%s%s.plr", BACKUP_DIR5, capitalize (ch->name));
  sprintf (buf, "%s turns themself into line noise.", ch->name);
  log_string (buf);
  stop_fighting (ch, TRUE);
//  deletesave (ch);
  do_quit (ch, "");
  unlink (strsave);
  unlink (strsave1);
  unlink (strsave2);
  unlink (strsave3);
  unlink (strsave4);
  unlink (strsave5);
  return;
}

void
do_nuke (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char sex[MSL];
  char strsave[MIL];
  char strsave1[MIL];
  char strsave2[MIL];
  char strsave3[MIL];
  char strsave4[MIL];
  char strsave5[MIL];
  char arg[MIL];
  char buf[MSL];

  argument = one_argument (argument, arg);


  if (IS_NPC (ch))
    return;

  if (!str_cmp (ch->name, "Tijer"))
    {
      do_huh (ch, "");
      return;
    }

  if (arg[0] == '\0')
    {
      stc ("Who will feel your anger ?\n\r", ch);
      return;
    }

  if ((victim = find_char_mud (ch, arg)) == NULL)
    {
      stc ("Cant find a match to that description.\n\r", ch);
      return;
/*      if (!char_exists (FILE_PLAYER, argument))
        {
          send_to_char ("That player doesn't exist.\n\r", ch);
          return;
        }
      sprintf (buf, "#C%s#c releases an insidius computer virus.", ch->name);
      do_info (ch, buf);
      sprintf (buf, "#cSuddenly#C %s#c's pfile ceases to exist!", argument);
      do_info (ch, buf);

      sprintf (strsave, "%s%s.plr", PLAYER_DIR, capitalize (victim->name));
      sprintf (strsave1, "%s%s.plr", BACKUP_DIR1, capitalize (victim->name));
      sprintf (strsave2, "%s%s.plr", BACKUP_DIR2, capitalize (victim->name));
      sprintf (strsave3, "%s%s.plr", BACKUP_DIR3, capitalize (victim->name));
      sprintf (strsave4, "%s%s.plr", BACKUP_DIR4, capitalize (victim->name));
      sprintf (strsave5, "%s%s.plr", BACKUP_DIR5, capitalize (victim->name));
      sprintf (buf, "%s NUKES %s.", ch->name, victim->name);
      log_string (buf);
      unlink (strsave);
      unlink (strsave1);
      unlink (strsave2);
      unlink (strsave3);
      unlink (strsave4);
      unlink (strsave5);
      return;*/
    }

  if (victim == ch)
    {
      stc ("No Nuking your self.\n\r", ch);
      return;
    }

  if (IS_CREATOR (victim))
    {
      stc ("No you can't do that to my almighty master.\n\r", ch);
      return;
    }

  if (victim->level >= ch->level && !IS_XXX (ch, XXX_META))
    {
      stc ("No you can't do that.\n\r", ch);
      return;
    }

  if (victim->trust >= ch->trust && !IS_XXX (ch, XXX_META))
    {
      stc ("No you can't do that.\n\r", ch);
      return;
    }

  if (IS_XXX (ch, XXX_META) && IS_IMMORTAL (ch))
    return;
  if (victim->sex == 1)
    sprintf (sex, "he");
  else if (victim->sex == 2)
    sprintf (sex, "she");
  else
    sprintf (sex, "it");

  clantable[clannum (ch)].members--;
  classtable[class_number (ch)].classed--;
  sprintf (buf, "#C%s#c launches a guided nuclear missile.", ch->name);
  do_info (victim, buf);
  sprintf (buf,
	   "#cSuddenly#C %s#c, erupts in a ball of flame and gore, disintegrating where %s stands!",
	   victim->name, sex);
  do_info (victim, buf);
  if (!IS_IMMORTAL (victim))
    {
      if (victim->mkill < 5)
	{
	  do_quit (victim, "");
	  return;
	}
    }
  sprintf (strsave, "%s%s.plr", PLAYER_DIR, capitalize (victim->name));
  sprintf (strsave1, "%s%s.plr", BACKUP_DIR1, capitalize (victim->name));
  sprintf (strsave2, "%s%s.plr", BACKUP_DIR2, capitalize (victim->name));
  sprintf (strsave3, "%s%s.plr", BACKUP_DIR3, capitalize (victim->name));
  sprintf (strsave4, "%s%s.plr", BACKUP_DIR4, capitalize (victim->name));
  sprintf (strsave5, "%s%s.plr", BACKUP_DIR5, capitalize (victim->name));
  sprintf (buf, "%s NUKES %s.", ch->name, victim->name);
  log_string (buf);
  stop_fighting (victim, TRUE);
  victim->fight_timer = 0;
  if (IS_XXX (ch, XXX_META))
    SET_BIT (victim->xxxbits, XXX_META);
  nukesave (victim);
  do_quit (victim, "");
  unlink (strsave);
  unlink (strsave1);
  unlink (strsave2);
  unlink (strsave3);
  unlink (strsave4);
  unlink (strsave5);
  return;
}

void
do_fakenuke (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char sex[MSL];
  char arg[MIL];
  char buf[MSL];
  char name[MIL];

  argument = one_argument (argument, arg);


  if (IS_NPC (ch))
    return;

  if (arg[0] == '\0')
    {
      stc ("Who will feel your anger ?\n\r", ch);
      return;
    }

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

  if (victim == ch)
    {
      stc ("No Fake Nuking your self.\n\r", ch);
      return;
    }

  if (IS_CORIM (victim))
    {
      stc ("No you can't do that to my almighty master.\n\r", ch);
      return;
    }

  if (!IS_CORIM (ch))
    {
      if (victim->level >= ch->level)
	{
	  stc ("No you can't do that.\n\r", ch);
	  return;
	}

      if (victim->trust >= ch->trust)
	{
	  stc ("No you can't do that.\n\r", ch);
	  return;
	}
    }

  if (victim->sex == 1)
    sprintf (sex, "he");
  else if (victim->sex == 2)
    sprintf (sex, "she");
  else
    sprintf (sex, "it");
  sprintf (name, "%s", victim->name);

  sprintf (buf, "#C%s#c launches a guided nuclear missile.", ch->name);
  do_info (victim, buf);
  sprintf (buf,
	   "#cSuddenly#C %s#c, erupts in a ball of flame and gore, disintegrating where %s stands!",
	   victim->name, sex);
  do_info (victim, buf);
  if (!IS_IMMORTAL (victim))
    {
      if (victim->mkill < 5)
	{
	  do_quit (victim, "");
	  return;
	}
    }
  sprintf (buf, "%s NUKES %s.", ch->name, victim->name);
  log_string (buf);
  stop_fighting (victim, TRUE);
  victim->fight_timer = 0;
  do_quit (victim, "");
  sprintf (buf, "%s Fake Nuked %s.", ch->name, name);
  log_string (buf);
  return;
}

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


  if (IS_NPC (ch))
    return;
  {
    pArg = arg;
    while (*argument == ' ')
      argument++;
    while (*argument != '\0')
      {
	if (*argument == ' ')
	  {
	    argument++;
	    break;
	  }
	*pArg++ = *argument++;
      }
    *pArg = '\0';
  }

  if (!IS_NEWBIE (ch))
    {
      send_to_char ("Huh?\n\r", ch);
      return;
    }
  if (arg[0] == '\0')
    {
      send_to_char ("Syntax: pkready [password]\n\r", ch);
      send_to_char
	("If you use this command, your hours will not be set back to newbie, and you\n\rwill lose your newbie benefits.\n\r",
	 ch);
      return;
    }
  if (strcmp (crypt (arg, ch->pcdata->pwd), ch->pcdata->pwd))
    {
      send_to_char ("Wrong Password.\n\r", ch);
      return;
    }
  sprintf (buf,
	   "#C%s#c has chosen to give up their newbie time and is ready for playerkilling!",
	   ch->name);
  do_info (ch, buf);
  sprintf (buf, "%s has given up their newbie time.", ch->name);
  log_string (buf);
  ch->played = 21600;
  do_autosave (ch, "");
  return;
}

void
armageddoninfo (char *argument)
{
  CHAR_DATA *vch;
  char buf[MSL];

  if (argument[0] == '\0')
    return;

  for (vch = char_list; vch != NULL; vch = vch->next)
    {
      if (IS_NPC (vch))
	continue;
      sprintf (buf, "#g<[#0Ar#7ma#0ge#7dd#0on#g]>#7 %s\n\r", argument);
      send_to_char (buf, vch);
    }
  return;
}

void
activate_armageddon (int prize)
{
  char buf[MSL];

  sprintf (buf, "Armageddon has been activated!");
  armageddoninfo (buf);
  SET_BIT (mudconfig->world_affects, WORLD_ARMAGEDDON);
  mudconfig->bounty = prize;
  return;
}

void
deactivate_armageddon ()
{
  DESCRIPTOR_DATA *d;
  CHAR_DATA *victim;

  armageddoninfo
    ("Peace has descended to this realm again! Armageddon is deactivated.");
  REMOVE_BIT (mudconfig->world_affects, WORLD_ARMAGEDDON);
  mudconfig->armtimer = 1800;
  mudconfig->bounty = 0;
  for (d = descriptor_list; d != NULL; d = d->next)
    {
      if (d->connected != CON_PLAYING)
	continue;
      if ((victim = d->character) == NULL)
	continue;
      if (IS_NPC (victim))
	continue;

      if (victim->fighting != NULL)
	stop_fighting (victim, TRUE);

      do_restore (victim, "self");
      REMOVE_BIT (victim->extra, TIED_UP);
      REMOVE_BIT (victim->extra, GAGGED);
      REMOVE_BIT (victim->extra, BLINDFOLDED);
      if (IS_NYM (victim, NYM_NOTSAFE))
	{
	  REMOVE_BIT (victim->nymbits, NYM_NOTSAFE);
	}
      if (has_fighttimer (victim))
	victim->fight_timer = 0;
    }
  return;
}

void
do_armageddon (CHAR_DATA * ch, char *argument)
{
  int value;

  if (IS_NPC (ch))
    return;

  if (argument[0] == '\0')
    {
      send_to_char ("Armageddon <bounty/deactivate>\n\r", ch);
      return;
    }

  if (str_cmp (argument, "deactivate") && !is_number (argument))
    {
      send_to_char ("Either deactivate it or use a digit.\n\r", ch);
      return;
    }

  if (!str_cmp (argument, "deactivate"))
    {
      deactivate_armageddon ();
      send_to_char ("Ok.\n\r", ch);
      return;
    }

  value = atoi (argument);

  if (IS_SET (mudconfig->world_affects, WORLD_ARMAGEDDON))
    {
      stc ("Armageddon is already active.\n\r", ch);
      return;
    }

  if (!IS_SET (mudconfig->world_affects, WORLD_ARMAGEDDON))
    {
      activate_armageddon (value);
      mudconfig->pkcounter = number_range (5, 10);
    }
  send_to_char ("Ok.\n\r", ch);
  return;
}

void
do_trainmode (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];

  if (IS_NPC (ch))
    return;

  if (!IS_SET (ch->corbits, COR_TRAINMODE))
    {
      sprintf (buf, "#C%s#c is now in training mode!#n", ch->name);
      do_info (ch, buf);
      SET_BIT (ch->corbits, COR_TRAINMODE);
      do_save (ch, "");
      return;
    }

  REMOVE_BIT (ch->corbits, COR_TRAINMODE);
  sprintf (buf, "#C%s#c is no longer in training mode!#n", ch->name);
  do_info (ch, buf);
  do_save (ch, "");
  return;
}

void
do_fixwws (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  CHAR_DATA *victim;

  if (IS_NPC (ch))
    return;

  if (argument[0] == '\0')
    {
      stc ("Fix whom?\n\r", ch);
      return;
    }

  victim = get_char_world (ch, argument);

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

  do_unwerewolf (victim, "");
  sprintf (buf, "%s should be fucken fixed.\n\r", victim->name);
  send_to_char (buf, ch);
  do_save (victim, "");
  return;
}

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


  do_help (ch, "codecredits");
  SET_BIT (ch->corbits, COR_CREDIT);
  return;
}

void
do_topxp (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  CHAR_DATA *vch;
  CHAR_DATA *top[5];
  DESCRIPTOR_DATA *d;
  int i;
  bool showme;
  int players = 0;

  if (IS_NPC (ch))
    return;

  send_to_char ("Counting only online players:\n\r", ch);
  for (i = 0; i < 5; i++)
    top[i] = NULL;
  for (i = 0; i < 5; i++)
    {
      for (d = descriptor_list; d != NULL; d = d->next)
	{
	  if (d->connected != CON_PLAYING)
	    continue;
	  if ((vch = d->character) == NULL)
	    continue;
	  if (IS_IMMORTAL (vch))
	    continue;
	  if (!strcmp (vch->name, "SuoMarte"))
	    continue;
	  players++;
	  if (top[i] == NULL
	      || vch->pcdata->score[SCORE_TOTAL_XP] >
	      top[i]->pcdata->score[SCORE_TOTAL_XP])
	    {
	      if (top[0] == vch)
		continue;
	      if (top[1] == vch)
		continue;
	      if (top[2] == vch)
		continue;
	      if (top[3] == vch)
		continue;
	      top[i] = vch;
	    }
	}
    }
  players = UMIN (players, 5);
  for (i = 0; i < players; i++)
    if (top[i] == NULL)
      top[i] = ch;

  for (i = 0; i < players; i++)
    {
      sprintf (buf,
	       "  %d: #R%-12s#n with #7%d#n XP and #7%d#n earnt Credits.\n\r",
	       i + 1, top[i]->name, top[i]->pcdata->score[SCORE_TOTAL_XP],
	       top[i]->pcdata->score[SCORE_QUEST]);
      send_to_char (buf, ch);
    }
  showme = TRUE;
  for (i = 0; i < players; i++)
    if (top[i] == ch)
      showme = FALSE;
  if (showme)
    {
      sprintf (buf,
	       "You: #R%-12s#n with #7%d#n XP and #7%d#n earnt Credits.\n\r",
	       ch->name, ch->pcdata->score[SCORE_TOTAL_XP],
	       ch->pcdata->score[SCORE_QUEST]);
      send_to_char (buf, ch);
    }
}

void
do_delevel (CHAR_DATA * ch, char *argument)
{
  char arg[MSL];

  one_argument (argument, arg);

  if (IS_XXX (ch, XXX_SE))
    {
      REMOVE_BIT (ch->xxxbits, XXX_SE);
      stc ("You delevel to your normal unprivlaged self.\n\r", ch);
      return;
    }
  if (IS_IMMORTAL (ch))
    {
      if (!str_cmp (arg, "mage"))
	{
	  ch->level = 6;
	  ch->trust = 6;
	  send_to_char ("You delevel to Mage.\n\r", ch);
	}
      else if (!str_cmp (arg, "mortal"))
	{
	  ch->level = 2;
	  ch->trust = 0;
	  send_to_char ("You delevel to Mortal.\n\r", ch);
	}
      else if (!str_cmp (arg, "avatar"))
	{
	  ch->level = 3;
	  ch->trust = 0;
	  send_to_char ("You delevel to Avatar.\n\r", ch);
	}
      else
	{
	  send_to_char ("Level being one of:\n\r", ch);
	  send_to_char ("  mage, avatar, mortal\n\r", ch);
	}
    }
  else
    {
      do_huh (ch, "");
    }
  return;
}

void
do_omni (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  DESCRIPTOR_DATA *d;

  if (IS_NPC (ch))
    return;

  stc ("\n\r", ch);
  stc
    ("        Name| Level | Trust | Class | Gen |  Hit  |  Mana |  Move |    HR|    DR|     AC| Credits |Status\n\r",
     ch);
  stc
    ("------------|-------|-------|-------|-----|-------|-------|-------|------|------|-------|---------|------\n\r",
     ch);
  for (d = descriptor_list; d != NULL; d = d->next)
    {
      CHAR_DATA *wch;

      if (d->connected != CON_PLAYING)
	continue;
      wch = (d->original != NULL) ? d->original : d->character;
      if (wch->level >= LEVEL_IMMORTAL)
	continue;

      sprintf (buf,
	       "%12s|%7d|%7d|%7d|%5d|%7d|%7d|%7d|%6d|%6d|%7d|%9d|%6d\n\r",
	       wch->name, wch->level, wch->trust, wch->class, wch->vampgen,
	       wch->max_hit, wch->max_mana, wch->max_move, char_hitroll (wch),
	       char_damroll (wch), char_ac (wch), wch->pcdata->quest,
	       wch->race);
      send_to_char (buf, ch);
    }
  return;
}

/*
void do_forge(CHAR_DATA *ch, char *argument)
{
    int bit;
    OBJ_DATA *obj;
    char buf[MSL];
    OBJ_DATA *first_obj;
    OBJ_DATA *second_obj;
    OBJ_DATA *result_obj;
    OBJ_INDEX_DATA *pObjIndex;
    char arg1[MSL];
    char arg2[MSL];
    long obj_vnum = 0;

    argument = one_argument(argument, arg1);
    argument = one_argument(argument, arg2);

    if (arg1[0] == '\0' || arg2[0] == '\0')
    {
	send_to_char("Forge <first piece> <second piece>\r\n", ch);
	return;
    }
    if ( ((first_obj = get_obj_carry(ch, arg1)) == NULL) ||
	 ((second_obj = get_obj_carry(ch, arg2)) == NULL) )
    {
	send_to_char("You do not have that item.\r\n", ch);
	return;
    }

    if (!IS_OBJ_STAT(first_obj, ITEM_TRIFORCE_ONE) &&
	  !IS_OBJ_STAT(second_obj, ITEM_TRIFORCE_TWO))
    {
	send_to_char("First find and forge the first and second part!\r\n", ch);
	return;
    }

    if (IS_OBJ_STAT(first_obj, ITEM_TRIFORCE_ONE) && IS_OBJ_STAT(first_obj, ITEM_TRIFORCE_TWO) && !IS_OBJ_STAT(second_obj, ITEM_TRIFORCE_THREE))
    {
	send_to_char("Now you need to find and forge the third part!\r\n", ch);
	return;
    }

    if ( ( pObjIndex = get_obj_index( OBJ_VNUM_PROTOPLASM ) ) == NULL )
    {
	send_to_char( "Error...missing object, please inform Corim.\n\r", ch );
	return;
    }

    if(IS_OBJ_STAT(first_obj, ITEM_TRIFORCE_ONE) && IS_OBJ_STAT(second_obj, ITEM_TRIFORCE_TWO))
    {
      extract_obj(first_obj);
      extract_obj(second_obj);
      obj = create_object( pObjIndex, 50 );
      obj->level = 1;
      obj->item_type = ITEM_TRIFORCE;
      obj_to_char(obj,ch);
      free_string( obj->name );
      obj->name = str_dup( "twopart triforce" );
      sprintf(buf,"#yA #ytr#oifor#yce#n");
      free_string( obj->short_descr );
      obj->short_descr = str_dup( buf );
      sprintf(buf,"A mysterious magical type of thing is here on the floor.");
      free_string( obj->description );
      obj->description = str_dup( buf );
      SET_BIT(obj->extra_flags, ITEM_TRIFORCE_ONE);
      SET_BIT(obj->extra_flags, ITEM_TRIFORCE_TWO);
      sprintf(buf, "#C%s#c has found all two pieces of the Triforce and forged them together!#n", ch->name);
	do_info(ch, buf);
	do_save(ch, "");
	return;
    }
    if(IS_OBJ_STAT(first_obj, ITEM_TRIFORCE_ONE) && IS_OBJ_STAT(first_obj, ITEM_TRIFORCE_TWO) && IS_OBJ_STAT(second_obj, ITEM_TRIFORCE_TWO))
    {
      extract_obj(first_obj);
      extract_obj(second_obj);
      obj = create_object( pObjIndex, 50 );
      obj->level = 1;
      obj->item_type = ITEM_TRIFORCE;
      obj_to_char(obj,ch);
      free_string( obj->name );
      obj->name = str_dup( "twopart triforce" );
      sprintf(buf,"#yA #ytr#oifor#yce#n");
      free_string( obj->short_descr );
      obj->short_descr = str_dup( buf );
      sprintf(buf,"A mysterious magical type of thing is here on the floor.");
      free_string( obj->description );
      obj->description = str_dup( buf );
      REMOVE_BIT(obj->extra_flags, ITEM_TRIFORCE_ONE);
      REMOVE_BIT(obj->extra_flags, ITEM_TRIFORCE_TWO);
      SET_BIT(obj->extra_flags, ITEM_TRIFORCE_ORIG);
      result_obj = create_object(pObjIndex, 50);
      sprintf(buf, "#C%s#c has found all three pieces of the Triforce and forged them together!#n", ch->name);
	do_info(ch, buf);
      switch( number_range(1, 3))
      {
	  default: bit = NYM_EXPMOD;
	  case 2: bit = NYM_QPMOD;
	  case 3: bit = NYM_HPMOD;
      }
      SET_BIT(ch->nymbits, bit);
	ch->tritimer = 300;
      do_save(ch, "");
      return;
    }
    return;
}
*/
void
do_releasetri (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];
  ROOM_INDEX_DATA *location;
  OBJ_INDEX_DATA *pObjIndex;
  OBJ_DATA *obj;

  if (IS_NPC (ch))
    return;

  if (argument[0] == '\0')
    {
      send_to_char ("Releasetri <one/two/three>\n\r", ch);
      return;
    }

  if (!str_cmp (argument, "one"))
    {
      obj = create_object (pObjIndex, 50);
      obj->level = 1;
      obj->item_type = ITEM_TRIFORCE;
      obj_to_char (obj, ch);
      free_string (obj->name);
      obj->name = str_dup ("triforce");
      sprintf (buf, "#yA #ytr#oifor#yce#n");
      free_string (obj->short_descr);
      obj->short_descr = str_dup (buf);
      sprintf (buf,
	       "A mysterious magical type of thing is here on the floor.");
      free_string (obj->description);
      obj->description = str_dup (buf);
      SET_BIT (obj->extra_flags, ITEM_TRIFORCE_ONE);
      send_to_char ("You create part one of the triforce!\n\r", ch);
      return;
    }
  else if (!str_cmp (argument, "two"))
    {
      obj = create_object (pObjIndex, 50);
      obj->level = 1;
      obj->item_type = ITEM_TRIFORCE;
      obj_to_char (obj, ch);
      free_string (obj->name);
      obj->name = str_dup ("triforce");
      sprintf (buf, "#yA #ytr#oifor#yce#n");
      free_string (obj->short_descr);
      obj->short_descr = str_dup (buf);
      sprintf (buf,
	       "A mysterious magical type of thing is here on the floor.");
      free_string (obj->description);
      obj->description = str_dup (buf);
      SET_BIT (obj->extra_flags, ITEM_TRIFORCE_TWO);
      send_to_char ("You create part two of the triforce!\n\r", ch);
      return;
    }
  else if (!str_cmp (argument, "one"))
    {
      obj = create_object (pObjIndex, 50);
      obj->level = 1;
      obj->item_type = ITEM_TRIFORCE;
      obj_to_char (obj, ch);
      free_string (obj->name);
      obj->name = str_dup ("triforce");
      sprintf (buf, "#yA #ytr#oifor#yce#n");
      free_string (obj->short_descr);
      obj->short_descr = str_dup (buf);
      sprintf (buf,
	       "A mysterious magical type of thing is here on the floor.");
      free_string (obj->description);
      obj->description = str_dup (buf);
      SET_BIT (obj->extra_flags, ITEM_TRIFORCE_THREE);
      send_to_char ("You create part three of the triforce!\n\r", ch);
      return;
    }
  else
    do_releasetri (ch, "");
  return;
}

Site Stats

Snippets: 1791
Codebases: 571