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/
/*    /domains/Praxis/realty.c
 *    from Nightmare IV
 *    the place to buy stuff
 *    created by Descartes of Borg 940702
 */

#include <std.h>
#include <objects.h>

#define DEED_COST 250000
#define ORDER_COST 17000

inherit ROOM;

void create() {
    room::create();
    set_properties( ([ "light":2, "indoors":1 ]) );
    set_short("Praxis Realty");
    set_long(
      "Welcome to Praxis Realty!\n"
      "People come here to buy deeds to build estates, as well as work "
      "orders for making changes to those estates.  The office is built "
      "up in all kinds of dreary colours, with a desk at the far end of the "
      "office being the spot where all business is done."
    );
    set_items( ([ "colours": "Mostly puce.", "desk": (: "at_desk" :),
      "office":"A nice little space with a desk in it." ]) );
    set_exits( ([ "north" : "/"+__DIR__+"unnamed1" ]) );
}

void init() {
    room::init();
    add_action("read_list", "read");
    add_action("cmd_buy", "buy");
}

void reset() {
    object ob, arm;

    room::reset();
    if(present("atmos")) return;
    ob = new(MONSTER);
    ob->set_name("atmos");
   ob->set_properties( (["no paralyze":1, "no steal":1]));
    ob->set_id( ({ "atmos", "atmos the patron of high mortals", "patron",
      "realtor" }) );
    ob->set_short("Atmos, the Patron of High Mortals");
    ob->set_long("Atmos is a geek.");
    ob->set_level(66);
    ob->set_race("artrell");
    ob->set_class("mage");
    ob->add_money("gold", currency_value(100, "gold"));
    ob->set_stats("constitution", 500);
    ob->set_stats("dexterity",500);
    ob->set_stats("strength", 500);
    ob->set_skill("melee", 390);
    ob->set_skill("defense", 500);
    ob->set_skill("stealth", 300);
    ob->set_skill("magic attack", 500);
    ob->set_hp(1000000);
    ob->set_mp(5000000);
    ob->set_spell_chance(20);
    ob->set_spells( ({ "freeze", "fireball" }) );
    ob->set_alignment(100);
    ob->add_limb("head","FATAL",800000,0,15);
    ob->add_limb("torso","FATAL",800000,0,15);
    ob->add_limb("first arm","",600000,0,15);
    ob->add_limb("second arm","",600000,0,15);
    ob->add_limb("third arm","",600000,0,15);
    ob->add_limb("fourth arm","",600000,0,15);
    ob->add_limb("first hand","",400000,0,15);
    ob->add_limb("second hand",400000,0,15);
    ob->add_limb("third hand","",400000,0,15);
    ob->add_limb("fourth hand","",400000,0,15);
    ob->add_limb("left leg","",600000,0,15);
    ob->add_limb("right leg","",600000,0,15);
    ob->add_limb("left foot","",400000,0,15);
    ob->add_limb("right foot","",400000,0,15);
    ob->move(this_object());
    arm = new(ARMOUR);
    arm->set_name("plate of atmos");
    arm->set_id( ({ "plate", "plate of atmos" }) );
    arm->set_adjectives( ({ "heavy", "the" }) );
    arm->set_short("the plate of Atmos");
    arm->set_long("A beautifully crafted, fake-silver plate armour once "
      "owned by Atmos the Geek.");
    arm->set_ac(10);
    arm->set_destroy(1);
    arm->set_value(1000);
    arm->set_mass(1500);
    arm->set_type("armour");
    arm->set_limbs( ({ "torso", "first arm", "second arm", "third arm",
      "fourth arm" }) );
    arm->set_illuminate(20);
    arm->move(ob);
    ob->force_me("wear plate");
}

static int cmd_buy(string str) {
    object ob;

     if(!present("atmos", this_object())) 
      return notify_fail("Atmos is missing!\n");
    if(str == "deed") {
        if((int)this_player()->query_money("gold") <
          currency_value(DEED_COST, "gold")) {
            message("my_action", "You do not have enough gold.",this_player());
            return 1;
        }
        message("my_action", "You purchase a deed.", this_player());
        message("other_action", (string)this_player()->query_cap_name()+
          " purchases a deed.", this_object(), ({ this_player() }));
        this_player()->add_money("gold", -currency_value(DEED_COST, "gold"));
        ob = new(OB_DEED);
        if((int)ob->move(this_player())) {
            message("my_action", "You drop your deed.", this_player());
            message("other_action", (string)this_player()->query_cap_name()+
              " drops "+possessive(this_player())+" deed.", this_object(),
              ({ this_player() }));
            ob->move(this_object());
        }
        return 1;
    }
    else if(str == "order" || str == "work order" ) {
        if((int)this_player()->query_money("gold") <
          currency_value(ORDER_COST, "gold")) {
            ob->force_me("speak You are too low on gold!");
            return 1;
        }
        message("my_action", "You purchase a work order.", this_player());
        message("other_action", (string)this_player()->query_cap_name()+
          " purchases a work order.", this_object(), ({ this_player() }));
        this_player()->add_money("gold", -currency_value(ORDER_COST, "gold"));
        ob = new(OB_ORDER);
        if((int)ob->move(this_player())) {
            message("my_action", "You drop the work order!", this_player());
            message("other_action", (string)this_player()->query_cap_name()+
              " drops "+possessive(this_player())+" work order.",
              this_object(), ({ this_player() }));
            ob->move(this_object());
        }
        return 1;
    }
    else return 0;
}

string at_desk(string str) {
    string tmp;

    tmp = "A list of real estate options is posted on the desk.  ";
    if(present("atmos")) tmp += "Atmos is seated behind it waiting.";
    else tmp += "No one seems to be around.";
    return tmp;
}
static int read_list(string str) {
    string tmp;

    if(str != "list") return 0;
    tmp = "Welcome to Praxis Realty!\n"
      "You may purchase any of the following items:\n"
      "    deed- an estate deed for creating an estate:  "+
        currency_value(DEED_COST, "gold")+" gold.\n"
      "    order- a work order for adding rooms:         "+
        currency_value(ORDER_COST, "gold")+" gold.\n";
    message("info", tmp, this_player());
    return 1;
}