AwakeMUD-0.6Beta/doc/
AwakeMUD-0.6Beta/lib/
AwakeMUD-0.6Beta/lib/etc/
AwakeMUD-0.6Beta/lib/etc/pfiles/
AwakeMUD-0.6Beta/lib/fixer_data/
AwakeMUD-0.6Beta/lib/misc/
AwakeMUD-0.6Beta/lib/plrobjs/
AwakeMUD-0.6Beta/lib/plrobjs/A-E/
AwakeMUD-0.6Beta/lib/plrobjs/F-J/
AwakeMUD-0.6Beta/lib/plrobjs/K-O/
AwakeMUD-0.6Beta/lib/plrobjs/U-Z/
AwakeMUD-0.6Beta/lib/plrspells/A-E/
AwakeMUD-0.6Beta/lib/plrspells/F-J/
AwakeMUD-0.6Beta/lib/plrtext/A-E/
AwakeMUD-0.6Beta/lib/world/
AwakeMUD-0.6Beta/lib/world/mob/
AwakeMUD-0.6Beta/lib/world/obj/
AwakeMUD-0.6Beta/lib/world/qst/
AwakeMUD-0.6Beta/lib/world/shp/
AwakeMUD-0.6Beta/lib/world/wld/
AwakeMUD-0.6Beta/lib/world/zon/
/* ************************************************************************
*   File: spec_procs.c                                  Part of CircleMUD *
*  Usage: implementation of special procedures for mobiles/objects/rooms  *
*                                                                         *
*  All rights reserved.  See license.doc for complete information.        *
*                                                                         *
*  Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
*  CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.               *
************************************************************************ */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>

#include "structs.h"
#include "awake.h"
#include "utils.h"
#include "comm.h"
#include "interpreter.h"
#include "handler.h"
#include "db.h"
#include "spells.h"
#include "newmagic.h"
#include "house.h"
#include "time.h"

/*   external vars  */
extern const char *drinks[];
extern struct room_data *world;
extern struct zone_data *zone_table;
extern struct char_data *character_list;
extern struct descriptor_data *descriptor_list;
extern struct index_data *mob_index;
extern struct index_data *obj_index;
extern struct house_control_rec house_control[];
extern struct time_info_data time_info;
extern struct weather_data ewather_info;
extern const struct command_info cmd_info[];
extern int num_of_houses;
extern int top_of_zone_table;
extern int fixers_need_save;
extern int real_object(int);
extern int real_zone(int);
extern int return_general(int skill_num);
extern spell_a grimoire[];
extern train_t trainers[];
extern teach_t teachers[];
extern adept_t adepts[];
extern master_t masters[];
extern int rev_dir[];

/* extern functions */
void add_follower(struct char_data * ch, struct char_data * leader);
extern void perform_tell(struct char_data *ch, struct char_data *vict, char *arg);
extern void docwagon(struct char_data *ch);
extern void die(struct char_data * ch);
extern void affect_total(struct char_data * ch);
extern struct obj_data *get_first_credstick(struct char_data *ch, char *arg);
extern struct char_data *give_find_vict(struct char_data * ch, char *arg);
extern int perform_give(struct char_data * ch, struct char_data * vict, struct obj_data * obj);
extern int belongs_to(struct char_data *ch, struct obj_data *obj);
extern void old_obj_to_char(struct obj_data *, struct char_data *);
extern void reset_zone(int zone, int reboot);
extern int find_weapon_range(struct char_data *ch, struct obj_data *weapon);
extern int find_sight(struct char_data *ch);
bool memory(struct char_data *ch, struct char_data *vict);

ACMD(do_say);
ACMD(do_echo);
ACMD(do_time);

struct social_type {
  char *cmd;
  int next_line;
};

// object defines
#define GHOSTS_PAGER		13
#define SEATAC_TICKET		500
#define SEATTLE_TICKET		501
#define PARELL_DISK		13005
#define PARELL_PRINTOUT		13007
#define PHRODOS_PAGER		15005

// mob defines
#define TIM_ENCHANTER		1002
#define TROLL_BOUNCER		2112
#define MAGE_BOUNCER		2113
#define PARK_MUGGER		4003
#define BLACK_GUARD		4220
#define TZEENTCHS_GHOUL
#define DRACS_VAMPIRE

// room defines
#define RIFTS_LIBRARY		2
#define RUDE_MIRROR		3
#define FOOS_LAIR			4
#define DUNKS_TRAILER		13
#define PHRODOS_RECEPTION	18
#define FJS_WORKSHOP		19
#define GHOSTS_RECEPTION	20
#define CENTRAL_MATRIX_CPU	3100
#define MANSION_GATE		4059

// zone defines
#define ZONE_GROEZTA		42

// misc defines
#define NEWBIE_SKILL		5
#define NORMAL_MAX_SKILL	8
#define LEARNED_LEVEL		12
#define HOLY_GRAIL_MODE		1
#define INSULT_MODE		1
#define ESSENCE_COST		750

/* ********************************************************************
*  Special procedures for mobiles                                     *
******************************************************************** */

int spell_sort_info[MAX_SKILLS+1];
extern char *spells[];

void sort_spells(void)
{
  int a, b, tmp;

  /* initialize array */
  for (a = 1; a < MAX_SKILLS; a++)
    spell_sort_info[a] = a;

  /* Sort.  'a' starts at 1, not 0, to remove 'RESERVED' */
  for (a = 1; a < MAX_SKILLS - 1; a++)
    for (b = a + 1; b < MAX_SKILLS; b++)
      if (strcmp(spells[spell_sort_info[a]], spells[spell_sort_info[b]]) > 0) {
        tmp = spell_sort_info[a];
        spell_sort_info[a] = spell_sort_info[b];
        spell_sort_info[b] = tmp;
      }
}

char *how_good(int percent)
{
  static char buf[256];

   if (percent < 0)
      strcpy(buf, " (uh oh! you have a negative skill, please report!)");
   else if (percent == 0)
      strcpy(buf, " (not learned)");
   else if (percent == 1)
      strcpy(buf, " (awful)");
   else if (percent == 2)
      strcpy(buf, " (sloppy)");
   else if (percent == 3)
      strcpy(buf, " (average)");
   else if (percent == 4)
      strcpy(buf, " (above average)");
   else if (percent == 5)
      strcpy(buf, " (good)");
   else if (percent == 6)
      strcpy(buf, " (very good)");
   else if (percent == 7)
      strcpy(buf, " (distinguished)");
   else if (percent == 8)
      strcpy(buf, " (excellent)");
   else if (percent == 9)
      strcpy(buf, " (superb)");
   else if (percent == 10)
      strcpy(buf, " (learned)");
   else if (percent <= 20)
      strcpy(buf, " (amazing)");
   else if (percent <= 30)
      strcpy(buf, " (incredible)");
   else if (percent <= 40)
      strcpy(buf, " (unbelievable)");
   else if (percent <= 50)
      strcpy(buf, " (ludicrous)");
   else strcpy(buf, " (godly)");

  return (buf);
}

int max_ability(int i)
{
  if (i == SKILL_PERCEPTION)
    return 1;
  else if (i == SKILL_COMBAT_SENSE || i == SKILL_REFLEXES)
    return 3;
  else if (i == SKILL_KILL_HANDS)
    return 4;
  else if (i == SKILL_RESISTANCE)
    return 10;
  else return 0;
}

int ability_cost(int abil, int level)
{
  if (!level)
    return 0;

  switch(abil) {
    case SKILL_PERCEPTION:
      return 200;
    case SKILL_COMBAT_SENSE:
      return ((level * 100) + 100);
    case SKILL_REFLEXES:
      if (level == 1)
        return 100;
      else return (level * 200);
    case SKILL_KILL_HANDS:
      if (level < 3)
        return (level * 50);
      else if (level == 3)
        return 200;
      else return 400;
    case SKILL_RESISTANCE:
      return (level * 50);
  }
  return 0;
}

int racial_max(struct char_data *ch, int attrib)
{
  switch (GET_RACE(ch)) {
    case RACE_DWARF:
      if (attrib == BOD || attrib == WIL) return 7;
      if (attrib == STR) return 8;
      if (attrib == QUI || attrib == REA) return 5;
      return 6;
    case RACE_ELF:
      if (attrib == QUI) return 7;
      if (attrib == CHA) return 8;
      return 6;
    case RACE_HUMAN:
      return 6;
    case RACE_ORK:
      if (attrib == BOD) return 9;
      if (attrib == STR) return 8;
      if (attrib == CHA || attrib == INT || attrib == REA) return 5;
      return 6;
    case RACE_TROLL:
      if (attrib == BOD) return 11;
      if (attrib == STR) return 10;
      if (attrib == QUI || attrib == WIL) return 5;
      if (attrib == CHA || attrib == INT || attrib == REA) return 4;
      return 6;
  }
  return 0;
}

void attack_random_player(struct char_data *mob, struct char_data *boss)
{
  struct char_data *vict;
  int num = 0;

  for (vict = world[mob->in_room].people; vict; vict = vict->next_in_room)
    if (!IS_NPC(vict) && FIGHTING(vict) == boss)
      num++;

  num = MAX(1, num - 1);

  for (vict = world[mob->in_room].people; vict; vict = vict->next_in_room)
    if (!IS_NPC(vict) && FIGHTING(vict) == boss && !number(0, num)) {
      set_fighting(mob, vict);
      return;
    }
}

int summon_mob(struct char_data *ch, int vnum, int number)
{
  struct char_data *tch;
  int num = 0, rnum, total = 0;

  if (!ch || !FIGHTING(ch) || (rnum = real_mobile(vnum)) < 0)
    return 0;

  for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room)
    if (GET_MOB_VNUM(tch) == vnum && GET_POS(tch) > POS_SLEEPING &&
        !FIGHTING(tch)) {
      num++;
      total++;
      if (!MOB_FLAGGED(tch, MOB_AGGRESSIVE))
        set_fighting(tch, FIGHTING(ch));
      else attack_random_player(tch, ch);
    }

  number = MIN(number, mob_index[rnum].number - num);

  // since it's necessary, find and summon the mob(s)
  for (tch = character_list; tch && number > 0; tch = tch->next)
    if (GET_MOB_VNUM(tch) == vnum && ch->in_room != tch->in_room &&
        !FIGHTING(tch) && GET_POS(tch) > POS_SLEEPING) {
      number--;
      total++;
      act("You have been summoned by $N.", FALSE, tch, 0, ch, TO_CHAR);
      act("$n suddenly vanishes.", TRUE, tch, 0, 0, TO_ROOM);
      char_from_room(tch);
      char_to_room(tch, ch->in_room);
      act("$n has arrived.", TRUE, tch, 0, 0, TO_ROOM);
      if (!MOB_FLAGGED(tch, MOB_AGGRESSIVE))
        set_fighting(tch, FIGHTING(ch));
      else attack_random_player(tch, ch);
    }

  return total;
}

int load_mob(struct char_data *ch, int vnum, int number, char *message)
{
  struct char_data *mob;
  int i, rnum, total = 0;

  if (!ch || !FIGHTING(ch) || (rnum = real_mobile(vnum)) < 0)
    return 0;

  for (i = 0; i < number; i++)
    if ((mob = read_mobile(rnum, REAL))) {
      total++;
      char_to_room(mob, ch->in_room);
      act(message, TRUE, mob, 0, 0, TO_ROOM);
      if (!MOB_FLAGGED(mob, MOB_AGGRESSIVE))
        set_fighting(mob, FIGHTING(ch));
      else attack_random_player(mob, ch);
    }

  return total;
}

SPECIAL(teacher)
{
  struct char_data *master = (struct char_data *) me;
  int i, ind, max, skill_num;

  if (IS_NPC(ch) || !CMD_IS("practice") || !CAN_SEE(master, ch) || FIGHTING(ch) ||
      GET_POS(ch) < POS_STANDING)
    return FALSE;

  skip_spaces(&argument);

  for (ind = 0; teachers[ind].vnum != 0; ind++)
    if (teachers[ind].vnum == GET_MOB_VNUM(master))
      break;

  if (teachers[ind].vnum != GET_MOB_VNUM(master))
    return FALSE;

  if (GET_LEVEL(ch) >= LVL_LEGEND) {
    perform_tell(master, ch, "Go away.");
    return TRUE;
  }

  if (teachers[ind].type != NEWBIE && PLR_FLAGGED(ch, PLR_NEWBIE)) {
     do_say(master, "Go back to the newbie hall!", 0, 0);
     return TRUE;
  } /* else if (teachers[ind].type == NEWBIE && !PLR_FLAGGED(ch, PLR_NEWBIE)) {
    perform_tell(master, ch, "You have advanced beyond my teachings.");
    return TRUE;
  } */

  if (!PLR_FLAGGED(ch, PLR_NEWBIE) && GET_SKILL_POINTS(ch) != 0)
    GET_SKILL_POINTS(ch) = 0;

  if (!AWAKE(ch)) {
    send_to_char("You must be conscious to practice.\r\n", ch);
    return TRUE;
  }

  if (!*argument) {
    sprintf(buf, "Your teacher can teach you the following:\r\n");
    for (i = SKILL_STEALTH; i < MAX_SKILLS; i++)
      if (i == teachers[ind].s1 || i == teachers[ind].s2 || i == teachers[ind].s3 ||
          i == teachers[ind].s4 || i == teachers[ind].s5 || i == teachers[ind].s6 ||
	  i == teachers[ind].s7 || i == teachers[ind].s8 )
        sprintf(buf, "%s  %s\r\n", buf, spells[i]);
    if (GET_SKILL_POINTS(ch) > 0)
      sprintf(buf, "%s\r\nYou have %d points to use for skills.\r\n", buf,
              GET_SKILL_POINTS(ch));
    else sprintf(buf, "%s\r\nYou have %0.2f karma to use for skills.\r\n", buf,
            ((float)GET_KARMA(ch) / 100));
    send_to_char(buf, ch);
    return TRUE;
  }

  if ((teachers[ind].type == NEWBIE && GET_SKILL_POINTS(ch) <= 0 &&
      GET_KARMA(ch) <= 0) || (teachers[ind].type != NEWBIE && GET_KARMA(ch) <= 0)) {
    send_to_char("You do not seem to be able to practice now.\r\n", ch);
    return TRUE;
  }

  skill_num = find_skill_num(argument);

  if (skill_num < 1) {
    send_to_char("Your teacher doesn't seem to know anything about that subject.", ch);
    return TRUE;
  }

  if (skill_num != teachers[ind].s1 && skill_num != teachers[ind].s2 &&
      skill_num != teachers[ind].s3 && skill_num != teachers[ind].s4 &&
      skill_num != teachers[ind].s5 && skill_num != teachers[ind].s6 &&
      skill_num != teachers[ind].s7 && skill_num != teachers[ind].s8) {
     send_to_char("You teacher doesn't seem to know about that subject.\r\n", ch);
     return TRUE;
  }

  if (teachers[ind].type == NEWBIE)
    max = NEWBIE_SKILL;
  else if (teachers[ind].type == AMATEUR)
    max = NORMAL_MAX_SKILL;
  else if (teachers[ind].type == ADVANCED)
    max = LEARNED_LEVEL;
  else return FALSE;

  if (GET_SKILL(ch, skill_num) >= max) {
    perform_tell(master, ch, "You already know more than I can teach you in that area.");
    return TRUE;
  }

  if (return_general(skill_num) == skill_num) {
    if (GET_KARMA(ch) < MAX(100, ((GET_SKILL(ch, skill_num) + 1) * 200)) &&
        GET_SKILL_POINTS(ch) <= 0) {
      send_to_char("You don't have enough karma to improve that skill.\r\n", ch);
      return TRUE;
    }
    if (GET_NUYEN(ch) < MAX(1000, (GET_SKILL(ch, skill_num) * 5000)) &&
        teachers[ind].type != NEWBIE) {
      send_to_char(ch, "You can't afford the %d nuyen practice fee!\r\n",
                   MAX(1000, (GET_SKILL(ch, skill_num) * 5000)));
      return TRUE;
    }
    if (teachers[ind].type != NEWBIE)
      GET_NUYEN(ch) -= MAX(1000, (GET_SKILL(ch, skill_num) * 5000));
    if (GET_SKILL_POINTS(ch) > 0)
      GET_SKILL_POINTS(ch)--;
    else GET_KARMA(ch) -= MAX(100, ((GET_SKILL(ch, skill_num) + 1) * 200));
  } else if (GET_SKILL(ch, return_general(skill_num)) > 0 && !GET_SKILL(ch, skill_num)) {
    if (GET_KARMA(ch) < MAX(100, (int)((GET_SKILL(ch, return_general(skill_num)) + 1) *
        150)) && GET_SKILL_POINTS(ch) <= 0) {
      send_to_char("You don't have enough karma to concentrate in that skill.\r\n", ch);
      return TRUE;
    }
    if (GET_NUYEN(ch) < MAX(1000, (GET_SKILL(ch, return_general(skill_num)) * 5000)) &&
        teachers[ind].type != NEWBIE) {
      send_to_char(ch, "You can't afford the %d nuyen practice fee!\r\n",
                   MAX(1000, (GET_SKILL(ch, return_general(skill_num)) * 5000)));
      return TRUE;
    }
    send_to_char(teachers[ind].msg, ch);
    if (GET_SKILL_POINTS(ch) > 0)
      GET_SKILL_POINTS(ch)--;
    else GET_KARMA(ch) -=
            MAX(100, (int)((GET_SKILL(ch, return_general(skill_num)) + 1) * 150));
    if (teachers[ind].type != NEWBIE)
      GET_NUYEN(ch) -= MAX(1000, GET_SKILL(ch, return_general(skill_num)) * 5000);
    SET_SKILL(ch, skill_num, GET_SKILL(ch, return_general(skill_num)) + 1);
    if (GET_SKILL(ch, skill_num) >= max)
      send_to_char("You are now learned in that area.\r\n", ch);
    return TRUE;
  } else {
    if (GET_KARMA(ch) < MAX(100, (int)((GET_SKILL(ch, skill_num) + 1) * 150)) &&
        GET_SKILL_POINTS(ch) <= 0) {
      send_to_char("You don't have enough karma to improve that skill.\r\n", ch);
      return TRUE;
    }
    if (GET_NUYEN(ch) < MAX(1000, (GET_SKILL(ch, skill_num) * 5000)) &&
        teachers[ind].type != NEWBIE) {
      send_to_char(ch, "You can't afford the %d nuyen practice fee!\r\n",
                   MAX(1000, (GET_SKILL(ch, skill_num) * 5000)));
      return TRUE;
    }
    if (teachers[ind].type != NEWBIE)
      GET_NUYEN(ch) -= MAX(1000, (GET_SKILL(ch, skill_num) * 5000));
    if (GET_SKILL_POINTS(ch) > 0)
      GET_SKILL_POINTS(ch)--;
    else GET_KARMA(ch) -= MAX(100, (int)((GET_SKILL(ch, skill_num) + 1) * 150));
  }

  send_to_char(teachers[ind].msg, ch);

  SET_SKILL(ch, skill_num, GET_SKILL(ch, skill_num) + 1);
  if (skill_num == return_general(skill_num))
    for (i = SKILL_STEALTH; i < SKILL_PERCEPTION; i++)
      if (i != skill_num && return_general(i) == skill_num && GET_SKILL(ch, i) > 0 &&
          GET_SKILL(ch, i) <= LEARNED_LEVEL)
        SET_SKILL(ch, i, GET_SKILL(ch, i) + 1);

  if (GET_SKILL(ch, skill_num) >= max)
    send_to_char("You are now learned in that area.\r\n", ch);

  return TRUE;
}

