nightmare3_fluffos_v2/
nightmare3_fluffos_v2/bin/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/ChangeLog.old/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/Win32/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/simuls/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/clone/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/command/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/data/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/etc/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/master/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/log/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/compiler/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/efuns/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/operators/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/u/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/tmp/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/windows/
nightmare3_fluffos_v2/lib/cmds/ambassador/
nightmare3_fluffos_v2/lib/cmds/database/
nightmare3_fluffos_v2/lib/cmds/hm/
nightmare3_fluffos_v2/lib/cmds/soul/
nightmare3_fluffos_v2/lib/daemon/cfg/
nightmare3_fluffos_v2/lib/daemon/cfg/mon_races/
nightmare3_fluffos_v2/lib/daemon/cfg/races/
nightmare3_fluffos_v2/lib/daemon/include/
nightmare3_fluffos_v2/lib/daemon/save/
nightmare3_fluffos_v2/lib/daemon/services/
nightmare3_fluffos_v2/lib/daemon/soul/
nightmare3_fluffos_v2/lib/doc/
nightmare3_fluffos_v2/lib/doc/TestPlans/
nightmare3_fluffos_v2/lib/doc/approval/
nightmare3_fluffos_v2/lib/doc/approval/QC/
nightmare3_fluffos_v2/lib/doc/approval/balance/
nightmare3_fluffos_v2/lib/doc/build/
nightmare3_fluffos_v2/lib/doc/build/armours/
nightmare3_fluffos_v2/lib/doc/build/economy/
nightmare3_fluffos_v2/lib/doc/build/etc/
nightmare3_fluffos_v2/lib/doc/build/monster/
nightmare3_fluffos_v2/lib/doc/build/room/
nightmare3_fluffos_v2/lib/doc/build/virtual/
nightmare3_fluffos_v2/lib/doc/build/weapon/
nightmare3_fluffos_v2/lib/doc/classes/
nightmare3_fluffos_v2/lib/doc/efun/
nightmare3_fluffos_v2/lib/doc/etc/
nightmare3_fluffos_v2/lib/doc/help/creator/
nightmare3_fluffos_v2/lib/doc/help/hm/
nightmare3_fluffos_v2/lib/doc/law/
nightmare3_fluffos_v2/lib/doc/lpc/basic/
nightmare3_fluffos_v2/lib/doc/lpc/data_types/
nightmare3_fluffos_v2/lib/doc/lpc/etc/
nightmare3_fluffos_v2/lib/doc/lpc/intermediate/
nightmare3_fluffos_v2/lib/doc/lpc/types/
nightmare3_fluffos_v2/lib/doc/mudlib/
nightmare3_fluffos_v2/lib/doc/mudlib/features/
nightmare3_fluffos_v2/lib/domains/Examples/etc/
nightmare3_fluffos_v2/lib/domains/Examples/room/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaA/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaB/
nightmare3_fluffos_v2/lib/domains/Examples/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/
nightmare3_fluffos_v2/lib/domains/Praxis/adm/
nightmare3_fluffos_v2/lib/domains/Praxis/attic/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/mon/
nightmare3_fluffos_v2/lib/domains/Praxis/data/
nightmare3_fluffos_v2/lib/domains/Praxis/death/
nightmare3_fluffos_v2/lib/domains/Praxis/mountains/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/armour/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/magic/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/orc_valley/
nightmare3_fluffos_v2/lib/domains/Praxis/quests/
nightmare3_fluffos_v2/lib/domains/Praxis/standardOld/
nightmare3_fluffos_v2/lib/include/
nightmare3_fluffos_v2/lib/log/
nightmare3_fluffos_v2/lib/log/errors/
nightmare3_fluffos_v2/lib/log/reports/
nightmare3_fluffos_v2/lib/log/watch/
nightmare3_fluffos_v2/lib/news/
nightmare3_fluffos_v2/lib/secure/cfg/
nightmare3_fluffos_v2/lib/secure/cmds/ambassador/
nightmare3_fluffos_v2/lib/secure/cmds/mortal/
nightmare3_fluffos_v2/lib/secure/save/users/d/
nightmare3_fluffos_v2/lib/secure/std/
nightmare3_fluffos_v2/lib/std/hm/
nightmare3_fluffos_v2/lib/std/living/
nightmare3_fluffos_v2/lib/std/room/
nightmare3_fluffos_v2/lib/std/user/
nightmare3_fluffos_v2/lib/std/virtual/
nightmare3_fluffos_v2/lib/www/
nightmare3_fluffos_v2/lib/www/errors/
nightmare3_fluffos_v2/lib/www/gateways/
nightmare3_fluffos_v2/win32/
/*    /d/standard/obj/mon/receptionist.c
 *    from Nightmare IV
 *    receptionist for the Nightmare Inn
 *    created by Descartes of Borgie and Lassondra of Sunshine@Nightmare 940424
 */

