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ISTRY/
LPMUD/MUDLIB/SECURE/
LPMUD/MUDLIB/SECURE/UDP_CMD_/
LPMUD/MUDLIB/SKILLS/
LPMUD/MUDLIB/SKILLS/FIGHTER/
LPMUD/MUDLIB/SKILLS/THIEF/
LPMUD/MUDLIB/USR/
LPMUD/MUDLIB/USR/CREATORS/
LPMUD/MUDLIB/USR/PLAYERS/
#include <mudlib.h>
inherit ROOM;

static object elf;
void make_items();

void reset(status arg) {
  reset_doors(arg);
  load_door(({
     "file",   "room/city/pub/pub",        
     "direction", "east door",
     "key id", "city key",
     "long",
          "A large wooden door with a peep hole in the center.\n",
  }));
  if(!find_living("earothas") || !elf) {
    elf = clone_object(MONSTER);
    elf -> set_name("earothas");
    elf -> set_short("Lieutenant Earothas of the city guard");
    elf -> set_long(
       "The lieutenant is a strong, sturdy elf of about 22 human years, \n"+
       "with the muscle many warriors would be jealous of. He is here   \n"+
       "to make sure that no one gets into any trouble.\n");
    elf -> set_al(1000); /* what a nice guy */
    elf -> set_race("elf");
    elf -> set_wander(75, 120);
    elf -> add_spell_immunity("charm");
    elf -> add_spell_immunity("fire");
    elf -> set_gender(1);
    elf -> load_chat(10, ({ "Earothas says: Move along quietly then.\n",
       "Earothas asks: What are you doing here, fair stranger?\n",
       "Earothas polishes his longsword.\n",
       "Earothas polishes his breastplate.\n",
       "Earothas watches your movements closely.\n",
       "Earothas says: Make no trouble while you stay in Tempus.\n",
       "Earothas says: Hello fair traveller.\n",
    }));
    elf -> load_a_chat(8,({
       "Earothas exclaims: Foul beast!\n",
       "Earothas frowns.\n",
       "Earothas you dare make me an enemy!\n",
       "Earothas says: You shall die, pittiful beast.\n",
       "Earothas defends against your blow.\n",
       "Earothas deflects your blow.\n",
       "Earothas parries your attack.\n",
    }));
    elf -> add_class("mage");
    elf -> add_class("fighter");
    elf -> load_spells(20,({ 
       "fire shield", "burning hands", "comet", "chill touch", 
       "ice storm", "stoneskin", "chain lightning", "death spell",
       "hold person", "pws", "pwk", "meteor swarm",
    }));
    elf -> set_level(30);
    elf -> set_hp(2500);
    elf -> add_money(100 + random(500));
    elf -> set_magic_resist(25 + random(50));
    elf -> set_heart_ob(this_object());
    move_object(elf, this_object());
  }
  make_items();
  if(arg) return;
  set_short("Market Street");
  set_long(
     "\tMarket Street\n"+
     "Fine grey cobblestones line the way up and down the long \n"+
     "busy market street; a place where all kinds of business  \n"+
     "takes place.  The wall of the city gardens opens at its  \n"+
     "east gate here, and the city inn stands to the east.     \n");

  set_night_desc(
     "The light from the inn shines down on the grey cobblestones \n"+
     "highlighting their excelent workmanship.\n");
  set_day_desc(
     "The street is still a little messy from last nights drinking.\n");
 
  set_night_items(({
     "light",
          "A light from one of the inn's windows",
     "window",
          "There is a woman at the window, peering out into the street",
     "woman",
          "She is very beautiful",
  }));
  set_day_items(({
     "mess",
          "A few bottles lie on the street, waiting to be cleaned up",
  }));
  set_items(({
     "cobblestone#cobblestones",
          "The cobblestones are excelently chiseled, possibly from \n"+
          "the dwarvish mines to the far north",
     "wall",
          "The walls to the city gardens are to the west",
     "inn",
          "Skandles Downfall; the city inn",
  }));
  set_weather(1,1,0);
  set_exits(({
     "room/city/market3",        "north",
     "room/city/market5",        "south",
     "room/city/garden/e_gate",  "west",
  }));
}


void monster_heart_beat() {
  int i;
  object *bandit;

  bandit = all_inventory(environment(elf));
  for(i=0; i<sizeof(bandit); i++) { /* this will be a little NPC combat fun */
    if(bandit[i] -> id("orc") && living(bandit[i])) {
      if(!bandit[i]->add_secondary_attacker(elf))
        bandit[i]->hit_player(10);
      if(!random(5))
        tell_room(environment(elf),
          "Earothas exclaims: Putrid orc!\n"); /* he hates orcs */
    }

    if(bandit[i] -> query_alignment() < -10) {
      tell_room(environment(elf), "Earothas exclaims: Evil scum!\n");
      bandit[i] -> hit_player(random(5)); /* ouch! */
    }

    if(bandit[i] ->id("corpse")) {
      tell_room(environment(elf), "Earothas takes the corpse.\n");
      move_object(bandit[i], elf);
    }
  }
}

void make_items() {
  object obj, obj2;
  
  if(!present("sword"), elf)
    move_object(clone_object("room/city/obj/lsword"),elf);
  if(!present("armour"),elf)
    move_object(clone_object("room/city/obj/plate"),elf);
  if(!present("shield"),elf) {
    obj = clone_object(ARMOUR);
    obj -> set_name("shield");
    obj -> set_type("shield");
    obj -> set_ac(2); /* because he is so tough */
    obj -> set_weight(2);
    obj -> set_value(600);
    obj -> set_short("A silver shield");
    obj -> set_long(
               "This shield bears elvish designs across its middle.\n"+
               "The crest on the front is the design of the Tempus \n"+
               "city guards.");
    move_object(obj,elf);
  }
  command("wear shield",elf);
  command("wear armour",elf);
  command("wield sword",elf);
  elf -> set_wc(30);
  elf -> set_ac(20);
}