SPECIAL(trainer)
{
  struct char_data *trainer = (struct char_data *) me;
  int i, ind, first = 1;

  if (!CMD_IS("train") || IS_NPC(ch) || !CAN_SEE(trainer, ch) || FIGHTING(ch) ||
      GET_POS(ch) < POS_STANDING)
     return FALSE;

  skip_spaces(&argument);

  if (GET_LEVEL(ch) >= LVL_LEGEND) {
    perform_tell(trainer, ch, "Go away.");
    return TRUE;
  }

  for (ind = 0; trainers[ind].vnum != 0; ind++)
    if (trainers[ind].vnum == GET_MOB_VNUM(trainer))
      break;

  if (trainers[ind].vnum != GET_MOB_VNUM(trainer))
    return FALSE;

  if (trainers[ind].is_newbie && !PLR_FLAGGED(ch, PLR_NEWBIE)) {
    //    perform_tell(trainer, ch, "You do not belong here.");
    //    return TRUE;
  } else if (!trainers[ind].is_newbie && PLR_FLAGGED(ch, PLR_NEWBIE)) {
    perform_tell(trainer, ch, "Go back to the newbie hall!");
    return TRUE;
  }

  if (!PLR_FLAGGED(ch, PLR_NEWBIE) && GET_ATT_POINTS(ch) != 0)
    GET_ATT_POINTS(ch) = 0;

  if (!*argument) {
    if (GET_ATT_POINTS(ch) > 0)
      send_to_char(ch, "You have %d points to distribute.  You can train",
                   GET_ATT_POINTS(ch));
    else send_to_char(ch, "You have %0.2f karma points.  You can train",
                      (float)GET_KARMA(ch) / 100);
    for (i = 0; (1 << i) <= ESS; i++)
      if (IS_SET(trainers[ind].attribs, (1 << i))) {
        switch (1 << i) {
          case BOD: send_to_char(ch, "%s bod", first ? "" : ","); break;
          case QUI: send_to_char(ch, "%s qui", first ? "" : ","); break;
          case STR: send_to_char(ch, "%s str", first ? "" : ","); break;
          case CHA: send_to_char(ch, "%s cha", first ? "" : ","); break;
          case INT: send_to_char(ch, "%s int", first ? "" : ","); break;
          case WIL: send_to_char(ch, "%s wil", first ? "" : ","); break;
          case ESS: send_to_char(ch, "%s ess", first ? "" : ","); break;
        }
        first = 0;
      }
    send_to_char(".\r\n", ch);
    return 1;
  }

  if (!str_cmp(argument, "bod") && IS_SET(trainers[ind].attribs, BOD)) {
    if (ch->real_abils.bod >= racial_max(ch, BOD)) {
      send_to_char("Your body attribute is at its maximum.\r\n", ch);
      return 1;
    }
    if (((ch->real_abils.bod + 1) > (int)(GET_KARMA(ch) / 100)) &&
        GET_ATT_POINTS(ch) <= 0) {
      send_to_char("You don't have enough karma to raise your body attribute.\r\n", ch);
      return 1;
    }
    if (!trainers[ind].is_newbie) {
      if (GET_NUYEN(ch) < ((ch->real_abils.bod + 1) * 1000)) {
        sprintf(arg, "The charge for that is %d nuyen, which I see you don't have.",
                ((ch->real_abils.bod + 1) * 1000));
        perform_tell(trainer, ch, arg);
        return TRUE;
      }
      GET_NUYEN(ch) -= (ch->real_abils.bod + 1) * 1000;
    }
    if (GET_ATT_POINTS(ch) > 0)
      GET_ATT_POINTS(ch)--;
    else GET_KARMA(ch) -= (ch->real_abils.bod + 1) * 100;
    ch->real_abils.bod++;
    ch->real_abils.bod_index += 100;
    affect_total(ch);
    send_to_char(ch, "Your previous weeks worth of hard work increase your Bod "
                 "to %d.\r\n", ch->real_abils.bod);
  } else if (!str_cmp(argument, "qui") && IS_SET(trainers[ind].attribs, QUI)) {
    if (ch->real_abils.qui >= racial_max(ch, QUI)) {
      send_to_char("Your quickness attribute is at its maximum.\r\n", ch);
      return 1;
    }
    if ((ch->real_abils.qui + 1 > (int)(GET_KARMA(ch) / 100)) &&
        GET_ATT_POINTS(ch) < 1) {
      send_to_char("You don't have enough karma to raise your quickness attribute.\r\n", ch);
      return 1;
    }
    if (!trainers[ind].is_newbie) {
      if (GET_NUYEN(ch) < ((ch->real_abils.qui + 1) * 1000)) {
        sprintf(arg, "The charge for that is %d nuyen, which I see you don't have.",
                ((ch->real_abils.qui + 1) * 1000));
        perform_tell(trainer, ch, arg);
        return TRUE;
      }
      GET_NUYEN(ch) -= (ch->real_abils.qui + 1) * 1000;
    }
    if (GET_ATT_POINTS(ch) > 0)
      GET_ATT_POINTS(ch)--;
    else GET_KARMA(ch) -= (ch->real_abils.qui + 1) * 100;
    ch->real_abils.qui++;
    affect_total(ch);
    send_to_char(ch, "After weeks of chasing chickens, your hard work pays off and your "
                 "quickness\r\nraises to %d.\r\n", ch->real_abils.qui);
  } else if (!str_cmp(argument, "str") && IS_SET(trainers[ind].attribs, STR)) {
    if (ch->real_abils.str >= racial_max(ch, STR)) {
      send_to_char("Your Strength attribute is at its maximum.\r\n", ch);
      return 1;
    }
    if ((ch->real_abils.str + 1 > (int)(GET_KARMA(ch) / 100)) &&
        GET_ATT_POINTS(ch) < 1) {
      send_to_char("You don't have enough karma to raise your strength attribute.\r\n", ch);


      return 1;
    }
    if (!trainers[ind].is_newbie) {
      if (GET_NUYEN(ch) < ((ch->real_abils.str + 1) * 1000)) {
        sprintf(arg, "The charge for that is %d nuyen, which I see you don't have.",
                ((ch->real_abils.str + 1) * 1000));
        perform_tell(trainer, ch, arg);
        return TRUE;
      }
      GET_NUYEN(ch) -= (ch->real_abils.str + 1) * 1000;
    }
    if (GET_ATT_POINTS(ch) > 0)
      GET_ATT_POINTS(ch)--;
    else GET_KARMA(ch) -= (ch->real_abils.str + 1) * 100;
    ch->real_abils.str++;
    affect_total(ch);
    send_to_char(ch, "With months of weight lifting, your Strength increases to %d.\r\n",
                 ch->real_abils.str);
  } else if (!str_cmp(argument, "cha") && IS_SET(trainers[ind].attribs, CHA)) {
    if (ch->real_abils.cha >= racial_max(ch, CHA)) {
      send_to_char("Your charisma attribute is at its maximum.\r\n", ch);
      return 1;
    }
    if ((ch->real_abils.cha + 1 > (int)(GET_KARMA(ch) / 100)) &&
        GET_ATT_POINTS(ch) < 1) {
      send_to_char("You don't have enough karma to raise your charisma attribute.\r\n", ch);
      return 1;
    }
    if (!trainers[ind].is_newbie) {
      if (GET_NUYEN(ch) < ((ch->real_abils.cha + 1) * 1000)) {
        sprintf(arg, "The charge for that is %d nuyen, which I see you can't afford.",
                ((ch->real_abils.cha + 1) * 1000));
        perform_tell(trainer, ch, arg);
        return TRUE;
      }
      GET_NUYEN(ch) -= (ch->real_abils.cha + 1) * 1000;
    }
    if (GET_ATT_POINTS(ch) > 0)
      GET_ATT_POINTS(ch)--;
    else GET_KARMA(ch) -= (ch->real_abils.cha + 1) * 100;
    ch->real_abils.cha++;
    affect_total(ch);
    send_to_char(ch, "After weeks of reading self-help books and raising your "
                 "confidence, your\r\nCharisma raises to %d.\r\n", ch->real_abils.cha);
  } else if (!str_cmp(argument, "int") && IS_SET(trainers[ind].attribs, INT)) {
    if (ch->real_abils.intel >= racial_max(ch, INT)) {
      send_to_char("Your intelligence attribute is at its maximum.\r\n", ch);
      return 1;
    }
    if ((ch->real_abils.intel + 1 > (int)(GET_KARMA(ch) / 100)) && GET_ATT_POINTS(ch) < 1) {
      send_to_char("You don't have enough karma to raise your intelligence "
                   "attribute.\r\n", ch);
      return 1;
    }
    if (!trainers[ind].is_newbie) {
      if (GET_NUYEN(ch) < ((ch->real_abils.intel + 1) * 1000)) {
        sprintf(arg, "The charge for that is %d nuyen, which I see you can't afford.",
                ((ch->real_abils.intel + 1) * 1000));
        perform_tell(trainer, ch, arg);
        return TRUE;
      }
      GET_NUYEN(ch) -= (ch->real_abils.intel + 1) * 1000;
    }
    if (GET_ATT_POINTS(ch) > 0)
      GET_ATT_POINTS(ch)--;
    else GET_KARMA(ch) -= (ch->real_abils.intel + 1) * 100;
    ch->real_abils.intel++;
    affect_total(ch);
    send_to_char(ch, "Through many long hours using educational simsense, your "
                 "Intelligence raises\r\nto %d.\r\n", ch->real_abils.intel);
  } else if (!str_cmp(argument, "wil") && IS_SET(trainers[ind].attribs, WIL)) {
    if (ch->real_abils.wil >= racial_max(ch, WIL)) {
      send_to_char("Your willpower attribute is at its maximum.\r\n", ch);
      return 1;
    }
    if ((ch->real_abils.wil + 1 > (int)(GET_KARMA(ch) / 100)) && GET_ATT_POINTS(ch) < 1) {
      send_to_char("You don't have enough karma to raise your willpower attribute.\r\n", ch);
      return 1;
    }
    if (!trainers[ind].is_newbie) {
      if (GET_NUYEN(ch) < ((ch->real_abils.wil + 1) * 1000)) {
        sprintf(arg, "The charge for that is %d nuyen, which I see you can't afford.",
                ((ch->real_abils.wil + 1) * 1000));
        perform_tell(trainer, ch, arg);
        return TRUE;
      }
      GET_NUYEN(ch) -= (ch->real_abils.wil + 1) * 1000;
    }
    if (GET_ATT_POINTS(ch) > 0)
      GET_ATT_POINTS(ch)--;
    else GET_KARMA(ch) -= (ch->real_abils.wil + 1) * 100;
    ch->real_abils.wil++;
    affect_total(ch);
    send_to_char(ch, "Through a strict regimine of work and study, your Willpower raises "
                 "to %d.\r\n", ch->real_abils.wil);
  } else if (!str_cmp(argument, "ess") && IS_SET(trainers[ind].attribs, ESS)) {
    if ((int)(ch->real_abils.ess / 100) >= racial_max(ch, ESS)) {
      send_to_char("Your essence is at its maximum.\r\n", ch);
      return 1;
    }
    if (ESSENCE_COST > GET_KARMA(ch)) {
      send_to_char("You don't have enough karma to raise your essence.\r\n", ch);
      return 1;
    }
    if (GET_NUYEN(ch) < ESSENCE_COST * 10) {
      sprintf(arg, "The charge for that is %d nuyen, which I see you can't afford.",
              ESSENCE_COST * 10);
      perform_tell(trainer, ch, arg);
      return TRUE;
    }
    GET_NUYEN(ch) -= ESSENCE_COST * 10;
    GET_KARMA(ch) -= ESSENCE_COST;
    ch->real_abils.ess = MIN(600, (int)(ch->real_abils.ess + 100));
    affect_total(ch);
    send_to_char(ch, "A light surrounds you, bathing you in an ethereal plasma.  You "
                 "feel your\r\nvitality increase.");
  } else {
    if (GET_ATT_POINTS(ch) > 0)
      send_to_char(ch, "You have %d points to distribute.  You can train",
                   GET_ATT_POINTS(ch));
    else send_to_char(ch, "You have %0.2f karma points.  You can train",
                      (float)GET_KARMA(ch) / 100);
    for (i = 0; (1 << i) <= ESS; i++)
      if (IS_SET(trainers[ind].attribs, (1 << i))) {
        switch (1 << i) {
          case BOD: send_to_char(ch, "%s bod", first ? "" : ","); break;
          case QUI: send_to_char(ch, "%s qui", first ? "" : ","); break;
          case STR: send_to_char(ch, "%s str", first ? "" : ","); break;
          case CHA: send_to_char(ch, "%s cha", first ? "" : ","); break;
          case INT: send_to_char(ch, "%s int", first ? "" : ","); break;
          case WIL: send_to_char(ch, "%s wil", first ? "" : ","); break;
          case ESS: send_to_char(ch, "%s ess", first ? "" : ","); break;
        }
        first = 0;
      }
    send_to_char(".\r\n", ch);
  }
 return 1;
}

SPECIAL(spell_master)
{
  struct char_data *teacher = (struct char_data *) me;
  spell_t *spell;
  int ind, force = 0, spellnum, oldforce;

  if (IS_NPC(ch) || !CMD_IS("learn") || !CAN_SEE(teacher, ch) || FIGHTING(ch) ||
      GET_POS(ch) < POS_STANDING)
    return FALSE;

  skip_spaces(&argument);

  for (ind = 0; masters[ind].vnum != 0; ind++)
    if (masters[ind].vnum == GET_MOB_VNUM(teacher))
      break;

  if (masters[ind].vnum != GET_MOB_VNUM(teacher))
    return FALSE;

  skip_spaces(&argument);

  if (GET_LEVEL(ch) >= LVL_LEGEND) {
    perform_tell(teacher, ch, "Go away.");
    return TRUE;
  }

  if (masters[ind].is_newbie && !PLR_FLAGGED(ch, PLR_NEWBIE)) {
    perform_tell(teacher, ch, "Get out of here before I dissolve you!");
    return TRUE;
  } else if (!masters[ind].is_newbie && PLR_FLAGGED(ch, PLR_NEWBIE)) {
    perform_tell(teacher, ch, "Go back to the newbie hall!");
    return TRUE;
  }
  if (masters[ind].is_hermetic && GET_TRADITION(ch) != TRAD_HERMETIC) {
    perform_tell(teacher, ch, "I cannot teach your ways.");
    return TRUE;
  } else if (!masters[ind].is_hermetic && GET_TRADITION(ch) != TRAD_SHAMANIC) {
    perform_tell(teacher, ch, "The Spirit is not with you.");
    return TRUE;
  }

  if (!*argument) {
    sprintf(buf, "You can learn the following spell%s:\r\n", masters[ind].spell2 ? "s" : "");
    sprintf(buf, "%s%20s     %20s\r\n", buf, spells[masters[ind].spell1],
            masters[ind].spell2 ? spells[masters[ind].spell2] : "");
    sprintf(buf, "%s\r\nYou have %0.2f karma points.\r\n", buf, (float)GET_KARMA(ch) / 100);
    send_to_char(buf, ch);
    return TRUE;
  }

  argument = any_one_arg(argument, arg);
  skip_spaces(&argument);
  force = atoi(arg);

  if (force < 1) {
    send_to_char("Usage: learn <force> <spell>\r\n", ch);
    return TRUE;
  }

  if (is_abbrev(argument, spells[masters[ind].spell1])) {
    spellnum = masters[ind].spell1;
    if (force > masters[ind].force1) {
      perform_tell(teacher, ch, "I cannot teach that level of power.");
      return TRUE;
    }
  } else if (is_abbrev(argument, spells[masters[ind].spell2])) {
    spellnum = masters[ind].spell2;
    if (force > masters[ind].force2) {
      perform_tell(teacher, ch, "I cannot teach that level of power.");
      return TRUE;
    }
  } else {
    send_to_char("What spell do you want to learn?\r\n", ch);
    return TRUE;
  }

  for (spell = ch->spells; spell; spell = spell->next)
    if (spell->type == spellnum)
      break;

  if (spell && spell->type != spellnum)
    spell = NULL;

  if (spell) {
    if (force < spell->force) {
      send_to_char("You can't learn a spell at a force lower than you already know!\r\n", ch);
      return TRUE;
    } else if (force == spell->force) {
      send_to_char("Yeah, whatever.\r\n", ch);
      return TRUE;
    }
    oldforce = spell->force;
    if (GET_KARMA(ch) < ((force - oldforce) * 100)) {
      send_to_char("You do not have enough karma.\r\n", ch);
      return TRUE;
    }
    GET_KARMA(ch) -= ((force - oldforce) * 100);
    spell->force = force;
  } else {
    if (GET_KARMA(ch) < (force * 100)) {
      send_to_char("You do not have enough karma.\r\n", ch);
      return TRUE;
    }
    GET_KARMA(ch) -= force * 100;
    spell = new spell_t;
    int i = strlen(spells[spellnum]);
    spell->name = new char[i+1];
    strcpy(spell->name, spells[spellnum]);
    spell->physical = grimoire[spellnum].physical;
    spell->category = grimoire[spellnum].category;
    spell->force = force;
    spell->target = grimoire[spellnum].target;
    spell->drain = grimoire[spellnum].drain;
    spell->damage = grimoire[spellnum].damage;
    spell->effect = SPELL_ELEMENT_NONE;
    spell->type = spellnum;

    if (!ch->spells) {
      ch->spells = spell;
      spell->next = NULL;
    } else {
      spell->next = ch->spells;
      ch->spells = spell;
    }
  }

  send_to_char(ch, "After many hours of trial and error, you know more about %s.\r\n",
               spells[spellnum]);

  return TRUE;
}

SPECIAL(adept_trainer)
{
  struct char_data *trainer = (struct char_data *) me;
  int ind, skill_num, percent, i;

  if (!CMD_IS("train") || IS_NPC(ch) || !CAN_SEE(trainer, ch) || FIGHTING(ch) ||
      GET_POS(ch) < POS_STANDING)
    return FALSE;

  if (GET_TRADITION(ch) != TRAD_ADEPT) {
    perform_tell(trainer, ch, "You do not have the talent.");
    return TRUE;
  }

  skip_spaces(&argument);

  for (ind = 0; adepts[ind].vnum != 0; ind++)
    if (adepts[ind].vnum == GET_MOB_VNUM(trainer))
      break;

  if (adepts[ind].vnum != GET_MOB_VNUM(trainer))
    return FALSE;

  skip_spaces(&argument);

  if (GET_LEVEL(ch) >= LVL_LEGEND) {
    perform_tell(trainer, ch, "Go away.");
    return TRUE;
  }

  if (adepts[ind].is_newbie && !PLR_FLAGGED(ch, PLR_NEWBIE)) {
    perform_tell(trainer, ch, "You do not belong here.");
    return TRUE;
  } else if (!adepts[ind].is_newbie && PLR_FLAGGED(ch, PLR_NEWBIE)) {
    perform_tell(trainer, ch, "Go back to the newbie hall!");
    return TRUE;
  }

  if (!*argument) {
    int num = 0;
    for (i = 0; i < 5; i++)
      if (adepts[ind].skills[i])
        num++;
    sprintf(buf, "You can learn the following abilit%s:\r\n", num == 1 ? "y" : "ies");
    for (i = 0; i < 5; i++)
      if (adepts[ind].skills[i])
        sprintf(buf + strlen(buf), "%s\r\n", spells[SKILL_PERCEPTION + i]);
    sprintf(buf + strlen(buf), "\r\nYou have %0.2f magic point%s to "
            "distribute to your abilities.\r\n", ((float)GET_MAG(ch) / 100),
            ((GET_MAG(ch) != 100) ? "s" : ""));
    send_to_char(buf, ch);
    return TRUE;
  }

  if (is_abbrev(argument, "combat sense"))
    skill_num = SKILL_COMBAT_SENSE;
  else skill_num = find_skill_num(argument);

  if (skill_num < SKILL_PERCEPTION || skill_num > SKILL_RESISTANCE ||
      !adepts[ind].skills[skill_num - SKILL_PERCEPTION]) {
    send_to_char("You trainer can't teach you that ability.\r\n", ch);
    return TRUE;
  }

  if (GET_SKILL(ch, skill_num) >= adepts[ind].skills[skill_num - SKILL_PERCEPTION] ||
      GET_SKILL(ch, skill_num) >= max_ability(skill_num)) {
    send_to_char("You have advanced beyond the teachings of your trainer.\r\n", ch);
    return 1;
  }

  percent = GET_SKILL(ch, skill_num) + 1;

  if (ch->real_abils.mag < (ability_cost(skill_num, percent) -
      ability_cost(skill_num, GET_SKILL(ch, skill_num)))) {
    send_to_char("You do not have enough magic to raise that ability.\r\n", ch);
    return TRUE;
  }

  ch->real_abils.mag -= ability_cost(skill_num, percent) -
                        ability_cost(skill_num, GET_SKILL(ch, skill_num));
  send_to_char("After hours of focus and practice, you feel your "
               "ability sharpen.\r\n", ch);

  SET_SKILL(ch, skill_num, percent);

  if (GET_SKILL(ch, skill_num) >= max_ability(skill_num) ||
      GET_SKILL(ch, skill_num) >= adepts[ind].skills[skill_num - SKILL_PERCEPTION])
    send_to_char("You have learned all your teacher knows in that area.\r\n", ch);

  affect_total(ch);
  return TRUE;
}