#include <std.h>

inherit MONSTER;

#define ROOMS ([\
101: ([ "name": "regular", "cost":8 ]),\
102: ([ "name": "regular", "cost":8 ]),\
103:([ "name":"regular", "cost":8 ]),\
104:([ "name":"regular", "cost":8 ]),\
105:(["name":"deluxe", "cost":12 ]),\
106:(["name":"deluxe", "cost":12 ]),\
107:([ "name":"deluxe", "cost":12]),\
108:(["name":"deluxe", "cost":12]),\
109:(["name":"honeymoon suite", "cost":20]),\
110:(["name":"honeymoon suite", "cost":20]),\
])

void create() {
    monster::create();
      set_name( "linfield");
      set_id( ({ "linfield", "receptionist" }) );
      set_short( "Linfield, the receptionist" );
      set_long( "Linfield is the dignified receptionist for the "
	       "Nightmare Inn. He stands tall behind the counter, "
	       "waiting to help the next customer. He wears dark "
	       "pants and blazer, with a white shirt and a blue "
	       "and red striped cravate.");
      set_level(15);
      set_gender( "male" );
      set_body_type( "humanoid" );
      set_race( "human" );
      set_hp(700);
      set_class( "mage" );
      set_spells( ({ "shock" }) );
      set_spell_chance(18);
      set_skill( "magic attack", 60);
      set_skill( "melee", 70);
      set_money( "gold", 50);
    }

void init() {
    monster::init();
    add_action("cmd_rent", "rent");
    add_action("cmd_list", "list");
    }

int cmd_list(string str) {
  write( "%^GREEN%^   -=       The Nightmare Inn    =-%^RESET%^");
  write( "\n");
  write( "%^GREEN%^     There are 3 types of rooms.%^RESET%^");     
  write( "%^GREEN%^     Regular: %^RESET%^"+currency_value(ROOMS[101]["cost"], "gold") );
  write( "%^GREEN%^     Deluxe: %^RESET%^" +currency_value(ROOMS[106]["cost"], "gold") ); 
  write( "%^GREEN%^     Honeymoon suite: %^RESET%^" +currency_value(ROOMS[109]["cost"], "gold") );
  write( "%^GREEN%^     To rent a room, type <rent 'room(like deluxe)'>%^RESET%^");
}

int cmd_rent(string str) {
    object ob;
int *arr;
    int cost, i, x;

    if(str != "regular" && str != "deluxe" && str != "honeymoon suite")
      return notify_fail("Rent what sort of room?\n");
    i = sizeof(arr = keys(ROOMS));
    x = -1;
    while(i--) {
        if(ROOMS[arr[i]]["name"] == str &&
          !((int)environment(this_object())->query_occupied(arr[i]))) {
            x = arr[i];
            break;
        }
    }
    if(x == -1)
      return notify_fail("No such room is available right now.\n");
    cost = currency_value(ROOMS[x]["cost"], "gold");
    if(cost > (int)this_player()->query_money("gold")) {
        this_object()->force_me("speak You do not have enough money "
          "for one of those rooms!");
        return 1;
    }
    this_player()->add_money(-cost, "gold");
    environment(this_object())->set_occupied(x);
    message("my_action", sprintf("You rent room %d of the Nightmare Inn.",
      x), this_player());
    message("other_action", sprintf("%s rents a room at the Nightmare Inn.",
      (string)this_player()->query_cap_name()), environment(this_object()),
      ({ this_player() }) );
    ob = new(OBJECT);
    ob->set_name("hotel key");
    ob->set_short("a hotel key");
    ob->set_long(sprintf("The key to room %d at the Nightmare Inn.", x));
    ob->set_mass(50);
    ob->set_value(100);
    ob->set_read(sprintf("The Nightmare Inn.\nRoom %d.\n", x));
    ob->set_id( ({ "key", "hotel key", 
      (string)environment(this_object())->query_key_id(x) }) );
    if((int)ob->move(this_player())) {
        message("my_action", "You drop your key!", this_player());
        message("other_action", sprintf("%s drops %s key!",
          (string)this_player()->query_cap_name(), possessive(this_player())),
          environment(this_object()), ({ this_player() }) );
        ob->move(environment(this_object()));
    }
    return 1;
}