SPECIAL(dump)
{
  struct room_data *room = (struct room_data *) me;

  struct obj_data *k;
  int value = 0;

  ACMD(do_drop);
  char *fname(char *namelist);

  for (k = room->contents; k; k = room->contents) {
    sprintf(buf, "%s is thrown away and gone forever!\r\n", CAP(k->short_description));
    send_to_room(buf, real_room(room->number));
    extract_obj(k);
  }

  if (!CMD_IS("drop"))
    return 0;

  do_drop(ch, argument, cmd, 0);

  for (k = world[ch->in_room].contents; k; k = world[ch->in_room].contents) {
    act("$p vanishes in a puff of smoke!", FALSE, 0, k, 0, TO_ROOM);
    value += MAX(1, MIN(50, GET_OBJ_COST(k) / 10));
    extract_obj(k);
  }

  if (value)
  {
    act("You are awarded for outstanding performance.", FALSE, ch, 0, 0, TO_CHAR);
    act("$n has been awarded for being a good citizen.", TRUE, ch, 0, 0, TO_ROOM);
    GET_NUYEN(ch) += value;
  }
  return 1;
}

/* ********************************************************************
*  General special procedures for mobiles                             *
******************************************************************** */

void npc_steal(struct char_data * ch, struct char_data * victim)
{
  int gold;

  if (!IS_NPC(victim) && GET_LEVEL(victim) >= LVL_LEGEND)
    return;

  if (AWAKE(victim) && GET_NUYEN(victim) >= 0 && (number(0, 10) == 0)) {
    act("You discover that $n has $s hands in your wallet.",
        FALSE, ch, 0, victim, TO_VICT);
    act("$n tries to steal nuyen from $N.", TRUE, ch, 0, victim, TO_NOTVICT);
  } else {
    /* Steal some nuyen */
    gold = (int)((GET_NUYEN(victim) * number(1, 10)) / 100);
    if (gold > 0) {
      GET_NUYEN(ch) += gold;
      GET_NUYEN(victim) -= gold;
    }
  }
}

SPECIAL(snake)
{
  if (cmd)
    return FALSE;

  if (GET_POS(ch) != POS_FIGHTING)
    return FALSE;

  if (FIGHTING(ch) && (FIGHTING(ch)->in_room == ch->in_room) &&
      (number(0, (int)(GET_REP(ch) / 5)) == 0)) {
    act("$n bites $N!", 1, ch, 0, FIGHTING(ch), TO_NOTVICT);
    act("$n bites you!", 1, ch, 0, FIGHTING(ch), TO_VICT);
    mob_cast(ch, FIGHTING(ch), NULL, SPELL_POISON, MODERATE);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(thief)
{
  struct char_data *cons;

  if (cmd || GET_POS(ch) != POS_STANDING)
    return FALSE;

  for (cons = world[ch->in_room].people; cons; cons = cons->next_in_room)
    if ((IS_NPC(cons) || GET_LEVEL(cons) < LVL_LEGEND) && !number(0, 4)) {
      npc_steal(ch, cons);
      return TRUE;
    }

  return FALSE;
}

SPECIAL(magic_user)
{
  struct char_data *vict;

  if (cmd || GET_POS(ch) != POS_FIGHTING)
    return FALSE;

  /* pseudo-randomly choose someone in the room who is fighting me */
  for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room)
    if (FIGHTING(vict) == ch && !number(0, 4))
      break;

  /* if I didn't pick any of those, then just slam the guy I'm fighting */
  if (vict == NULL)
    vict = FIGHTING(ch);

  if ((GET_REP(ch) > 20) && (number(0, 10) == 0))
    mob_cast(ch, vict, NULL, SPELL_STUN_BOLT, 0);

  if ((GET_REP(ch) > 12) && (number(0, 8) == 0))
    mob_cast(ch, vict, NULL, SPELL_POWER_DART, 0);

  if ((GET_REP(ch) > 18) && (number(0, 12) == 0)) {
    if (IS_EVIL(ch))
      mob_cast(ch, vict, NULL, SPELL_MANA_BOLT, 0);
    else if (IS_GOOD(ch))
      mob_cast(ch, vict, NULL, SPELL_POWER_BOLT, 0);
  }
  if (number(0, 4))
    return TRUE;

  switch ((int)(GET_REP(ch) / 5)) {
    case 4: case 5:
      mob_cast(ch, vict, NULL, SPELL_POWER_DART, 0);
      break;
    case 6: case 7:
      mob_cast(ch, vict, NULL, SPELL_POWER_MISSILE, 0);
      break;
    default:
      mob_cast(ch, vict, NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);
      break;
  }
  return TRUE;
}


/* ********************************************************************
*  Special procedures for mobiles                                      *
******************************************************************** */

SPECIAL(puff)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch (number(0, 150)) {
    case 0:
      do_say(ch, "My god!  It's full of stars!", 0, 0);
      return FALSE;
    case 1:
      do_say(ch, "How'd all those fish get up here?", 0, 0);
      return FALSE;
    case 2:
      do_say(ch, "I'm a very female dragon.", 0, 0);
      return FALSE;
    case 3:
      do_say(ch, "I've got a peaceful, easy feeling.", 0, 0);
      return FALSE;
  }
  return FALSE;
}

SPECIAL(fido)
{
  struct obj_data *i, *temp, *next_obj;

  if (cmd || !AWAKE(ch))
    return (FALSE);

  for (i = world[ch->in_room].contents; i; i = i->next_content) {
    if (GET_OBJ_TYPE(i) == ITEM_CONTAINER && GET_OBJ_VAL(i, 3)) {
      act("$n savagely devours a corpse.", FALSE, ch, 0, 0, TO_ROOM);
      for (temp = i->contains; temp; temp = next_obj) {
        next_obj = temp->next_content;
        obj_from_obj(temp);
        obj_to_room(temp, ch->in_room);
      }
      extract_obj(i);
      return (TRUE);
    }
  }
  return (FALSE);
}

SPECIAL(janitor)
{
  struct char_data *tch, *jan = (struct char_data *) me;
  struct obj_data *i, *obj;
  bool extract = FALSE, dunkelzahn = FALSE;
  ACMD(do_gen_comm);

  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  for (i = world[jan->in_room].contents; i; i = i->next_content) {
    if (!CAN_WEAR(i, ITEM_WEAR_TAKE) || IS_OBJ_STAT(i, ITEM_CORPSE))
      continue;
    switch (GET_MOB_VNUM(jan)) {
       case 2022:
         act("$n sweeps some garbage into the gutter.",
             FALSE, jan, 0, 0, TO_ROOM);
         extract = TRUE;
         break;
       case TIM_ENCHANTER:
         act("$n rolls $s eyes in disgust as $e picks up some trash.",
             FALSE, jan, 0, 0, TO_ROOM);
         extract = TRUE;
         break;
       case 4008:
         act("$n mumbles as $e picks up some trash.",
             FALSE, jan, 0, 0, TO_ROOM);
         break;
       case 5101:
         act("$n dumps some trash into $s stylized trash compactor.",
             FALSE, jan, 0, 0, TO_ROOM);
         extract = TRUE;
         break;
       default:
         act("$n picks up some trash.", FALSE, jan, 0, 0, TO_ROOM);
         break;
    }
    obj_from_room(i);
    if (extract)
      extract_obj(i);
    else obj_to_char(i, jan);
    return FALSE;
  }

  if (GET_MOB_VNUM(jan) != TIM_ENCHANTER)
    return FALSE;

  for (tch = world[jan->in_room].people; tch; tch = tch->next_in_room)
    if (tch->desc) {
      if (tch->desc->original &&
          isname("dunkelzahn", tch->desc->original->player.name))
        dunkelzahn = TRUE;
      else if (isname("dunkelzahn", tch->player.name))
        dunkelzahn = TRUE;

      if (dunkelzahn)
        break;
    }

  switch (number(0, 350)) {
    case 0:
      if (HOLY_GRAIL_MODE) {
        do_say(jan, "In the frozen land of Nador, they were forced to eat "
                    "Robin's minstrels...", 0, 0);
        do_say(jan, "And there was much rejoicing.", 0, 0);
      }
      return TRUE;
    case 25:
      if (INSULT_MODE && !dunkelzahn)
        do_say(jan, "Dunkelzahn keeps small, lubricated gerbils for pleasure.", 0, 0);
      return TRUE;
    case 50:
      if (HOLY_GRAIL_MODE) {
        do_say(jan, "...and the people did feast upon the lambs, and sloths, "
                    "and carps, and" ,0, 0);
        do_say(jan, "entropies, and orangutans, and breakfast cereals, and "
                    "fruit bats...", 0, 0);
      }
      return TRUE;
    case 75:
      if (INSULT_MODE && !dunkelzahn)
        do_say(jan, "Dunkelzahn is a flaming homosexual!", 0, 0);
      return TRUE;
    case 100:
      if (HOLY_GRAIL_MODE) {
        do_say(jan, "O Lord, bless this, thy hand grenade, that with it thou", 0, 0);
        do_say(jan, "mayst blow thine enemy to tiny bits, in thy mercy.", 0, 0);
      }
      return TRUE;
    case 125:
      if (INSULT_MODE && !dunkelzahn)
        do_say(jan, "Dunelzahn flirts with homosexual lab rats.", 0, 0);
      return TRUE;
    case 150:
      if (HOLY_GRAIL_MODE) {
        do_say(jan, "That's no ordinary rabbit!  That's the most foul, cruel,", 0, 0);
        do_say(jan, "and bad-tempered rodent you ever set eyes on!", 0, 0);
      }
      return TRUE;
    case 175:
      if (INSULT_MODE && !dunkelzahn) {
        do_say(jan, "When gerbils and hamsters aren't available,", 0, 0);
        do_say(jan, "Dunkelzahn relies on the untamed ferret.", 0, 0);
      }
      return TRUE;
    case 200:
      if (INSULT_MODE && !dunkelzahn) {
        do_say(jan, "It may be just a rumor, but I heard Dunkelzahn", 0, 0);
        do_say(jan, "enjoys the company of unsuspecting sheep.", 0, 0);
      }
      return TRUE;

    case 225:
      if (INSULT_MODE && !dunkelzahn)
      {
	do_say(jan, "Rumor has it that Nadja Daviar requires", 0, 0);
	do_say(jan, "knee-pads and a magnifing glass for her", 0, 0);
	do_say(jan, "'under the table' work.", 0, 0);
      }
      return TRUE;

    case 250:
      if (INSULT_MODE && !dunkelzahn)
      {
	do_echo(jan, "nods his head back and forth like he's on Thorazine.", find_command("emote"), SCMD_EMOTE);
	do_say(jan, "Great impression of Dunkelzahn, no?", 0, 0);
      }
      return TRUE;

    case 275:
      if (INSULT_MODE && !dunkelzahn)
      {
	do_say(jan, "Dunkelzahn is the world's greatest proof of reincarnation...", 0, 0);
	do_say(jan, "Nobody could become that stupid in just one lifetime.", 0, 0);
      }
      return TRUE;

  }

  return FALSE;
}

SPECIAL(generic_guard)
{
  struct char_data *tch, *evil;
  int max_evil;

  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  max_evil = 1000;
  evil = 0;

  for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room)
    if (IS_NPC(tch) && CAN_SEE(ch, tch) && PLR_FLAGGED(tch, PLR_KILLER)) {
      act("$n screams, 'Hey, it's one of those fraggin unreg'ed pkers!!!'",
          FALSE, ch, 0, 0, TO_ROOM);
      set_fighting(ch, tch);
      return (TRUE);
    }

  for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room)
    if (CAN_SEE(ch, tch) && PLR_FLAGGED(tch, PLR_THIEF)){
      act("$n screams, 'Fragging thieves!'", FALSE, ch, 0, 0, TO_ROOM);
      set_fighting(ch, tch);
      return (TRUE);
    }

  switch (GET_MOB_VNUM(ch)) {
    case 2013: case 5100:
      for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room)
        if (CAN_SEE(ch, tch) && GET_POS(tch) == POS_SLEEPING) {
          GET_POS(tch) = POS_SITTING;
          act("$n slaps $N on $S shoulder, forcing $M awake.",
              FALSE, ch, 0, tch, TO_NOTVICT);
          act("You slap $N on $S shoulder, forcing $M awake.",
              FALSE, ch, 0, tch, TO_CHAR);
          act("$n slaps you on the shoulder, forcing you awake.",
              FALSE, ch, 0, tch, TO_VICT);
          do_say(ch, "I'd advise that you move, citizen.", 0, 0);
          return (TRUE);
        }
      break;
    case 1916:
      for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room)
        if (CAN_SEE(ch, tch) && GET_POS(tch) == POS_SLEEPING) {
          GET_POS(tch) = POS_SITTING;
          act("$n pokes $N on the shoulder, forcing $M awake.",
              FALSE, ch, 0, tch, TO_NOTVICT);
          act("You poke $N on the shoulder, forcing $M awake.",
              FALSE, ch, 0, tch, TO_CHAR);
          act("$n pokes you on the shoulder, forcing you awake.",
              FALSE, ch, 0, tch, TO_VICT);
          do_say(ch, "This ain't the place for that.", 0, 0);
          return (TRUE);
        }
      break;
  }

  return (FALSE);
}

SPECIAL(pet_shops)
{
  char buf[MAX_STRING_LENGTH], pet_name[256];
  int pet_room;
  struct char_data *pet;

  if (!cmd)
    return FALSE;

  pet_room = ch->in_room + 1;

  if (CMD_IS("list")) {
    send_to_char("Available pets are:\r\n", ch);
    for (pet = world[pet_room].people; pet; pet = pet->next_in_room) {
      sprintf(buf, "%8d - %s\r\n", 3 * GET_KARMA(pet), GET_NAME(pet));
      send_to_char(buf, ch);
    }
    return (TRUE);
  } else if (CMD_IS("buy")) {

    argument = one_argument(argument, buf);
    argument = one_argument(argument, pet_name);

    if (!(pet = get_char_room(buf, pet_room))) {
      send_to_char("There is no such pet!\r\n", ch);
      return (TRUE);
    }
    if (GET_NUYEN(ch) < (GET_KARMA(pet) * 3)) {
      send_to_char("You don't have enough gold!\r\n", ch);
      return (TRUE);
    }
    GET_NUYEN(ch) -= GET_KARMA(pet) * 3;

    pet = read_mobile(GET_MOB_RNUM(pet), REAL);
    GET_KARMA(pet) = 0;
    SET_BIT(AFF_FLAGS(pet), AFF_CHARM);

    if (*pet_name) {
      sprintf(buf, "%s %s", pet->player.name, pet_name);
      /* free(pet->player.name); don't free the prototype! */
      pet->player.name = str_dup(buf);

      sprintf(buf, "%sA small sign on a chain around the neck says 'My name is %s'\r\n",
              pet->player.description, pet_name);
      /* free(pet->player.description); don't free the prototype! */
      pet->player.description = str_dup(buf);
    }
    char_to_room(pet, ch->in_room);
    add_follower(pet, ch);

    /* Be certain that pets can't get/carry/use/wield/wear items */
    IS_CARRYING_W(pet) = 1000;
    IS_CARRYING_N(pet) = 100;

    send_to_char("May you enjoy your pet.\r\n", ch);
    act("$n buys $N as a pet.", FALSE, ch, 0, pet, TO_ROOM);

    return 1;
  }
  /* All commands except list and buy */
  return 0;
}

SPECIAL(clean)
{
  struct char_data *clean = (struct char_data *) me;

  if (cmd)
    return FALSE;

  if (!FIGHTING(clean)) {
    switch (number(0, 60)) {
      case 0:
        do_say(clean, "If you're caught, we never heard of you before.", 0, 0);
        return TRUE;
      case 1:
        do_say(clean, "This conversation never took place. Understand?", 0, 0);
        return TRUE;
      case 2:
        do_say(clean, "It's a small job -- minimal complications.", 0, 0);
        return TRUE;
      case 3:
        do_say(clean, "Payment will be handled the usual way.", 0, 0);
        return TRUE;
      }
    return FALSE;
  } else {
    summon_mob(clean, TROLL_BOUNCER, 1);
    summon_mob(clean, MAGE_BOUNCER, 1);
  }

  return FALSE;
}

SPECIAL(pike)
{
  ACMD(do_gen_door);
  struct char_data *pike = (struct char_data *) me;

  if (CMD_IS("give")) {
    char arg1[50], arg2[50], arg3[50], *temp;

    temp = any_one_arg(argument, arg1);
    temp = any_one_arg(temp, arg2);
    temp = any_one_arg(temp, arg3);

    if (*arg2 && !strcasecmp("pike", arg2)) {
      act("$n says, \"Hey chummer, nuyen only.\"", FALSE, pike, 0, 0, TO_ROOM);
      send_to_char(pike, "You say, \"Hey chummer, nuyen only.\"\r\n");
      return TRUE;
    }

    if (!*arg3 || strcasecmp("pike", arg3))
      return FALSE;

    int amount = atoi(arg1);
    if (amount < 50) {
      act("$n says, \"Hey chummer, it's 50 nuyen or nothing.\"",
          FALSE, pike, 0, 0, TO_ROOM);
      send_to_char(pike, "You say, \"Hey chummer, it's 50 nuyen or nothing.\"\r\n");
      return TRUE;
    } else if (GET_NUYEN(ch) < 50) {
      act("$n says, \"Better check your account, you don't have the 50 creds.\"",
          FALSE, pike, 0, ch, TO_ROOM);
      send_to_char(pike, "You say, \"Better check your account, you don't have the 50 creds.\"");
    } else {
      act("$n says, \"Thanks chummer.\"", FALSE, pike, 0, 0, TO_ROOM);
      send_to_char(pike, "You say, \"Thanks chummer.\"\r\n");
      if (world[pike->in_room].number != 2337) {
        act("$n says, \"Where the frag am I?\"", FALSE, pike, 0, 0, TO_ROOM);
        send_to_char(pike, "You say, \"Where the frag am I?\"\r\n");
      } else {
        if (IS_SET(EXIT(pike, WEST)->exit_info, EX_CLOSED)) {
          if (IS_SET(EXIT(pike, WEST)->exit_info, EX_LOCKED)) {
            act("With a loud click, $n unlocks the gate to the junkyard.",
                FALSE, pike, 0, 0, TO_ROOM);
            send_to_char(pike, "With a loud click, you unlock the gate to the junkyard.\r\n");
            TOGGLE_BIT(EXIT(pike, WEST)->exit_info, EX_LOCKED);
            do_gen_door(pike, "gate", 0, SCMD_OPEN);
            act("$n says, \"There ya go.\"", FALSE, pike, 0, 0, TO_ROOM);
            send_to_char(pike, "You say, \"There ya go.\"\r\n");
            GET_NUYEN(pike) += amount;
            GET_NUYEN(ch) -= amount;
          } else {
            act("$n says, \"The gate isn't locked, so go on in.\"",
                FALSE, pike, 0, 0, TO_ROOM);
            send_to_char(pike, "You say, \"The gate isn't locked, so go on in.\"\r\n");
          }
        } else {
          act("$n says, \"The gate isn't even closed, so go on in.\"",
              FALSE, pike, 0, 0, TO_ROOM);
          send_to_char(pike, "You say, \"The gate isn't even closed, so go on in.\"\r\n");
        }
      }
      return TRUE;
    }
  } else if (CMD_IS("west")) {
    if (perform_move(ch, WEST, LEADER, NULL) && world[pike->in_room].number == 2337) {
      if (!IS_SET(EXIT(pike, WEST)->exit_info, EX_CLOSED))
        do_gen_door(pike, "gate", 0, SCMD_CLOSE);

      if (IS_SET(EXIT(pike, WEST)->exit_info, EX_CLOSED) &&
          !IS_SET(EXIT(pike, WEST)->exit_info, EX_LOCKED)) {
        TOGGLE_BIT(EXIT(pike, WEST)->exit_info, EX_LOCKED);
        act("$n locks the gate.", FALSE, pike, 0, 0, TO_ROOM);
      }
    }
    // we return TRUE no matter what cause we move with perform_move
    return TRUE;
  } else if (number(0, 40) == 9)
    do_say(pike, "For 50 nuyen, I'll unlock the gate to the junkyard for you.", 0, 0);

  return FALSE;
}

SPECIAL(jeff)
{
  ACMD(do_gen_door);
  struct char_data *jeff = (struct char_data *) me;

  if (CMD_IS("give")) {
    char arg1[50], arg2[50], arg3[50], *temp;

    temp = any_one_arg(argument, arg1);
    temp = any_one_arg(temp, arg2);
    temp = any_one_arg(temp, arg3);

    if (*arg2 && !strcasecmp("jeff", arg2)) {
      act("$n says, \"Hey fraghead, nuyen only.\"", FALSE, jeff, 0, 0, TO_ROOM);
      send_to_char(jeff, "You say, \"Hey fraghead, nuyen only.\"\r\n");
      return TRUE;
    }

    if (!*arg3 || strcasecmp("jeff", arg3))
      return FALSE;

    int amount = atoi(arg1);
    if (amount < 10) {
      act("$n says, \"Hey fraghead, it's 10 creds!\"", FALSE, jeff, 0, 0, TO_ROOM);
      send_to_char(jeff, "You say, \"Hey fraghead, it's 10 creds!\"");
      return TRUE;
    } else if (GET_NUYEN(ch) < 10) {
      act("$n says, \"Hey slothead, you're not even worth 10 creds.\"",
          FALSE, jeff, 0, 0, TO_ROOM);
      send_to_char(jeff, "You say, \"Hey slothead, you're not even worth 10 creds.\"");
    } else {
      act("$n looks at $N suspiciously.", FALSE, jeff, 0, ch, TO_NOTVICT);
      act("You look at $N suspiciously.", FALSE, jeff, 0, ch, TO_CHAR);
      act("$n looks at you suspiciously.", FALSE, jeff, 0, ch, TO_VICT);
      if (world[jeff->in_room].number != 2326) {
        act("$n says, \"Where the frag am I?\"", FALSE, jeff, 0, 0, TO_ROOM);
        send_to_char(jeff, "You say, \"Where the frag am I?\"\r\n");
      } else {
        if (IS_SET(EXIT(jeff, WEST)->exit_info, EX_CLOSED)) {
          do_gen_door(jeff, "roadblock", 0, SCMD_OPEN);
          GET_NUYEN(jeff) += amount;
          GET_NUYEN(ch) -= amount;
          act("$n says, \"Go ahead.\"", FALSE, jeff, 0, 0, TO_ROOM);
          send_to_char(jeff, "You say, \"Go ahead.\"\r\n");
        } else {
          act("$n says, \"The roadblock is open, so go ahead.\"", FALSE, jeff, 0, 0, TO_ROOM);
          send_to_char(jeff, "You say, \"The roadblock is open, so go ahead.\"\r\n");
        }
      }
      return TRUE;
    }
  } else if (CMD_IS("west")) {
    if (perform_move(ch, WEST, LEADER, NULL) && world[jeff->in_room].number == 2326) {
      if (!IS_SET(EXIT(jeff, WEST)->exit_info, EX_CLOSED))
        do_gen_door(jeff, "roadblock", 0, SCMD_CLOSE);
    }
    // we return TRUE no matter what cause we move with perform_move
    return TRUE;
  } else if (CMD_IS("open")) {
    char *args = argument;
    skip_spaces(&args);
    if (!strcasecmp("roadblock", args)) {
      act("$n says, \"Slot off, it's 10 creds to pass chummer.\"",
          FALSE, jeff, 0, 0, TO_ROOM);
      send_to_char(jeff, "You say, \"Slot off, it's 10 creds to pass chummer.\"\r\n");
    }
    return TRUE;
  } else if (number(0, 50) == 11)
    do_say(jeff, "10 creds to pass through the roadblock chummer.", 0, 0);

  return FALSE;
}

SPECIAL(delaney)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return FALSE;

  switch (number(0, 20)) {
    case 0:
      act("$n cranks some ancient classical music and settles down "
          "with a cigar.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 1:
      act("After a long night on the booze, $n contemplates the basket by his "
          "desk, convulses, and throws up in it.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(bio_secretary)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return FALSE;

  switch (number(0, 20)) {
    case 0:
      act("$n applies some more mascara and files her nails.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 1:
      do_say(ch, "Hello, can I help you at all?", 0, 0);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(expreen)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return FALSE;

  switch (number(0, 20)) {
    case 0:
      act("After much noise $n comes from behind a blind, zips up his "
          "trousers and lights a cigarette, grinning happily.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 1:
      act("$n sits back in a huge leather chair and picks up a copy of "
          "'I am Too Smart For My Own Good' by Thornton Edgeton.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(beurring)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return FALSE;

  switch (number(0, 20)) {
    case 0:
      act("$n polishes his pride and joy, a human skull.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 1:
      act("$n sits down behind his desk and radios through to all the "
          "camp guards.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }

  return FALSE;
}

SPECIAL(tarmile)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return FALSE;

  switch (number(0, 20)) {
    case 0:
      act("$n turns to the wall and examines a map of Seattle, placing small "
          "red markers in points of mass metahuman vulnerability.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 1:
      do_say(ch, "Ah.....isn't genocide wonderful?", 0, 0);
      return TRUE;
  }
  return FALSE;
}

SPECIAL (captain)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return FALSE;

  switch (number(0, 80)) {
    case 0:
      do_say(ch, "Have you seen the state of the streets out there?", 0, 0);
      return TRUE;
    case 1:
      do_say(ch, "Hey you! Who allowed you in here?", 0, 0);
      return TRUE;
    case 2:
      act("$n kicks back and enjoys the football game on the Trid.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 3:
      do_say(ch, "Life in the sprawl has gotten bad, and it's our job to "
             "clean it up.", 0, 0);
      return TRUE;
    case 4:
      act("$n removes the clip from his pistol and checks the bullets.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(rodgers)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch (number(0, 80)) {
    case 0:
      do_say(ch, "Another day in the office, another day in hell.", 0, 0);
      return TRUE;
    case 1:
      do_say(ch, "All this paperwork! Why can't I be on the beat?", 0, 0);
      return TRUE;
    case 2:
      act("$n pushes some keys on his terminal and views the general payroll "
          "in envy.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 3:
      act("$n fumes with rage as he hears of another failed drug-bust.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 4:
      act("$n polishes the ornaments in his display cabinet while humming an "
          "old '90s tune.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(nitler)
{
  ACMD(do_gen_comm);
  struct char_data *vict;

  if (cmd || !FIGHTING(ch) || !AWAKE(ch))
    return FALSE;

  if (!number(0, 3)) {
    do_gen_comm(ch, "Guards, to my aid!", 0, SCMD_SHOUT);
    if (!summon_mob(ch, BLACK_GUARD, number(1, 2)))
      reset_zone(real_zone(ZONE_GROEZTA), 0);
    return FALSE;
  }

  for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room)
    if (FIGHTING(vict) == ch && !number(0, 4))
      break;

  if (!vict)
    vict = FIGHTING(ch);

  if (GET_REP(vict) > 22 && !number(0, 10))
    mob_cast(ch, vict, NULL, SPELL_STUNBLAST, 0);

  if (GET_REP(vict) > 12 && !number(0, 8))
    mob_cast(ch, vict, NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);

  if (GET_REP(vict) > 20 && !number(0, 12)) {
    if (IS_EVIL(vict))
      mob_cast(ch, vict, NULL, SPELL_HELLBLAST, 0);
    else if (IS_GOOD(vict))
      mob_cast(ch, vict, NULL, SPELL_POWER_BOLT, 0);
  }
  if (number(0, 4))
    return TRUE;

  mob_cast(ch, vict, NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);

  return TRUE;
}

SPECIAL(lone_star_park)
{
  struct char_data *tch, *evil;
  int max_evil;

  if (cmd || !AWAKE(ch) || FIGHTING(ch))
    return FALSE;

  max_evil = 1000;
  evil = 0;

  for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room) {
    if (CAN_SEE(ch, tch) && PLR_FLAGGED(tch, PLR_KILLER)) {
      act("$n pulls out his trusty standard-issue weapon upon seeing you!",
          FALSE, ch, 0, tch, TO_VICT);
      act("$n sneers at $N, recognizing him as a felon!",
          FALSE, ch, 0, tch, TO_NOTVICT);
      act("You recognize $N from the Wanted picture on a milk carton and attack!",
          FALSE, ch, 0, tch, TO_CHAR);
      set_fighting(ch, tch);
      return TRUE;
    }
  }

  for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room) {
    if (CAN_SEE(ch, tch) && PLR_FLAGGED(tch, PLR_THIEF)){
      act("$n pulls out his trusty standard-issue weapon upon seeing you!",
          FALSE, ch, 0, tch, TO_VICT);
      act("$n sneers at $N, recognizing him as a felon!",
          FALSE, ch, 0, tch, TO_NOTVICT);
      act("You recognize $N from the Wanted picture on a milk carton and attack!",
          FALSE, ch, 0, tch, TO_CHAR);
      set_fighting(ch, tch);
      return TRUE;
    }
  }

  for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room) {
    if (GET_MOB_VNUM(tch) == PARK_MUGGER) {
      set_fighting(ch, tch);
      return TRUE;
    }
    if (CAN_SEE(ch, tch) && FIGHTING(tch)) {
      if ((GET_ALIGNMENT(tch) < max_evil) && (IS_NPC(tch) || IS_NPC(FIGHTING(tch)))) {
        max_evil = GET_ALIGNMENT(tch);
        evil = tch;
      }
    }
  }

  if (evil && (GET_ALIGNMENT(FIGHTING(evil)) >= 0)) {
    act("$n screams, 'You're in trouble now, chummer!'", FALSE, ch, 0, 0, TO_ROOM);
    set_fighting(ch, evil);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(mugger_park)
{
  struct char_data *vict;
  struct obj_data *obj, *cred;
  int gold;

  if (cmd || !AWAKE(ch))
    return FALSE;

  if (FIGHTING(ch) && !number(0,9)) {
    vict = FIGHTING(ch);
    gold = (int)(number(5,8) * number(2,3) * 2.5);
    if (GET_NUYEN(vict) > gold) {
      act("$n deftly lifts some nuyen from $N!", FALSE, ch, 0, vict, TO_NOTVICT);
      act("$n deftly lifts some nuyen from your pocket!", FALSE, ch, 0, vict, TO_VICT);
      act("You deftly grab some nuyen from $N!", FALSE, ch, 0, vict, TO_CHAR);
      GET_NUYEN(ch) += gold;
      GET_NUYEN(vict) -= gold;
      return TRUE;
    }
    return FALSE;
  }

  if (!FIGHTING(ch)) {
    for (obj = world[ch->in_room].contents; obj; obj = obj->next_content)
      if (GET_OBJ_TYPE(obj) == ITEM_MONEY) {
        act("$n grins as he picks up $p from the ground.", FALSE, ch, obj, 0, TO_ROOM);
        act("You grin slightly as you pick up $p.", FALSE, ch, obj, 0, TO_CHAR);
        GET_NUYEN(ch) += GET_OBJ_VAL(obj, 0);
        extract_obj(obj);
        return TRUE;
      }
    for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room) {
      if (CAN_SEE(ch, vict) && (IS_NPC(vict) && vict != ch) ||
          (GET_REP(vict) > 8 && GET_LEVEL(vict) < LVL_LEGEND) && !number(0,4)) {
        act("$n says, 'Gimme your money, chummer!'",
            FALSE, ch, 0, vict, TO_VICT);
        act("$n pulls out $s gun and asks $N for $s credstick.",
            FALSE, ch, 0, vict, TO_NOTVICT);
        act("You say to $N, 'Gimme your money, chummer!' in typical New York "
            "fashion.", FALSE, ch, 0, vict, TO_CHAR);
        set_fighting(ch, vict);
        return TRUE;
      }
    }
  }
  return FALSE;
}

SPECIAL(gate_guard_park)
{
  ACMD(do_gen_door);
  struct char_data *guard = (char_data *) me;

  if (!AWAKE(guard) || FIGHTING(guard))
    return FALSE;

  if (!cmd) {
    switch (number(1,160)) {
      case 12:
        do_say(guard, "Hey, bub, this is private property.", 0, 0);
        return TRUE;
      case 92:
        do_say(guard, "I thought I told you to leave.", 0, 0);
        return TRUE;
      case 147:
        do_say(guard, "This is the property of Takehero Tsuyama.. "
               "Trespassers are shot on sight.", 0, 0);
        return TRUE;
    }
    return FALSE;
  }

  if (CMD_IS("north")) {
    if (perform_move(ch, NORTH, LEADER, NULL) &&
        world[guard->in_room].number == MANSION_GATE) {
      if (!IS_SET(EXIT(guard, NORTH)->exit_info, EX_CLOSED))
        do_gen_door(guard, "gate", 0, SCMD_CLOSE);
      if (IS_SET(EXIT(guard, NORTH)->exit_info, EX_CLOSED)) {
        TOGGLE_BIT(EXIT(guard, NORTH)->exit_info, EX_CLOSED | EX_LOCKED);
        act("$n locks the gate.", FALSE, guard, 0, 0, TO_ROOM);
      }
    }
    return TRUE;
  } else if (CMD_IS("open") || CMD_IS("unlock") || CMD_IS("bypass")) {
    skip_spaces(&argument);
    if (!strcasecmp("gate", argument)) {
      do_say(guard, "Piddle off, I'm tryin' to do my job here.", 0, 0);
      return TRUE;
    }
  }
  return(FALSE);
}

SPECIAL(squirrel_park)
{
  if (cmd || !AWAKE(ch))
    return FALSE;

  switch (number(1,150)) {
    case 74:
      act("$n chatters quietly.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 148:
      act("$n munches happily on an acorn.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(sick_ork)
{
  struct char_data *vict;

  if (cmd || number(0,40))
    return FALSE;

  for(vict = world[ch->in_room].people; vict; vict = vict->next_in_room) {
    if (vict && CAN_SEE(ch, vict)) {
      act("$n turns to you curiously.  You can see vomit running down his "
          "chin.", FALSE, ch, 0, vict, TO_VICT);
      act("$n looks at $N in bewilderment.", FALSE, ch, 0, vict, TO_NOTVICT);
      act("You look at $N.  The sight of $M almost makes you puke.",
          FALSE, ch, 0, vict, TO_CHAR);
      if(!number(0,2)) {
        act("$n convulses quickly and pukes into the toilet, resulting in an "
            "odd-colored mess.", FALSE, ch, 0, 0, TO_ROOM);
        act("You suddenly feel very sick, your stomach twists, and you spew "
            "a strange arrangement of vomit into the toilet.",
            FALSE, ch, 0, 0, TO_CHAR);
      }
      return TRUE;
    }
  }
  return FALSE;
}

SPECIAL(mage_messenger)
{
  static bool already = FALSE;
  void reset_zone(int zone);
  struct char_data *messenger = (struct char_data *) me;
  struct char_data *dunkelzahn = get_char_room("dunkelzahn", messenger->in_room);
  struct char_data *vict;
  int i;

  if (CMD_IS("purge")) {
    do_say(messenger, "And just what do you think you're doing?!", 0, 0);
    return TRUE;
  } else if (ch == messenger && strstr(argument, "dunkelzahn") &&
      (CMD_IS("kill") || CMD_IS("hit") || CMD_IS("cast") ||
       CMD_IS("shoot"))) {
    send_to_char("How dare you even think of doing such a thing?!\r\n", ch);
    return TRUE;
  } else if (cmd)
    return FALSE;

  if (GET_PHYSICAL(messenger) < 400 || GET_MENTAL(messenger) < 400) {
    GET_PHYSICAL(messenger) = GET_MAX_PHYSICAL(messenger);
    GET_MENTAL(messenger) = GET_MAX_MENTAL(messenger);
    GET_POS(messenger) = POS_STANDING;
    act("$n appears rejuvenated.", FALSE, messenger, 0, 0, TO_ROOM);
    act("You feel rejuvenated!", FALSE, messenger, 0, 0, TO_CHAR);
  }

  if (!FIGHTING(messenger)) {
    for (vict = world[messenger->in_room].people; vict; vict = vict->next_in_room)
      if (world[messenger->in_room].number == 2
	  && !access_level(vict, LVL_BUILDER) && vict != messenger) {
        do_say(messenger, "Fiend!  Dare you intrude this sacred place?!", 0, 0);
        mob_cast(messenger, vict, NULL, SPELL_POWER_MISSILE, 0);
        return(TRUE);
      }
  } else switch(number(1,10)) {
    case 2:
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_HELLBLAST, 0);
      break;
    case 3:
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_POWER_DART, 0);
      break;
    case 4:
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);
      break;
    case 5:
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_MANA_DART, 0);
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_POWER_DART, 0);
      break;
    case 6:
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_RAM_TOUCH, 0);
      break;
    case 7:
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_DEATH_TOUCH, 0);
      break;
    case 8:
      mob_cast(messenger, FIGHTING(messenger), NULL, SPELL_HELLBLAST, 0);
  }

  if (!dunkelzahn && world[messenger->in_room].number != DUNKS_TRAILER &&
      !FIGHTING(messenger)) {
    act("$n utters ancient phrases and vanishes.", FALSE, messenger, 0, 0, TO_ROOM);
    act("You utter ancient phrases of power and vanish.", FALSE, messenger, 0, 0, TO_CHAR);
    char_from_room(messenger);
    char_to_room(messenger, real_room(DUNKS_TRAILER));
  }
  return(FALSE);
}

SPECIAL(adept_guard)
{
  struct char_data *vict;

  if (cmd)
    return(FALSE);

  if (!FIGHTING(ch)) {
    for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room) {
      if (vict != ch && CAN_SEE(ch, vict) && (IS_NPC(vict) ||
          (GET_REP(vict) > 10 && GET_LEVEL(vict) < LVL_LEGEND) &&
          world[ch->in_room].number == 4098)) {
        act("$n steps out from the shadows and touches $N!",
            FALSE, ch, 0, vict, TO_NOTVICT);
        act("A streak of pain courses through your body!",
            FALSE, ch, 0, vict, TO_VICT);
        act("Sensing an oppurtune moment, you come out of hiding and draw upon "
            "your mystic abilities to kill $N.", FALSE, ch, 0, vict, TO_CHAR);
        damage(ch, vict, 1, 0, PHYSICAL);
        return(TRUE);
      }
    }
    if (!IS_AFFECTED(ch, AFF_HIDE)) {
      act("$n fades out of sight.", FALSE, ch, 0, ch, TO_NOTVICT);
      act("You fade out of the sight of others.", FALSE, ch, 0, 0, TO_CHAR);
      SET_BIT(AFF_FLAGS(ch), AFF_HIDE);
      return(FALSE);
    }
  } else {
    vict = FIGHTING(ch);
    switch(number(1,20)) {
      case 8:
        act("As $n reaches touches you, you begin to feel numb.",
            FALSE, ch, 0, vict, TO_VICT);
        act("$n reaches out his hand and grabs onto $N!",
            FALSE, ch, 0, vict, TO_NOTVICT);
        act("You grab $N and let energy flow through him.",
            FALSE, ch, 0, vict, TO_CHAR);
        damage(ch, vict, number(0, 2), 0, PHYSICAL);
        return FALSE;
      case 12:
        mob_cast(ch, ch, NULL, SPELL_HEAL, MODERATE);
        return(TRUE);
    }
  }
  return(FALSE);
}

SPECIAL(takehero_tsuyama)
{
  struct char_data *tsuyama = (struct char_data *) me;
  struct char_data *vict;

  if (cmd || !AWAKE(tsuyama))
    return(FALSE);

  if (!FIGHTING(tsuyama)) {
    for(vict = world[tsuyama->in_room].people; vict; vict = vict->next_in_room) {
      if (vict != ch && CAN_SEE(tsuyama, vict) && (IS_NPC(vict) || (GET_REP(vict) > 19 &&
          GET_LEVEL(vict) < LVL_LEGEND) && number(0,3) && world[tsuyama->in_room].number == 4101)) {
        act("$n unsheathes his deadly katana, swiftly attacking $N!",
            FALSE, tsuyama, 0, vict, TO_NOTVICT);
        act("$n unsheathes his deadly katana, swiftly attacking you!",
            FALSE, tsuyama, 0, vict, TO_VICT);
        act("You unsheath your katana and switly attack $N!",
            FALSE, tsuyama, 0, vict, TO_CHAR);
        damage(tsuyama, vict, 2, TYPE_SLASH, PHYSICAL);
        return(TRUE);
      }
    }
    return FALSE;
  }

  if (GET_PHYSICAL(tsuyama) < GET_MAX_PHYSICAL(tsuyama) && !number(0, 4)) {
    mob_cast(tsuyama, tsuyama, NULL, SPELL_HEAL, MODERATE);
    return(TRUE);
  }

  for (vict = world[tsuyama->in_room].people; vict; vict = vict->next_in_room)
    if (FIGHTING(vict) == tsuyama && vict != FIGHTING(tsuyama) &&
        CAN_SEE(tsuyama, vict) && !number(0, 4)) {
      stop_fighting(tsuyama);
      set_fighting(tsuyama, vict);
      return FALSE;
    }
  return FALSE;
}

SPECIAL(aegnor)
{
  struct char_data *vict;
  int dist, dir, range = 0, room, nextroom;

  if (cmd || !AWAKE(ch) || FIGHTING(ch))
    return FALSE;

  if (GET_EQ(ch, WEAR_WIELD) && GET_WIELDED(ch, 0))
    range = find_weapon_range(ch, GET_EQ(ch, WEAR_WIELD));
  if (GET_EQ(ch, WEAR_HOLD) && GET_WIELDED(ch, 1))
    range = MAX(range, find_weapon_range(ch, GET_EQ(ch, WEAR_HOLD)));
  range = MIN(range, find_sight(ch));

  for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room)
    if (!IS_NPC(vict) && CAN_SEE(ch, vict) && FIGHTING(vict) &&
        IS_NPC(FIGHTING(vict))) {
      act("$n sneers at you and attacks!", FALSE, ch, 0, vict, TO_VICT);
      act("$n sneers at $N and attacks $M!", TRUE, ch, 0, vict, TO_NOTVICT);
      act("You sneer at $N and attack $M!", FALSE, ch, 0, vict, TO_CHAR);
      set_fighting(ch, vict);
      return TRUE;
    }

  for (dir = 0; dir < (NUM_OF_DIRS - 1); dir++) {
    room = ch->in_room;
    if (CAN_GO2(room, dir))
      nextroom = EXIT2(room, dir)->to_room;
    else nextroom = NOWHERE;

    for (dist = 1; nextroom != NOWHERE && dist <= range; dist++) {
      for (vict = world[nextroom].people; vict; vict = vict->next_in_room)
        if (!IS_NPC(vict) && CAN_SEE(ch, vict) && FIGHTING(vict) &&
            IS_NPC(FIGHTING(vict))) {
          act("You see $n sneer at you from the bar and attack!",
              FALSE, ch, 0, vict, TO_VICT);
          act("$n sneers at someone in the distance and attacks!",
              TRUE, ch, 0, 0, TO_ROOM);
          act("You sneer at $N and attack $M!", FALSE, ch, 0, vict, TO_CHAR);
          set_fighting(ch, vict);
          return TRUE;
        }

      room = nextroom;
      if (CAN_GO2(room, dir))
        nextroom = EXIT2(room, dir)->to_room;
      else nextroom = NOWHERE;
    }
  }
  return FALSE;
}

SPECIAL(branson)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch (number(0, 60)) {
    case 0:
      do_say(ch, "As Chief Executive, it is my job to keep this company in line.", 0, 0);
      return TRUE;
    case 1:
      do_say(ch, "Do you understand what I'm trying to do? Do you?", 0, 0);
      return TRUE;
    case 2:
      do_say(ch, "Noone else has a character to rival mine.", 0, 0);
      return TRUE;
    case 3:
      act("$n switches the trid to CNN and checks the latest stock updates.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(harlten)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch (number(0, 60)) {
    case 0:
      act("$n straightens his tie and smiles meekly in the mirror.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 1:
      do_say(ch, "We here at BioHyde aim to make you a better person, "
                 "physically and spiritually.", 0, 0);
      return TRUE;
    case 2:
      act("$n screams at his secretary for more Macadamia coffee.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(bio_guard)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch (number(0, 100)) {
    case 0:
      do_say(ch, "These premises are closed. Access is only permitted to "
                 "those with security passes.", 0, 0);
      return TRUE;
    case 1:
      do_say(ch, "Hey! What you looking for? Trouble?", 0, 0);
      return TRUE;
    case 2:
      act("Seeking another nicotine hit, the guard sparks a cigarette.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 3:
      do_say(ch, "If you would like a tour of the building, call our "
                 "Customer Service Desk.", 0, 0);
      return TRUE;
    case 4:
      act("$n polishes the huge machine gun at his side.",
           FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(worker)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch (number(0, 60)) {
    case 0:
      act("$n rushes around the room, hurriedly grabbing papers.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 1:
      do_say(ch, "The stress! THE STRESS!", 0, 0);
      return TRUE;
    case 2:
      act("Finding a sudden free moment, $n lights a cigarette to calm his "
          "nerves.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(pool)
{
  struct char_data *pool = (char_data *) me;
  struct char_data *foo = get_char_room("foo", ch->in_room);

  if (!cmd) {
    if (foo) {
      if (GET_POS(pool) == POS_SLEEPING) {
        GET_POS(pool) = POS_STANDING;
        act("$n senses the arrival of $s master and awakens.",
            FALSE, pool, 0, 0, TO_ROOM);
        return TRUE;
      }
      if (!IS_AFFECTED(pool, AFF_CHARM)) {
        SET_BIT(AFF_FLAGS(pool), AFF_CHARM);
        add_follower(pool, foo);
      } else if (pool->in_room != foo->in_room) {
        act("$n whines pitifully and vanishes.", FALSE, pool, 0, 0, TO_ROOM);
        char_from_room(pool);
        char_to_room(pool, real_room(FOOS_LAIR));
        return TRUE;
      }
    } else if (GET_POS(pool) != POS_SLEEPING) {
      if (pool->in_room != real_room(FOOS_LAIR)) {
        act("$n whines pitifully and vanishes.", FALSE, pool, 0, 0, TO_ROOM);
        char_from_room(pool);
        char_to_room(pool, real_room(FOOS_LAIR));
      }
      act("$n frowns and goes to sleep.", FALSE, pool, 0, 0, TO_ROOM);
      GET_POS(pool) = POS_SLEEPING;
      return TRUE;
    }
    return FALSE;
  } else {
    char *arg = one_argument(argument, buf2);

    if(!*buf2)
      return FALSE;

    struct char_data *vict;

    if(!(vict = get_char_room(buf2, ch->in_room)))
      return FALSE;

    if(!(vict == pool))
      return FALSE;

    if (CMD_IS("kiss") || CMD_IS("hug") || CMD_IS("snuggle") ||
        CMD_IS("nuzzle") || CMD_IS("scratch") || CMD_IS("ruffle") || CMD_IS("embrace")) {
      switch (number(1, 6)) {
        case 1:
          act("$n playfully nuzzles your hand.", 1, pool, 0, ch, TO_VICT);
          act("$n playfully nuzzles $N's hand.", 1, pool, 0, ch, TO_NOTVICT);
          act("You playfully nuzzles $N's hand.", 1, pool, 0, ch, TO_CHAR);
          return TRUE;
        case 2:
          act("$n bubbles and yawns contentedly.", TRUE, pool, 0, 0, TO_ROOM);
          return TRUE;
        case 3:
          act("$n purrs contentedly.", TRUE, pool, 0, 0, TO_ROOM);
          return TRUE;
        case 4:
          act("$n yawns and stretches luxuriously.", TRUE, pool, 0, 0, TO_ROOM);
          return TRUE;
        case 5:
          act("$n starts to purr loudly.", TRUE, pool, 0, 0, TO_ROOM);
          return TRUE;
        case 6:
          act("$n rubs against your legs.", 1, pool, 0, 0, TO_CHAR);
          act("$n rubs against $N's legs.", 1, pool, 0, ch, TO_NOTVICT);
          act("$n rubs against your legs.", 1, pool, 0, ch, TO_VICT);
          return TRUE;
      }
    }
  }
  return FALSE;
}

SPECIAL(wendigo)
{
  struct char_data *wendigo = (char_data *) me;
  struct obj_data *obj;
  bool found = FALSE;

  if (!AWAKE(ch) || (GET_POS(ch) == POS_FIGHTING))
    return(FALSE);

  if (!cmd)
    switch(number(1,160)) {
      case 12:
        do_say(ch, "Look, no invitation, no entry. It's that simple.", 0, 0);
        return TRUE;
      case 92:
        do_say(ch, "You're a friend of who? Nice try chummer.", 0, 0);
        return TRUE;
      case 147:
        act("As someone tries to sneak in, $n grabs them by the collar and "
            "chucks them down the alley.", FALSE, ch, 0, 0, TO_ROOM);
        return TRUE;
      default:
        return FALSE;
    }

  if ((CMD_IS("north") || CMD_IS("enter")) && CAN_SEE(wendigo, ch) && world[wendigo->in_room].number == 4503) {
    for (obj = ch->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_VNUM(obj) == 4517)
        found = TRUE;

    if (found)
      perform_move(ch, NORTH, LEADER, NULL);
    else do_say(wendigo, "Hey chummer, invitation needed.", 0, 0);
    return(TRUE);
  }

  return(FALSE);
}

SPECIAL(pimp)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch(number(1,160)) {
    case 12:
      do_say(ch, "Hey chummer, you want some girls? I got girls.", 0, 0);
      return TRUE;
    case 92:
      do_say(ch, "All my girls are clean, no BTL or any shit like that.", 0, 0);
      return TRUE;
    case 147:
      act("Sweating under the heat of the room, $n grabs his handkerchief "
          "and pats his forehead.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(prostitute)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch(number(1,160)) {
    case 12:
      do_say(ch, "Hey baby, you looking for a good time?", 0, 0);
      return TRUE;
    case 92:
      do_say(ch, "2000 nuyen for a good time!", 0, 0);
      return TRUE;
    case 147:
      act("$n entices you, revealing more than enough cleavage.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return(FALSE);
}

SPECIAL(heinrich)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch(number(1,160)) {
    case 12:
      do_say(ch, "What'll it be today then?", 0, 0);
      return TRUE;
    case 92:
      do_say(ch, "There was some suits in here asking for you. I told em you "
                 "ain't been around.", 0, 0);
      return TRUE;
    case 147:
      act("$n grabs a pint glass from under the counter and serves a punter "
          "the local brew.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(ignaz)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch(number(1,160)) {
    case 12:
      do_say(ch, "Hey you! Let's have a fight. I'm serious.", 0, 0);
      return TRUE;
    case 92:
      do_say(ch, "What a show! You see that cute one over there?", 0, 0);
      return TRUE;
    case 147:
      act("$n rocks back and forth in his chair, throwing random beer "
          "bottles at unlucky punters.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(waitress)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch(number(1,160)) {
    case 12:
      do_say(ch, "So what you want to eat eh?", 0, 0);
      return TRUE;
    case 92:
      do_say(ch, "That's three kegs of beer, five chickens, and a garlic "
                 "bread.", 0, 0);
      return TRUE;
    case 147:
      act("$n listens carefully to a clearly drunken madman, scribbling down "
          "random orders.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(tunnel_rat)
{
  if (cmd || FIGHTING(ch) || !AWAKE(ch))
    return 0;

  switch(number(1,160)) {
    case 12:
      act("$n nibbles on a small child sized bone.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 92:
      act("$n squeaks quietly in the darkness.", FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
    case 147:


      act("$n runs between your legs and on into the blackness.",
          FALSE, ch, 0, 0, TO_ROOM);
      return TRUE;
  }
  return FALSE;
}

SPECIAL(dracula)
{
  struct char_data *vict;

  if (cmd || GET_POS(ch) != POS_FIGHTING)
    return FALSE;

  for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room)
    if (FIGHTING(vict) == ch && !number(0, 4))
      break;

  if (vict == NULL)
    vict = FIGHTING(ch);

  if ((GET_REP(ch) > 22) && !number(0, 10))
    mob_cast(ch, vict, NULL, SPELL_POWERBLAST, 0);

  if ((GET_REP(ch) > 10) && !number(0, 8))
    mob_cast(ch, vict, NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);

  if ((GET_REP(ch) > 20) && !number(0, 12))
      mob_cast(ch, vict, NULL, SPELL_HELLBLAST, 0);

  if (number(0, 4))
    return TRUE;

  mob_cast(ch, vict, NULL, SPELL_HELLBLAST, 0);

  return TRUE;
}

SPECIAL(pandemonia)
{
  struct char_data *vict;

  if (cmd || GET_POS(ch) != POS_FIGHTING)
    return FALSE;

  for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room)
    if (FIGHTING(vict) == ch && !number(0, 4))
      break;

  if (vict == NULL)
    vict = FIGHTING(ch);

  if ((GET_REP(ch) > 22) && (number(0, 10) == 0))
    mob_cast(ch, vict, NULL, SPELL_RAM_TOUCH, 0);

  if ((GET_REP(ch) > 10) && (number(0, 8) == 0))
    mob_cast(ch, vict, NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);

  if ((GET_REP(ch) > 20) && (number(0, 12) == 0)) {
    if (IS_EVIL(ch))
      mob_cast(ch, vict, NULL, SPELL_HELLBLAST, 0);
    else if (IS_GOOD(ch))
      mob_cast(ch, vict, NULL, SPELL_DEATH_TOUCH, 0);
  }
  if (number(0, 4))
    return TRUE;

  mob_cast(ch, vict, NULL, SPELL_ELEMENTBALL, SPELL_ELEMENT_FIRE);

  return TRUE;
}

SPECIAL(saeder_guard)
{
  struct char_data *guard = (char_data *) me;
  struct obj_data *obj;
  ACMD(do_gen_door);
  bool found = FALSE;

  if (!AWAKE(guard) || (GET_POS(guard) == POS_FIGHTING))
    return(FALSE);

  if (CMD_IS("east") && CAN_SEE(guard, ch) && world[guard->in_room].number == 4930) {
    for (obj = ch->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_VNUM(obj) == 4914)
        found = TRUE;

    if (found)
      perform_move(ch, EAST, LEADER, NULL);
    else do_say(guard, "No pass, no entry.", 0, 0);
    return(TRUE);
  }

  return(FALSE);
}

SPECIAL(atomix)
{
  struct char_data *atomix = (struct char_data *) me;

  if (CMD_IS("buy")) {
   skip_spaces(&argument);
   if (!*argument || !CAN_SEE(atomix, ch) || number(0, 3) || str_cmp(argument, "guns") != 0)
      return(FALSE);

    act("$n says, \"Oh, so you int'rested in da biz?\"",
        FALSE, atomix, 0, ch, TO_VICT);
    act("$n unlocks and opens the door, and shoves you through.",
        FALSE, atomix, 0, ch, TO_VICT);
    act("$n opens the door and casually shoves $M through it.",
        TRUE, atomix, 0, ch, TO_NOTVICT);
    act("You say, \"Oh, so you int'rested in da biz?\"",
        FALSE, atomix, 0, 0, TO_CHAR);
    act("You open the door and grab $N, ruthlessly tossing $M through it.",
        FALSE, atomix, 0, ch, TO_CHAR);
    char_from_room(ch);
    char_to_room(ch, real_room(4598));
    look_at_room(ch, 0);
    act("The door closes behind you.", FALSE, atomix, 0, ch, TO_VICT);
    return (TRUE);
  }
  return(FALSE);
}

SPECIAL(crime_mall_guard)
{
  if (!cmd)
    return FALSE;

  struct char_data *guard = (struct char_data *) me;

  if ((world[guard->in_room].number == 10075 && CMD_IS("east")) ||
      (world[guard->in_room].number == 10077 && CMD_IS("west"))) {
    if (GET_NUYEN(ch) < 2000000) {
      act("$n shakes $s head as $e stops you.  \"Not this time, chummer.\"",
          FALSE, guard, 0, ch, TO_VICT);
      act("You shake your head as $N tries to sneak past you.",
          FALSE, guard, 0, ch, TO_CHAR);
      return TRUE;
    } else {
      act("$n gives you one final look, and lets you pass.",
          FALSE, guard, 0, ch, TO_VICT);
      act("As $N finally got 2M nuyen, you let $M pass.",
          FALSE, guard, 0, ch, TO_CHAR);
      return FALSE;
    }
  }
  return FALSE;
}

SPECIAL(hacker)
{
  struct char_data *hacker = (struct char_data *) me, *vict;
  struct obj_data *obj;
  int amount, nuyen;

  if (CMD_IS("value")) {
    if (!*argument) {
      send_to_char("Value what?\r\n", ch);
      return TRUE;
    } else if (!AWAKE(hacker))
      return(FALSE);
    else if (!CAN_SEE(hacker, ch)) {
      do_say(hacker, "I don't deal with people I can't see!", 0, 0);
      return(TRUE);
    }

    skip_spaces(&argument);
    if (!(obj = get_obj_in_list_vis(ch, argument, ch->carrying))) {
        sprintf(buf, "You don't seem to have %s %s.\r\n", AN(argument), argument);
        send_to_char(buf, ch);
      return(TRUE);
    }
    if (GET_OBJ_TYPE(obj) != ITEM_MONEY || !GET_OBJ_VAL(obj, 1) || GET_OBJ_VAL(obj, 0) <= 0 ||
        !GET_OBJ_VAL(obj, 4) || belongs_to(ch, obj)) {
      perform_tell(hacker, ch, "Why are you bringing this to me?");
      return TRUE;
    }
    if (GET_OBJ_VAL(obj, 2) == 1)
      amount = (int)(GET_OBJ_VAL(obj, 0) / 8);
    else if (GET_OBJ_VAL(obj, 2) == 2)
      amount = (int)(GET_OBJ_VAL(obj, 0) / 5);
    else amount = (int)(GET_OBJ_VAL(obj, 0) / 3);
    sprintf(arg, "I'd charge about %d nuyen for that.", amount);
    perform_tell(hacker, ch, arg);
    return TRUE;
  } else if (CMD_IS("give")) {
    if (!*argument) {
      send_to_char("Give what to whom?\r\n", ch);
      return TRUE;
    }
    any_one_arg(any_one_arg(argument, buf), buf1);

    if (!(obj = get_obj_in_list_vis(ch, buf, ch->carrying))) {
      sprintf(arg, "You don't seem to have %s %s.\r\n", AN(buf), buf);
      send_to_char(arg, ch);
      return(TRUE);
    } else if (!(vict = give_find_vict(ch, buf1)))
      return TRUE;

    if (vict != hacker || !AWAKE(hacker))
      return FALSE;
    else if (!CAN_SEE(hacker, ch)) {
      do_say(hacker, "I don't deal with people I can't see!", 0, 0);
      return(TRUE);
    }

    if (GET_OBJ_TYPE(obj) != ITEM_MONEY
	|| !GET_OBJ_VAL(obj, 1)
	|| GET_OBJ_VAL(obj, 0) <= 0
	|| !GET_OBJ_VAL(obj, 4)
	|| belongs_to(ch, obj)) {
      perform_tell(hacker, ch, "Why are you bringing this to me?");
      return TRUE;
    }

    if (!perform_give(ch, hacker, obj))
      return TRUE;

    if (GET_OBJ_VAL(obj, 2) == 1)
      amount = (int)(GET_OBJ_VAL(obj, 0) / 8);
    else if (GET_OBJ_VAL(obj, 2) == 2)
      amount = (int)(GET_OBJ_VAL(obj, 0) / 5);
    else amount = (int)(GET_OBJ_VAL(obj, 0) / 3);
    nuyen = resisted_test(GET_SKILL(ch, SKILL_NEGOTIATION), GET_CHA(hacker),
                          GET_SKILL(hacker, SKILL_NEGOTIATION), GET_CHA(ch));
    if (nuyen > 0)
      amount = MAX((int)(amount * 3/4), (int)(amount - (nuyen * (amount / 15))));
    else amount = MIN((int)(amount * 5/4), (int)(amount + (nuyen * (amount / 15))));
    nuyen = GET_OBJ_VAL(obj, 0) - amount;
    GET_BANK(hacker) += amount;
    GET_BANK(ch) += nuyen;
    sprintf(buf1,"Updated.  %d nuyen transferred to your bank account.",
	    nuyen);
    perform_tell(hacker, ch, buf1);
    extract_obj(obj);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(fence)
{
  struct char_data *fence = (struct char_data *) me;
  struct obj_data *obj;
  int value;

  if (CMD_IS("sell")) {
    if (!*argument) {
      send_to_char("Sell what?\r\n", ch);
      return(TRUE);
    }
    if (!AWAKE(fence))
      return(FALSE);
    if (!CAN_SEE(fence, ch)) {
      do_say(fence, "I don't buy from someone I can't see!", 0, 0);
      return(TRUE);
    }

    skip_spaces(&argument);
    if (!(obj = get_obj_in_list_vis(ch, argument, ch->carrying))) {
        sprintf(buf, "You don't seem to have %s %s.\r\n", AN(argument), argument);
        send_to_char(buf, ch);
      return(TRUE);
    }
    if (!(GET_OBJ_TYPE(obj) == ITEM_DECK_ACCESSORY && GET_OBJ_VAL(obj, 0) == TYPE_FILE)) {
      act("You say, \"I only buy datafiles, chummer.\"", FALSE, fence, 0, 0, TO_CHAR);
      act("$n says, \"I only buy datafiles, chummer.\"", FALSE, fence, 0, ch, TO_VICT);
      return(TRUE);
    }
    value = 250 * GET_OBJ_VAL(obj, 1) * GET_OBJ_VAL(obj, 2) * GET_OBJ_VAL(obj, 3) + ((number(0,1) ?
            50 : -50) * GET_OBJ_VAL(obj, 1) * GET_OBJ_VAL(obj, 2) * GET_OBJ_VAL(obj, 3));
    if (!value) {
      act("$n spits on $N and mutters something unintelligible.",
          TRUE, fence, 0, ch, TO_NOTVICT);
      act("$n spits on you and says, \"Don't even try to sell me a public "
          "access file!\"", FALSE, fence, 0, ch, TO_VICT);
      act("You spit on $N and say, \"Don't even try to sell me a public "
          "access file!\"", TRUE, fence, 0, ch, TO_CHAR);
      return TRUE;
    }
    GET_NUYEN(ch) += value;
    obj_from_char(obj);
    extract_obj(obj);
    sprintf(buf, "%s says, \"Here's your %d creds.\"", GET_NAME(fence), value);
    send_to_char(buf, ch);
    act("You grab the data disk and pay $M for it.", TRUE, fence, 0, ch, TO_CHAR);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(fixer)
{
  struct char_data *fixer = (struct char_data *) me;
  struct obj_data *obj, *credstick = NULL;
  int cost;
  sh_int cash = 0, extra, hour, day = 0, pm = 0;

  if (cmd && !CMD_IS("repair") && !CMD_IS("list") && !CMD_IS("receive"))
    return FALSE;

  if (cmd && (!AWAKE(fixer) || IS_NPC(ch)))
    return FALSE;
  if (cmd && !CAN_SEE(fixer, ch)) {
    do_say(fixer, "I don't deal with someone I can't see!", 0, 0);
    return TRUE;
  }

  if (CMD_IS("repair")) {
    any_one_arg(argument, buf);
    skip_spaces(&argument);

    if (!str_cmp(buf, "cash")) {
      argument = any_one_arg(argument, buf);
      skip_spaces(&argument);
      cash = 1;
    } else if (!(credstick = get_first_credstick(ch, "credstick"))) {
      perform_tell(fixer, ch, "You need a credstick to do that!");
      return TRUE;
    }
    if (!(obj = get_obj_in_list_vis(ch, argument, ch->carrying))) {
      sprintf(buf, "You don't seem to have %s %s.\r\n", AN(argument), argument);
      send_to_char(buf, ch);
      return TRUE;
    }
    if (IS_OBJ_STAT(obj, ITEM_CORPSE) || IS_OBJ_STAT(obj, ITEM_IMMLOAD)) {
      perform_tell(fixer, ch, "I can't repair that.");
      return TRUE;
    }
    if (GET_OBJ_CONDITION(obj) >= GET_OBJ_BARRIER(obj)) {
      sprintf(arg, "%s doesn't need to be repaired!", CAP(obj->short_description));
      perform_tell(fixer, ch, arg);
      return TRUE;
    }
    if ((IS_CARRYING_N(fixer) >= CAN_CARRY_N(fixer)) ||
        ((GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(fixer)) > CAN_CARRY_W(fixer))) {
      perform_tell(fixer, ch, "I've got my hands full...come back later.");
      return TRUE;
    }
    cost = (int)((GET_OBJ_COST(obj) / (2 * GET_OBJ_BARRIER(obj))) *
           (GET_OBJ_BARRIER(obj) - GET_OBJ_CONDITION(obj)));
    if ((cash ? GET_NUYEN(ch) : GET_OBJ_VAL(credstick, 0)) < cost) {
      perform_tell(fixer, ch, "You can't afford to repair that!");
      return TRUE;
    }
    if (!perform_give(ch, fixer, obj))
      return TRUE;
    if (cash)
      GET_NUYEN(ch) -= cost;
    else
      GET_OBJ_VAL(credstick, 0) -= cost;
    extra = (int)((GET_OBJ_BARRIER(obj) - GET_OBJ_CONDITION(obj)) / 2);
    if (((GET_OBJ_BARRIER(obj) - GET_OBJ_CONDITION(obj)) % 2) > 0)
      extra++;
    if ((time_info.hours + extra) > 23)
      day = 1;
    else pm = ((time_info.hours + extra) >= 12);
    hour = ((time_info.hours + extra) % 12 == 0 ? 12 :
           (time_info.hours + extra) % 12);
    sprintf(arg, "That'll be %d nuyen.  Should be ready by about %d %s%s.",
            cost, hour, pm ? "PM" : "AM", day ? " tomorrow" : "");
    perform_tell(fixer, ch, arg);
    GET_OBJ_TIMER(obj) = GET_IDNUM(ch);
    fixers_need_save = 1;
    return TRUE;
  } else if (CMD_IS("list")) {
    bool found = FALSE;
    for (obj = fixer->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_TIMER(obj) == GET_IDNUM(ch)) {
        if (!found) {
          perform_tell(fixer, ch, "I currently am in possession of the "
                                  "following:");
          found = TRUE;
        }
        if (GET_OBJ_CONDITION(obj) < GET_OBJ_BARRIER(obj)) {
          hour = (int)((GET_OBJ_BARRIER(obj) - GET_OBJ_CONDITION(obj)) / 2);
          if (((GET_OBJ_BARRIER(obj) - GET_OBJ_CONDITION(obj)) % 2) > 0)
            hour++;
          send_to_char(ch, "%-59s Status: %d hour%s\r\n",
                       obj->short_description, hour, hour == 1 ? "" : "s");
        } else send_to_char(ch, "%-59s Stats: Ready\r\n",
                            obj->short_description);
      }
    if (!found)
      perform_tell(fixer, ch, "I don't have anything of yours.");
    return TRUE;
  } else if (CMD_IS("receive")) {
    int j = 0;
    char tmpvar[LINE_LENGTH], *temp = tmpvar;
    any_one_arg(argument, temp);

    if (!*temp) {
      perform_tell(fixer, ch, "What do you want to retrieve?");
      return TRUE;
    }
    if (!(extra = get_number(&temp))) {
      perform_tell(fixer, ch, "I don't have anything like that.");
      return TRUE;
    }
    for (obj = fixer->carrying; obj && j <= extra; obj = obj->next_content)
      if (GET_OBJ_TIMER(obj) == GET_IDNUM(ch) && isname(temp, obj->name))
        if (++j == extra)
          break;
    if (!obj) {
      perform_tell(fixer, ch, "I don't have anything like that.");
      return TRUE;
    }
    if (GET_OBJ_CONDITION(obj) < GET_OBJ_BARRIER(obj)) {
      sprintf(arg, "%s isn't ready yet.", CAP(obj->short_description));
      perform_tell(fixer, ch, arg);
      return TRUE;
    }
    if ((IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) ||
        ((GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(ch)) > CAN_CARRY_W(ch))) {
      perform_tell(fixer, ch, "You can't carry it right now.");
      return TRUE;
    }
    if (!perform_give(fixer, ch, obj)) {
      perform_tell(fixer, ch, "That's odd...I can't let go of it.");
      return TRUE;
    }
    fixers_need_save = 1;
    return TRUE;
  }

  // update his objects every 60 rl seconds (30 mud minutes)
  if (GET_SPARE1(fixer) >= 6) {
    for (obj = fixer->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_CONDITION(obj) < GET_OBJ_BARRIER(obj))
        GET_OBJ_CONDITION(obj)++;
    GET_SPARE1(fixer) = 1;
    fixers_need_save = 1;
  } else GET_SPARE1(fixer)++;
  return FALSE;
}

SPECIAL(doctor_scriptshaw)
{
  if (cmd || FIGHTING(ch) || GET_POS(ch) <= POS_SLEEPING)
    return FALSE;

  if (GET_ACTIVE(ch) < 0 || GET_ACTIVE(ch) > 12)
    GET_ACTIVE(ch) = 0;

  switch (GET_ACTIVE(ch)) {
    case 0:
      do_say(ch, "Back in those days no one knew what was up there...", 0, 0);
      break;
    case 1:
      do_say(ch, "I know what is up there...", 0, 0);
      break;
    case 2:
      do_say(ch, "I saw it...", 0, 0);
      break;
    case 3:
      do_say(ch, "They say it made me go mad...", 0, 0);
      break;
    case 4:
      do_say(ch, "But I'll show them who's mad...", 0, 0);
      break;
    case 5:
      act("You cackle gleefully.", FALSE, ch, 0, 0, TO_CHAR);
      act("$n throws back his head and cackles with insane glee!",
          TRUE, ch, 0, 0, TO_ROOM);
      break;
  }
  GET_ACTIVE(ch)++;
  return FALSE;
}

SPECIAL(huge_troll)
{
  struct char_data *troll = (struct char_data *) me;
  struct obj_data *obj;

  if (CMD_IS("west") && world[troll->in_room].number == 9437 && CAN_SEE(troll, ch)) {
    for (obj = ch->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_VNUM(obj) == 9412)
        break;

    if (!obj) {
      act("As you try to exit, you notice you can't get by $N.",
          FALSE, ch, 0, troll, TO_CHAR);
      act("Try as $e might, $n can't get by $N.", TRUE, ch, 0, troll, TO_NOTVICT);
      act("$n takes one look at you, then decides to find another route.",
          FALSE, ch, 0, troll, TO_VICT);
      return TRUE;
    } else {
      act("$N moves slightly, creating just enough room for you to slip by.",
          FALSE, ch, 0, troll, TO_CHAR);
      act("$N moves slightly, creating just enough room for $n to slip by.",
          FALSE, ch, 0, troll, TO_NOTVICT);
      act("You move slightly, creating just enough room for $n to slip by.",
          FALSE, ch, 0, troll, TO_VICT);
    }
  }
  return FALSE;
}

SPECIAL(purple_haze_bartender)
{
  if (cmd)
    return FALSE;

  switch (number(0, 18)) {
    case NORTH:
      if (world[ch->in_room].number == 1844 ||
          world[ch->in_room].number == 1846) {
        perform_move(ch, NORTH, CHECK_SPECIAL | LEADER, NULL);
        return TRUE;
      }
      break;
    case SOUTH:
      if (world[ch->in_room].number == 1844 ||
          world[ch->in_room].number == 1845) {
        perform_move(ch, SOUTH, CHECK_SPECIAL | LEADER, NULL);
        return TRUE;
      }
      break;
  }
  return FALSE;
}

/* Special procedures for weapons                                    */

WSPEC(monowhip)
{
  int skill, dam_total;

  if (dam < 1 && !number(0, 1)) {
    if (!GET_SKILL(ch, SKILL_WHIPS_FLAILS))
      skill = GET_SKILL(ch, SKILL_ARMED_COMBAT);
    else
      skill = GET_SKILL(ch, SKILL_WHIPS_FLAILS);
    if (!success_test(skill, 6)) {
      act("Your whip flails out of control, striking you instead of $N!", FALSE, ch, 0, vict, TO_CHAR);
      act("$n's whip completely misses and recoils to hit $m!", TRUE, ch, 0, 0, TO_ROOM);
      dam_total = convert_damage(stage(-(success_test(GET_BOD(ch) + GET_DEFENSE(ch),
                                 GET_OBJ_VAL(weapon, 0))), GET_OBJ_VAL(weapon, 1)));


      damage(ch, ch, dam_total, TYPE_RECOIL, PHYSICAL);
      return TRUE;
    }
  }
  return FALSE;
}

/* ********************************************************************
*  Special procedures for objects                                     *
******************************************************************** */

SPECIAL(emerald_chalice)
{
  struct obj_data *chalice;

  if (!CMD_IS("drink"))
    return FALSE;

  one_argument(argument, arg);

  if (!*arg)
    return FALSE;

  if (!(chalice = get_obj_in_list_vis(ch, arg, ch->carrying)))
    return FALSE;

  if (GET_OBJ_VNUM(chalice) != 4507 || number(0, 39) || (GET_COND(ch, DRUNK) > 10 &&
      GET_COND(ch, THIRST) > 0) || (GET_COND(ch, FULL) > 20 &&
      GET_COND(ch, THIRST) > 0) || !GET_OBJ_VAL(chalice, 1))
    return FALSE;

  sprintf(buf, "$n drinks %s from $p, and appears slightly refreshed.", drinks[GET_OBJ_VAL(chalice, 2)]);
  act(buf, TRUE, ch, chalice, 0, TO_ROOM);
  sprintf(buf, "As you drink the %s, you feel refreshed!\r\n", drinks[GET_OBJ_VAL(chalice, 2)]);
  send_to_char(buf, ch);
  GET_PHYSICAL(ch) = MIN(GET_MAX_PHYSICAL(ch), GET_PHYSICAL(ch) + number(100,200));
  GET_OBJ_VAL(chalice, 1)--;
  return TRUE;
}

SPECIAL(inky_pendant)
{
  struct obj_data *obj = (struct obj_data *) me;

  if (!obj->worn_by || cmd || number(0, 199))
    return(FALSE);

  if (AFF_FLAGGED(obj->worn_by, AFF_INVISIBLE | AFF_IMP_INVIS) ||
       GET_POS(obj->worn_by) == POS_FIGHTING || GET_POS(obj->worn_by) < POS_RESTING)
    return(FALSE);

  SET_BIT(AFF_FLAGS(obj->worn_by), AFF_INVISIBLE);
  sprintf(buf, "%s glows briefly, filling you with a slight chill.", CAP(obj->short_description));
  act(buf, FALSE, obj->worn_by, 0, 0, TO_CHAR);
  act("$n winks out of visibility.", FALSE, obj->worn_by, 0, 0, TO_ROOM);
  return(TRUE);
}

SPECIAL(vending_machine)
{
  if (!CMD_IS("buy") && !CMD_IS("list"))
    return FALSE;

  struct obj_data *obj = (struct obj_data *) me, *temp;
  int found = 0;

  if (CMD_IS("list")) {
    act("$p is able to dispense:", FALSE, ch, obj, 0, TO_CHAR);
    for (temp = obj->contains; temp; temp = temp->next_content)
      if (GET_OBJ_TYPE(temp) == ITEM_FOOD || GET_OBJ_TYPE(temp) == ITEM_DRINKCON) {
        send_to_char(ch, "    %-30s     %3d\r\n", temp->short_description, GET_OBJ_COST(temp));
        found = 1;
      }
    if (!found)
      send_to_char(ch, "    Nothing!\r\n");
    return TRUE;
  } else {
    any_one_arg(argument, arg);
    for (temp = obj->contains; temp; temp = temp->next_content)
      if ((GET_OBJ_TYPE(temp) == ITEM_FOOD || GET_OBJ_TYPE(temp) == ITEM_DRINKCON) &&
          isname(arg, temp->name)) {
        if (GET_NUYEN(ch) < GET_OBJ_COST(temp)) {
          act("You can't afford $p!", FALSE, ch, temp, 0, TO_CHAR);
          return TRUE;
        }
        GET_NUYEN(ch) -= GET_OBJ_COST(temp);
        temp = read_object(GET_OBJ_RNUM(temp), REAL);
        old_obj_to_char(temp, ch);
        act("$n buys $p from $P.", FALSE, ch, temp, obj, TO_ROOM);
        act("You now have $p.", FALSE, ch, temp, 0, TO_CHAR);
        return TRUE;
      }
    sprintf(buf, "%s doesn't sell '%s'.\r\n", obj->short_description, arg);
    send_to_char(buf, ch);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(hand_held_scanner)
{
  struct char_data *temp;
  struct obj_data *scanner = (struct obj_data *) me;
  int i, dir;

  if (!cmd || !scanner->worn_by || number(1, 10) > 4)
    return FALSE;

  if (CMD_IS("north"))
    dir = NORTH;
  else if (CMD_IS("northeast") || CMD_IS("ne"))
    dir = NORTHEAST;
  else if (CMD_IS("east"))
    dir = EAST;
  else if (CMD_IS("southeast") || CMD_IS("se"))
    dir = SOUTHEAST;
  else if (CMD_IS("south"))
    dir = SOUTH;
  else if (CMD_IS("southwest") || CMD_IS("sw"))
    dir = SOUTHWEST;
  else if (CMD_IS("west"))
    dir = WEST;
  else if (CMD_IS("northwest") || CMD_IS("nw"))
    dir = NORTHWEST;
  else if (CMD_IS("up"))
    dir = UP;
  else if (CMD_IS("down"))
    dir = DOWN;
  else return FALSE;

  if (world[ch->in_room].dir_option[dir] &&
      world[ch->in_room].dir_option[dir]->to_room != NOWHERE) {
    for (i = NORTH; i < MATRIX; i++)
      if (world[ch->in_room].dir_option[i] &&
          world[ch->in_room].dir_option[i]->to_room != NOWHERE)
        for (temp = world[world[ch->in_room].dir_option[i]->to_room].people;
             temp; temp = temp->next_in_room)
          if (IS_NPC(temp)) {
            act("You feel $p vibrate momentarily.", FALSE, ch, scanner, 0, TO_CHAR);
            return FALSE;
          }
  }

  return FALSE;
}

SPECIAL(clock)
{
  struct obj_data *clock = (struct obj_data *) me;

  if (!cmd || !CAN_SEE_OBJ(ch, clock) || !AWAKE(ch))
    return FALSE;

  if (CMD_IS("time")) {
    do_time(ch, "", 0, SCMD_PRECISE);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(anticoagulant)
{
  // this is handled in do_quaff (do_use), do_drink, and do_eat
  return FALSE;
}

SPECIAL(computer_parell)
{
  int i;
  struct obj_data *obj;

  if (!CMD_IS("use"))
    return 0;

  any_one_arg(argument, arg);

  if (!(obj = get_obj_in_list_vis(ch, arg, ch->carrying)))
    if (!(obj = get_object_in_equip_vis(ch, arg, ch->equipment, &i))) {
      send_to_char(ch, "You do not seem to have a '%s'.\r\n", arg);
      return TRUE;
    }

  if (GET_OBJ_VNUM(obj) == PARELL_DISK) {
    extract_obj(obj);
    act("A slip of paper is ejected from $p.",
        FALSE, ch, (struct obj_data *) me, 0, TO_ROOM);
    obj = read_object(PARELL_PRINTOUT, VIRTUAL);
    obj_to_room(obj, ch->in_room);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(vendtix)
{
  extern struct obj_data *obj_proto;
  struct obj_data *vendtix = (struct obj_data *) me;
  int ticket;

  if (!cmd)
    return FALSE;

  if (zone_table[world[ch->in_room].zone].number == 30)
    ticket = SEATAC_TICKET;
  else ticket = SEATTLE_TICKET;

  if (CMD_IS("list")) {
    send_to_char(ch, "Ticket price is %d nuyen.\r\n", obj_proto[real_object(ticket)].obj_flags.cost);
    act("$n presses some buttons on $p.", TRUE, ch, vendtix, 0, TO_ROOM);
    return TRUE;
  }

  if (CMD_IS("buy")) {
    char *tmp = any_one_arg(argument, arg);
    if (!is_abbrev(arg, "ticket")) {
      send_to_char("This machine only sells tickets.\r\n", ch);
      return TRUE;
    }

    if ((GET_NUYEN(ch) - obj_proto[real_object(ticket)].obj_flags.cost) < 0) {
      send_to_char("You don't have enough nuyen!\r\n", ch);
      return TRUE;
    }

    struct obj_data *tobj = read_object(ticket, VIRTUAL);
    if (!tobj) {
      mudlog("No ticket for the Vend-Tix machine!", ch, LOG_SYSLOG, TRUE);
      return TRUE;
    }

    obj_to_char(tobj, ch);
    GET_NUYEN(ch) -= tobj->obj_flags.cost;
    act("You receive $p.", FALSE, ch, tobj, 0, TO_CHAR);
    act("$n buys $p from the Vend-Tix machine.", TRUE, ch, tobj, 0, TO_ROOM);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(bank)
{
  struct obj_data *credstick;
  int amount;

  if (cmd && IS_NPC(ch)) {
    send_to_char(ch, "What use do you have for a bank account?\r\n", ch);
    return FALSE;
  }

  if (CMD_IS("balance")) {
    if (GET_BANK(ch) > 0)
      sprintf(buf, "Your current balance is %d nuyen.\r\n", GET_BANK(ch));
    else sprintf(buf, "Your account is empty!\r\n");
    send_to_char(buf, ch);
    return 1;
  } else if (CMD_IS("deposit")) {
    if ((amount = atoi(argument)) <= 0) {
      send_to_char("How much do you want to deposit?\r\n", ch);
      return 1;
    }
    if (GET_NUYEN(ch) < amount) {
      send_to_char("You aren't carrying that much!\r\n", ch);
      return 1;
    }
    GET_NUYEN(ch) -= amount;
    GET_BANK(ch) += amount;
    sprintf(buf, "You deposit %d nuyen.\r\n", amount);
    send_to_char(buf, ch);
    act("$n accesses the ATM.", TRUE, ch, 0, FALSE, TO_ROOM);
    return 1;
  } else if (CMD_IS("withdraw")) {
    if ((amount = atoi(argument)) <= 0) {
      send_to_char("How much do you want to withdraw?\r\n", ch);
      return 1;
    }
    if (GET_BANK(ch) < amount) {
      send_to_char("You don't have that much deposited!\r\n", ch);
      return 1;
    }
    GET_NUYEN(ch) += amount;
    GET_BANK(ch) -= amount;
    sprintf(buf, "The ATM ejects %d nuyen and updates your bank account.\r\n", amount);
    send_to_char(buf, ch);
    act("$n accesses the ATM.", TRUE, ch, 0, FALSE, TO_ROOM);
    return 1;
  } else if (CMD_IS("transfer")) {
    any_one_arg(any_one_arg(argument, buf), buf1);
    if ((amount = atoi(buf)) <= 0) {
      send_to_char("How much do you want to transfer?\r\n", ch);
      return TRUE;
    }
    if (!(credstick = get_first_credstick(ch, "credstick"))) {
      send_to_char("You need a personalized credstick to do that!\r\n", ch);
      return TRUE;
    }
    if (!str_cmp(buf1, "account")) {
      if (GET_OBJ_VAL(credstick, 0) < amount) {
        act("$p doesn't even have that much!", FALSE, ch, credstick, 0, TO_CHAR);
        return TRUE;
      }
      GET_OBJ_VAL(credstick, 0) -= amount;
      GET_BANK(ch) += amount;
      sprintf(buf, "%d nuyen transferred from $p to your account.", amount);
    } else {
      if (GET_BANK(ch) < amount) {
        send_to_char("You don't have that much deposited!\r\n", ch);
        return TRUE;
      }
      GET_OBJ_VAL(credstick, 0) += amount;
      GET_BANK(ch) -= amount;
      sprintf(buf, "%d nuyen transferred from your account to $p.", amount);
    }
    act(buf, FALSE, ch, credstick, 0, TO_CHAR);
    act("$n accesses the ATM.", TRUE, ch, 0, 0, TO_ROOM);
    return TRUE;
  } else return 0;
}

SPECIAL(rng)
{
  ACMD(do_echo);
  struct char_data *tch;
  struct obj_data *obj, *rng = (struct obj_data *) me;
  struct follow_type *f;
  int result;

  if (CMD_IS("use")) {
    two_arguments(argument, arg, buf1);

    generic_find(arg, FIND_OBJ_INV | FIND_OBJ_ROOM, ch, &tch, &obj);

    if (!obj || obj != rng)
      return FALSE;

    if (!str_cmp(buf1, "group")) {
      if (ch->master || !AFF_FLAGGED(ch, AFF_GROUP)) {
        send_to_char("You have to be the leader of a group to do that!\r\n", ch);
        return TRUE;
      }
      act("$n activates $p and the display lights up.",
          FALSE, ch, rng, 0, TO_ROOM);
      act("You activate $p and the display lights up.",
          FALSE, ch, rng, 0, TO_CHAR);
      result = number(1, 1000);
      sprintf(buf, "%40s: %d.\r\n", GET_NAME(ch), result);
      for (f = ch->followers; f; f = f->next)
        if (AFF_FLAGGED(f->follower, AFF_GROUP)) {
          result = number(1, 1000);
          sprintf(buf + strlen(buf), "%40s: %d.", GET_NAME(f->follower), result);
          if (f->next && AFF_FLAGGED(f->next->follower, AFF_GROUP))
            strcat(buf, "\r\n");
        }
      act(buf, FALSE, ch, 0, 0, TO_CHAR);
      act(buf, FALSE, ch, 0, 0, TO_ROOM);
    } else {
      result = number(1, 1000);
      sprintf(buf, "$n activates $p.  Result = %d.", result);
      sprintf(buf2, "You activate $p.  Result = %d.", result);
      act(buf, FALSE, ch, rng, 0, TO_CHAR);
      act(buf, FALSE, ch, rng, 0, TO_ROOM);
    }

    return TRUE;
  } else if (CMD_IS("emote")) {
    do_echo(ch, argument, 0, SCMD_XEMOTE);
    return TRUE;
  } else if (CMD_IS("echo")) {
    do_echo(ch, argument, 0, SCMD_XECHO);
    return TRUE;
  }
  return FALSE;
}

/* ********************************************************************
*  Special procedures for rooms                                       *
******************************************************************** */

SPECIAL(rope)
{
  if (!cmd)
   return FALSE;

  skip_spaces(&argument);

  if (!CMD_IS("pull") && strcasecmp("rope", argument) && strcasecmp("bell", argument))
    return FALSE;

  send_to_char(ch, "You pull the rope and a bell sounds...\r\n");
  act("$n pulls the rope and a bell sounds...", FALSE, ch, 0, 0, TO_ROOM);

  struct room_data *room = (struct room_data *) me;
  // first we gotta find Tim
  struct char_data *temp = NULL;
  for (temp = character_list; temp; temp = temp->next) {
    if (IS_NPC(temp) && GET_MOB_VNUM(temp) == TIM_ENCHANTER)
      break;
  }

  if (temp) {
    if (temp->in_room == real_room(RUDE_MIRROR)) {
      act("$n exclaims, \"Hey moron, I'm right here!\"", TRUE, temp, 0, 0, TO_ROOM);
    } else {
      do_say(temp, "Pook is a bastard, but at least I get payed well.", 0, 0);
      act("$n wanders off to answer $s call.\r\n", TRUE, temp, 0, 0, TO_ROOM);
      char_from_room(temp);
      char_to_room(temp, real_room(RUDE_MIRROR));
      act("$n arrives in an awful mood.", TRUE, temp, 0, 0, TO_ROOM);
      do_say(temp, "What is it now, you utter tosser?", 0, 0);
    }
  } else {
    send_to_char(ch, "No one seems to respond to your beckon.\r\n");
    act("No one responds to $n's beckon.", FALSE, ch, 0, 0, TO_ROOM);
  }

  return TRUE;
}

SPECIAL(combination)
{
  struct room_data *room = (struct room_data *) me;

  if (!cmd)
    return FALSE;

  if (CMD_IS("type")) {
    skip_spaces(&argument);
    if (*argument == '\0') {
      send_to_char(ch, "You must enter in a combination!\r\n");
      return TRUE;
    }
    int i = atoi(argument);
    if (ch->in_room == real_room(2617)) {
      if (i == 2322) {
        if (IS_SET(EXIT(ch, NORTHWEST)->exit_info, EX_CLOSED)) {
          if (IS_SET(EXIT(ch, NORTHWEST)->exit_info, EX_LOCKED))
            TOGGLE_BIT(EXIT(ch, NORTHWEST)->exit_info, EX_LOCKED);
          if (IS_SET(world[real_room(2618)].dir_option[SOUTHEAST]->exit_info, EX_LOCKED))
            TOGGLE_BIT(world[real_room(2618)].dir_option[SOUTHEAST]->exit_info, EX_LOCKED);
          if (IS_SET(world[real_room(2618)].dir_option[SOUTHEAST]->exit_info, EX_CLOSED))
            TOGGLE_BIT(world[real_room(2618)].dir_option[SOUTHEAST]->exit_info, EX_CLOSED);
          TOGGLE_BIT(EXIT(ch, NORTHWEST)->exit_info, EX_CLOSED);
          act("After $n types in a combination, you hear the sounds of gears and \r\n"
              "levers moving through the stone slab.  The slab opens.", FALSE, ch, 0, 0, TO_ROOM);
          act("After you enter the combination, you hear the sounds of gears and levers\r\n"
              "through the stone slab.  The slab opens.", FALSE, ch, 0, 0, TO_CHAR);
          return TRUE;
        }
      }
    }
    act("$n types in a combination, but nothings seems to happen.", FALSE, ch, 0, 0, TO_ROOM);
    act("You type in a combination, but nothing seems to happen.", FALSE, ch, 0, 0, TO_CHAR);
    return TRUE;
  }

  return FALSE;
}

SPECIAL(oceansounds)
{
  struct room_data *room = (struct room_data *) me;

  if (!cmd && room->people)
    switch (number(1, 100)) {
      case 1:
        send_to_room("A cool breeze blows over the ocean sending ripples across the water.\r\n",
                     real_room(room->number));
        break;
      case 2:
        send_to_room("The cries of seagulls fill the air.\r\n",
                     real_room(room->number));
        break;
      case 3:
        send_to_room("A lone bird skims across the surface of the water.\r\n",
                     real_room(room->number));
        break;
      case 4:
        send_to_room("Water splashes as a fish disturbs the surface of a wave.\r\n",
                     real_room(room->number));
        break;
      case 5:
        send_to_room("The waves continue their endless rhythm towards the shore.\r\n",
                     real_room(room->number));
    }

  return FALSE;
}

SPECIAL(aztec_one)
{
  static int day = 0;
  struct room_data *room = (struct room_data *) me;

  if (!day) {
    if (time_info.hours > 18 || time_info.hours <= 7)
      day = 1;
    else day = 2;
  }

  switch (time_info.hours) {
    case 7:
      if (day != 1)
        return FALSE;

      delete [] room->description;
      room->description = str_dup("   Ahead of you is the entrance to the central"
                "pyramid of the Aztechnology\r\nNorthwest Complex.\r\n"
                "   The walls of Aztechnology appear to be made of a grey carved stone.  You\r\n"
                "see laser carved images of ancient Aztec and Mayan gods surrounding you.\r\n"
                "An impressing carving of the Aztec god, Quetzecoatl adorns the front\r\n"
                "entrance.\r\n");
      day++;
      break;
    case 18:
      if (day != 2)
        return FALSE;

      delete [] room->description;
      room->description = str_dup("  Ahead of you is the entrance to the central pyramid of the Aztechnology\r\n"
                "Northwest Complex.\r\n"
                "   The walls of Aztechology glow in amber and white illumination, very\r\n"
                "dazzling and impressive to the eyes.  Carvings of Aztech and Mayan gods\r\n"
                "glow brightly in the night.  You see tourists in helicopters and\r\n"
                "dirigibles above you, taking pictures and catching eyefuls of the\r\n"
                "impressive sight of the glowing carvings that adorn the walls of the\r\n"
                "Aztechnology Pyramid.  The most impressive carving is that of the Aztech\r\n"
                "god, Quetzecoatl that covers the entrance archway.\r\n");
      day--;
      break;
  }
  return FALSE;
}

SPECIAL(center_initiation)
{
  if (!CMD_IS("north"))
    return FALSE;

  if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_NEWBIE)
      && !(GET_LEVEL(ch) >= LVL_LEGEND))
    switch (GET_TRADITION(ch)) {
      case TRAD_HERMETIC:
        world[ch->in_room].dir_option[NORTH]->to_room = real_room(8003);
        break;
      case TRAD_SHAMANIC:
        world[ch->in_room].dir_option[NORTH]->to_room = real_room(8007);
        break;
      case TRAD_MUNDANE:
        world[ch->in_room].dir_option[NORTH]->to_room = real_room(8001);
        break;
      case TRAD_ADEPT:
        world[ch->in_room].dir_option[NORTH]->to_room = real_room(8040);
        break;
      default:
        act("You may not enter there!", FALSE, ch, 0, 0, TO_CHAR);
        return TRUE;
    }
  else if (!IS_NPC(ch))
    world[ch->in_room].dir_option[NORTH]->to_room = real_room(8029);
  else {
    act("You may not enter there!", FALSE, ch, 0, 0, TO_CHAR);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(neophyte_lobby)
{
  if (!CMD_IS("south"))
    return FALSE;

  if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_NEWBIE)
       && !(GET_LEVEL(ch) >= LVL_LEGEND))
    switch (GET_TRADITION(ch)) {
      case TRAD_HERMETIC:
        world[ch->in_room].dir_option[SOUTH]->to_room = real_room(8014);
        break;
      case TRAD_SHAMANIC:
        world[ch->in_room].dir_option[SOUTH]->to_room = real_room(8024);
        break;
      case TRAD_MUNDANE:
        world[ch->in_room].dir_option[SOUTH]->to_room = real_room(8009);
        break;
      case TRAD_ADEPT:
        world[ch->in_room].dir_option[SOUTH]->to_room = real_room(8042);
        break;
      default:
        act("You may not enter there!", FALSE, ch, 0, 0, TO_CHAR);
        return TRUE;
    }
  else {
    act("You may not enter there!", FALSE, ch, 0, 0, TO_CHAR);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(neophyte_entrance)
{
  if (!cmd)
    return FALSE;

  if ((CMD_IS("west") || CMD_IS("enter")) && !PLR_FLAGGED(ch, PLR_NEWBIE)
       && !(GET_LEVEL(ch) >= LVL_LEGEND)) {
    act("The barrier prevents you from entering the guild.", FALSE, ch, 0, 0, TO_CHAR);
    act("$n stumbles into the barrier covering the entrance.", FALSE, ch, 0, 0, TO_ROOM);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(simulate_bar_fight)
{
  struct room_data *room = (struct room_data *) me;
  struct char_data *vict;
  int dam;

  if (cmd || number(0, 1))
    return FALSE;

  for (vict = room->people; vict; vict = vict->next_in_room)
    if (!IS_NPC(vict) && GET_POS(vict) > POS_RESTING && !number(0, 4))
      break;

  if (!vict)
    return FALSE;
  act("A chair flies across the room, hitting $n square in the head!",
      TRUE, vict, 0, 0, TO_ROOM);
  act("A chair flies across the room, hitting you square in the head!",
      TRUE, vict, 0, 0, TO_CHAR);
  dam = convert_damage(stage(-success_test(GET_WIL(vict), 4), MODERATE));
  damage(vict, vict, dam, 0, FALSE);
  return TRUE;
}

//*
SPECIAL(moonlight_mall)
{
  // Open the Entrance room is start end is last
  int end = real_room(24800);
  int dir = 0,room = 0;

  if(weather_info.moonphase == MOON_FULL && (weather_info.sunlight == SUN_DARK || weather_info.sunlight == SUN_SET))
  {
  	world[room].dir_option[NORTH] = new room_direction_data;
  	memset((char *) world[room].dir_option[NORTH], 0,sizeof (struct room_direction_data));
  	world[room].dir_option[NORTH]->to_room = end;
  	world[room].dir_option[NORTH]->barrier = 8;
  	world[room].dir_option[NORTH]->condition = 8;
  	world[room].dir_option[NORTH]->material = 8;

  	dir = rev_dir[NORTH];

  	world[end].dir_option[dir] = new room_direction_data;
  	memset((char *) world[end].dir_option[dir], 0,sizeof (struct room_direction_data));
  	world[end].dir_option[dir]->to_room = room;
  	world[end].dir_option[dir]->barrier = 8;
  	world[end].dir_option[dir]->condition = 8;
  	world[end].dir_option[dir]->material = 8;
  }
  // Close the entrace
  else
  {
   if (world[room].dir_option[NORTH]->keyword)
    delete [] world[room].dir_option[NORTH]->keyword;
   if (world[room].dir_option[NORTH]->general_description)
    delete [] world[room].dir_option[NORTH]->general_description;
   delete world[room].dir_option[NORTH];
   world[room].dir_option[NORTH] = NULL;

   dir = rev_dir[NORTH];

   if (world[end].dir_option[dir]->keyword)
    delete [] world[end].dir_option[dir]->keyword;
   if (world[end].dir_option[dir]->general_description)
    delete [] world[end].dir_option[dir]->general_description;
   delete world[end].dir_option[dir];
   world[end].dir_option[dir] = NULL;
  }
  return TRUE;
}
//*/

SPECIAL(cpu)
{
  struct descriptor_data *d;
  int i = 0;
  ACMD(do_disconnect);

  if (!CMD_IS("shutdown") && !CMD_IS("cancel"))
    return FALSE;

  if (!IS_PERSONA(ch)) {
    send_to_char("Only deckers can control node commands.\r\n", ch);
    return TRUE;
  }

  if (FIGHTING(ch)) {
    send_to_char("Not while fighting!\r\n", ch);
    return TRUE;
  }

  if (CMD_IS("shutdown")) {
    if (world[ch->in_room].number == CENTRAL_MATRIX_CPU) {
      zone_table[world[ch->in_room].zone].alert = 3;
      for (i = 0; i <= top_of_zone_table; i++)
        zone_table[i].alert = 4;
      for (d = descriptor_list; d; d = d->next)
        if (d->character && !d->connected && d->character != ch && IS_PERSONA(d->character)) {
          send_to_char("Shutdown sequence initiated.  All users logged out.\r\n", d->character);
          do_disconnect(d->character, "", 0, SCMD_MORTED);
        }
      send_to_char("Entire Matrix shutdown.\r\n", ch);
      do_disconnect(ch, "", 0, SCMD_MORTED);
    } else {
      zone_table[world[ch->in_room].zone].alert = 3;
      for (d = descriptor_list; d; d = d->next)
        if (d->character && !d->connected && d->character != ch && IS_PERSONA(d->character) &&
            world[d->character->in_room].zone == world[ch->in_room].zone) {
          send_to_char("Shutdown sequence initiated.  All users logged out.\r\n", d->character);
          do_disconnect(d->character, "", 0, SCMD_MORTED);
        }
      send_to_char("Shutdown sequence initiated.  All users logged out.\r\n", ch);
      do_disconnect(ch, "", 0, SCMD_MORTED);
    }
  } else if (CMD_IS("cancel")) {
    if (!zone_table[world[ch->in_room].zone].alert) {
      send_to_char("But there is no alert to cancel?!\r\n", ch);
      return TRUE;
    }
    send_to_char(ch, "%s alert cancelled.\r\n", (zone_table[world[ch->in_room].zone].alert == 1 ?
                 "Passive" : "Active"));
    zone_table[world[ch->in_room].zone].alert = 0;
  }
  return TRUE;
}

SPECIAL(datastore)
{
  ACMD(do_get);
  ACMD(do_drop);

  if (!CMD_IS("download") && !CMD_IS("upload"))
    return FALSE;

  if (!IS_PERSONA(ch))
    send_to_char("Only deckers can control node commands.\r\n", ch);
  else if (FIGHTING(ch))
    send_to_char("Not while fighting!\r\n", ch);
  else if (CMD_IS("download"))
    do_get(ch, argument, 0, SCMD_DOWNLOAD);
  else if (CMD_IS("upload"))
    do_drop(ch, argument, 0, SCMD_UPLOAD);
  return TRUE;
}

SPECIAL(input_output)
{
  return FALSE;
}

SPECIAL(spu)
{
  return FALSE;
}

SPECIAL(system_access)
{
  return FALSE;
}

SPECIAL(slave)
{
  return FALSE;
}

SPECIAL(junk_pile_fridge)
{
  struct room_data *room = (struct room_data *) me;

  if (!cmd && !IS_SET(room->dir_option[WEST]->exit_info, EX_CLOSED)) {
    send_to_room("The refridgerator door slams shut!\r\n", real_room(room->number));
    SET_BIT(room->dir_option[WEST]->exit_info, EX_CLOSED);
    SET_BIT(room->dir_option[WEST]->exit_info, EX_LOCKED);
    send_to_room("The refridgerator door slams shut!\r\n", room->dir_option[WEST]->to_room);
    SET_BIT(world[room->dir_option[WEST]->to_room].dir_option[EAST]->exit_info, EX_CLOSED);
    SET_BIT(world[room->dir_option[WEST]->to_room].dir_option[EAST]->exit_info, EX_LOCKED);
  } else if (CMD_IS("west") && !IS_SET(room->dir_option[WEST]->exit_info, EX_CLOSED)) {
    act("As you approach the roof, the refridgerator door slams shut, blocking your exit!",
        FALSE, ch, 0, 0, TO_CHAR);
    act("As $n tries to leave, the refridgerator door slams shut!", FALSE, ch, 0, 0, TO_ROOM);
    SET_BIT(room->dir_option[WEST]->exit_info, EX_CLOSED);
    SET_BIT(room->dir_option[WEST]->exit_info, EX_LOCKED);
    send_to_room("The refridgerator door slams shut!\r\n", room->dir_option[WEST]->to_room);
    SET_BIT(world[room->dir_option[WEST]->to_room].dir_option[EAST]->exit_info, EX_CLOSED);
    SET_BIT(world[room->dir_option[WEST]->to_room].dir_option[EAST]->exit_info, EX_LOCKED);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(waterfall)
{
  if (CMD_IS("northeast") || CMD_IS("northwest") || CMD_IS("ne") || CMD_IS("nw")) {
    if (success_test(GET_STR(ch), 10)) {
      act("You push your way through the rushing water and tumble into a vast cavern.",
          FALSE, ch, 0, 0, TO_CHAR);
      act("$n pushes $s way through the waterfall and dissapears.", TRUE, ch, 0, 0, TO_ROOM);
      return FALSE;
    } else {
      act("You succumb to the heavy waves and crack your skull on the floor!", FALSE, ch, 0, 0, TO_CHAR);
      act("$n gets slammed down by the waves and hits $s head on the floor!", TRUE, ch, 0, 0, TO_ROOM);
      damage(ch, ch, number(1, 2), 0, TRUE);
      return TRUE;
    }
  }
  return FALSE;
}

SPECIAL(crime_mall_blockade)
{
  if (!cmd)
    return FALSE;
  int found = 0;
  struct char_data *temp;

  for (temp = world[ch->in_room].people; temp && !found; temp = temp->next_in_room)
    if (IS_NPC(temp) && GET_MOB_VNUM(temp) == 10022)
      found = 1;
  if (!found)
    if ((world[ch->in_room].number == 10075 && CMD_IS("east")) || (world[ch->in_room].number == 10077 &&
         CMD_IS("west"))) {
      act("There seems to be an invisible barrier of some kind...", FALSE, ch, 0, 0, TO_CHAR);
      return TRUE;
    }
  return FALSE;
}

SPECIAL(climb_up_junk_pile)
{
  if (CMD_IS("climb")) {
    any_one_arg(argument, arg);
    if (!(!str_cmp(arg, "pile") || !str_cmp(arg, "junk"))) {
      send_to_char("Climb what?\r\n", ch);
      return TRUE;
    }
    if (!success_test(GET_STR(ch), 4)) {
      send_to_char("You lose your grip and fall!\r\n", ch);
      act("$n loses $s grip and falls from the junk pile!", TRUE, ch, 0, 0, TO_ROOM);
      damage(ch, ch, 1, TYPE_FALL, TRUE);
      WAIT_STATE(ch, 2 RL_SEC);
      return TRUE;
    }
    send_to_char("You climb the junk pile easily.\r\n", ch);
    act("$n climbs up the junk pile.", TRUE, ch, 0, 0, TO_ROOM);
    char_from_room(ch);
    char_to_room(ch, real_room(12246));
    look_at_room(ch, 0);
    act("$n climbs up the junk pile.", TRUE, ch, 0, 0, TO_ROOM);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(climb_down_junk_pile)
{
  if (CMD_IS("climb")) {
    any_one_arg(argument, arg);
    if (!(!str_cmp(arg, "pile") || !str_cmp(arg, "junk"))) {
      send_to_char("Climb what?\r\n", ch);
      return TRUE;
    }
    if (!success_test(GET_STR(ch), 4)) {
      send_to_char("You lose your grip and fall!\r\n", ch);
      act("$n loses $s grip and falls from the junk pile!", TRUE, ch, 0, 0, TO_ROOM);
      char_from_room(ch);
      char_to_room(ch, real_room(12278));
      look_at_room(ch, 0);
      act("$n falls from above, landing hard on the ground.", TRUE, ch, 0, 0, TO_ROOM);
      damage(ch, ch, 1, TYPE_FALL, TRUE);
      WAIT_STATE(ch, 2 RL_SEC);
      return TRUE;
    }
    send_to_char("You climb down the junk pile.\r\n", ch);
    act("$n climbs down the junk pile.", TRUE, ch, 0, 0, TO_ROOM);
    char_from_room(ch);
    char_to_room(ch, real_room(12278));
    look_at_room(ch, 0);
    act("$n climbs down the junk pile.", TRUE, ch, 0, 0, TO_ROOM);
    return TRUE;
  }
  return FALSE;
}

SPECIAL(phrodos_receptionist)
{
  struct char_data *recep = (struct char_data *) me;
  struct char_data *vict, *phrodo = NULL;
  struct descriptor_data *d;
  struct obj_data *obj, *pager = NULL;
  int i;

  if (world[recep->in_room].number != PHRODOS_RECEPTION)
    return FALSE;

  if (CMD_IS("east") && memory(recep, ch)) {
    forget(recep, ch);
    return FALSE;
  } else if (!isname("phrodo", ch->player.name) && (CMD_IS("open") ||
             CMD_IS("north"))) {
    do_say(recep, "Sorry, I can't let you do that.", 0, 0);
    return TRUE;
  }

  if (cmd || !AWAKE(ch))
    return 0;

  for (d = descriptor_list; d; d = d->next)
    if (d->character && !d->connected &&
        isname("phrodo", d->character->player.name) &&
        !PLR_FLAGGED(d->character, PLR_EDITING | PLR_WRITING | PLR_MAILING) &&
        !PLR_FLAGGED(d->character, PLR_SWITCHED | PLR_PROJECT | PLR_MATRIX) &&
        !PLR_FLAGGED(d->character, PLR_SPELL_CREATE | PLR_CUSTOMIZE)) {
      phrodo = d->character;
      break;
    }

  if (phrodo) {
    for (obj = phrodo->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_VNUM(obj) == PHRODOS_PAGER) {
        pager = obj;
        break;
      }
    for (i = 0; i < (NUM_WEARS - 1) && !pager; i++)
      if (GET_EQ(phrodo, i) && GET_OBJ_VNUM(GET_EQ(phrodo, i)) == PHRODOS_PAGER) {
        pager = GET_EQ(phrodo, i);
        break;
      }
  }

  for (vict = world[recep->in_room].people; vict; vict = vict->next_in_room)
    if (!IS_NPC(vict) && !memory(recep, vict) && vict != phrodo) {
      remember(recep, vict);
      if (!phrodo || !CAN_SEE(vict, phrodo)) {
        do_say(recep, "I'm sorry, Phrodo isn't in at this time.", 0, 0);
        do_say(recep, "I can set up an appointment if you want.", 0, 0);
      } else {
        act("$n pushes a button on the intercom and speaks into it.",
            TRUE, recep, 0, 0, TO_ROOM);
        if (pager) {
          act("$p beeps in an annoying high-pitch.", FALSE,
              phrodo, pager, 0, TO_CHAR);
          act("$n's $p beeps annoyingly.", TRUE, phrodo, pager, 0, TO_ROOM);
        }
        sprintf(arg, "Sir, %s is here to see you.", GET_NAME(vict));
        perform_tell(recep, phrodo, arg);
        do_say(recep, "Phrodo will be just a moment.  Please take a seat.", 0, 0);
      }
      return TRUE;
    }

  switch (number(0, 150)) {
    case 0:
      do_say(recep, "Phrodo only sees people by appointment.", 0, 0);
      do_say(recep, "You _do_ have an appointment, right?", 0, 0);
      return FALSE;
    case 1:
      act("The expensive, multiline vidphone on $n's desk rings.",
          FALSE, recep, 0, 0, TO_ROOM);
      act("Your vidphone rings.", FALSE, recep, 0, 0, TO_CHAR);
      do_say(recep, "Hello, Phrodo's Lair Ltd., this is Bridgette.", 0, 0);
      do_say(recep, "How may I help you?", 0, 0);
      return FALSE;
    case 2:
      act("$n polishes $s nails.", FALSE, recep, 0, 0, TO_ROOM);
      act("You begin to polish your nails a lovely hue of ultraviolet.",
          FALSE, recep, 0, 0, TO_CHAR);
      do_say(recep, "You know, I don't think he pays me enough.", 0, 0);
      return FALSE;
  }
  return FALSE;
}

SPECIAL(phrodos_office)
{
  struct char_data *recep, *vict;

  if (CMD_IS("tell")) {
    half_chop(argument, buf, buf2);

    if (IS_NPC(ch) || !isname("phrodo", ch->player.name) ||
        !isname("bridgette", buf) || !strstr(buf2, "admit "))
      return FALSE;

    for (recep = world[real_room(PHRODOS_RECEPTION)].people; recep;
         recep = recep->next_in_room)
      if (IS_NPC(recep) && isname("bridgette", recep->player.name))
        break;

    if (!recep)
      return FALSE;

    char *name, *ptr = (strstr(buf2, "admit ") + 6);
    name = new char[20];
    any_one_arg(ptr, name);

    perform_tell(ch, recep, buf2);

    if (!(vict = get_char_room(name, recep->in_room)) || IS_NPC(vict))
      perform_tell(recep, ch, "There is no one waiting by that name.");
    else {
      act("$n opens the door, leads $N through, and closes it behind $M.",
          TRUE, recep, 0, vict, TO_NOTVICT);
      act("You lead $N into Phrodo's office.", FALSE, recep, 0, vict, TO_CHAR);
      act("$n opens the door, leads you through, and closes it behind you.",
          FALSE, recep, 0, vict, TO_VICT);
      char_from_room(vict);
      char_to_room(vict, ch->in_room);
      look_at_room(vict, 0);
      act("$n is shown into the office.", TRUE, vict, 0, 0, TO_ROOM);
    }

    delete [] name;
    return TRUE;
  }
  return FALSE;
}

SPECIAL(ghosts_receptionist)
{
  struct char_data *recep = (struct char_data *) me;
  struct char_data *vict, *ghost = NULL;
  struct descriptor_data *d;
  struct obj_data *obj, *pager = NULL;
  int i;


  if (world[recep->in_room].number != GHOSTS_RECEPTION)
    return FALSE;

  if (CMD_IS("up") && memory(recep, ch)) {
    forget(recep, ch);
    return FALSE;
  } else if (!isname("ghost", ch->player.name) && (CMD_IS("open") ||
             CMD_IS("north"))) {
    do_say(recep, "Sorry, I can't let you do that.", 0, 0);
    return TRUE;
  }

  if (cmd || !AWAKE(ch))
    return 0;

  for (d = descriptor_list; d; d = d->next)
    if (d->character && !d->connected &&
        isname("ghost", d->character->player.name) &&
        !PLR_FLAGGED(d->character, PLR_EDITING | PLR_WRITING | PLR_MAILING) &&
        !PLR_FLAGGED(d->character, PLR_SWITCHED | PLR_PROJECT | PLR_MATRIX) &&
        !PLR_FLAGGED(d->character, PLR_SPELL_CREATE | PLR_CUSTOMIZE)) {
      ghost = d->character;
      break;
    }

  if (ghost) {
    for (obj = ghost->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_VNUM(obj) == GHOSTS_PAGER) {
        pager = obj;
        break;
      }
    for (i = 0; i < (NUM_WEARS - 1) && !pager; i++)
      if (GET_EQ(ghost, i) && GET_OBJ_VNUM(GET_EQ(ghost, i)) == GHOSTS_PAGER) {
        pager = GET_EQ(ghost, i);
        break;
      }
  }

  for (vict = world[recep->in_room].people; vict; vict = vict->next_in_room)
    if (!IS_NPC(vict) && !memory(recep, vict) && vict != ghost) {
      remember(recep, vict);
      if (!ghost || !CAN_SEE(vict, ghost)) {
        do_say(recep, "I'm sorry, Ghost isn't in at this time.", 0, 0);
        do_say(recep, "I can set up an appointment if you want.", 0, 0);
      } else {
        act("$n pushes a button on the intercom and speaks into it.",
            TRUE, recep, 0, 0, TO_ROOM);
        if (pager) {
          act("$p beeps in an annoying high-pitch.", FALSE,
              ghost, pager, 0, TO_CHAR);
          act("$n's $p beeps annoyingly.", TRUE, ghost, pager, 0, TO_ROOM);
        }
        sprintf(arg, "Sir, %s is here to see you.", GET_NAME(vict));
        perform_tell(recep, ghost, arg);
        do_say(recep, "Ghost will be just a moment.  Please take a seat.", 0, 0);
      }
      return TRUE;
    }

  return FALSE;
}

SPECIAL(ghosts_office)
{
  struct char_data *recep, *vict;

  if (CMD_IS("tell")) {
    half_chop(argument, buf, buf2);

    if (IS_NPC(ch) || !isname("ghost", ch->player.name) ||
        !isname("michele", buf) || !strstr(buf2, "admit "))
      return FALSE;

    for (recep = world[real_room(GHOSTS_RECEPTION)].people; recep;
         recep = recep->next_in_room)
      if (IS_NPC(recep) && isname("michele", recep->player.name))
        break;

    if (!recep)
      return FALSE;

    char *name, *ptr = (strstr(buf2, "admit ") + 6);
    name = new char[20];
    any_one_arg(ptr, name);

    perform_tell(ch, recep, buf2);

    if (!(vict = get_char_room(name, recep->in_room)) || IS_NPC(vict))
      perform_tell(recep, ch, "There is no one waiting by that name.");
    else {
      act("$n opens the door, leads $N through, and closes it behind $M.",
          TRUE, recep, 0, vict, TO_NOTVICT);
      act("You lead $N into Ghost's office.", FALSE, recep, 0, vict, TO_CHAR);
      act("$n opens the door, leads you through, and closes it behind you.",
          FALSE, recep, 0, vict, TO_VICT);
      char_from_room(vict);
      char_to_room(vict, ch->in_room);
      look_at_room(vict, 0);
      act("$n is shown into the office.", TRUE, vict, 0, 0, TO_ROOM);
    }

    delete [] name;
    return TRUE;
  }
  return FALSE;
}